ThreadWeaver::Lambda

Search for usage in LXR

ThreadWeaver::Lambda< T > Class Template Reference

#include <lambda.h>

Inheritance diagram for ThreadWeaver::Lambda< T >:

Public Member Functions

 Lambda (T t_)
 
- Public Member Functions inherited from ThreadWeaver::Job
 Job ()
 
 Job (Private::Job_Private *d)
 
 ~Job () override
 
void aboutToBeDequeued (QueueAPI *api) override
 
void aboutToBeDequeued_locked (QueueAPI *api) override
 
void aboutToBeQueued (QueueAPI *api) override
 
void aboutToBeQueued_locked (QueueAPI *api) override
 
void assignQueuePolicy (QueuePolicy *) override
 
void blockingExecute () override
 
void execute (const JobPointer &job, Thread *) override
 
Executor * executor () const override
 
bool isFinished () const override
 
QMutexmutex () const override
 
void onFinish (const std::function< void(const JobInterface &job)> &lambda)
 
int priority () const override
 
QList< QueuePolicy * > queuePolicies () const override
 
void removeQueuePolicy (QueuePolicy *) override
 
void requestAbort () override
 
Executor * setExecutor (Executor *executor) override
 
void setStatus (Status) override
 
bool shouldAbort () const
 
Status status () const override
 
bool success () const override
 

Protected Member Functions

void run (JobPointer, Thread *) override
 
- Protected Member Functions inherited from ThreadWeaver::Job
Private::Job_Private * d ()
 
const Private::Job_Private * d () const
 
void defaultBegin (const JobPointer &job, Thread *thread) override
 
void defaultEnd (const JobPointer &job, Thread *thread) override
 

Detailed Description

template<typename T>
class ThreadWeaver::Lambda< T >

Lambda is a template that takes any type on which operator() is available, and executes it in run().

Definition at line 19 of file lambda.h.

Constructor & Destructor Documentation

◆ Lambda()

template<typename T >
ThreadWeaver::Lambda< T >::Lambda ( T t_)
inlineexplicit

Definition at line 22 of file lambda.h.

Member Function Documentation

◆ run()

template<typename T >
void ThreadWeaver::Lambda< T >::run ( JobPointer self,
Thread * thread )
inlineoverrideprotectedvirtual

The method that actually performs the job.

It is called from execute(). This method is the one to overload it with the job's task.

The Job will be executed in the specified thread. thread may be zero, indicating that the job is being executed some other way (for example, synchronously by some other job). self specifies the job as the queue sees it. Whenever publishing information about the job to the outside world, for example by emitting signals, use self, not this. self is the reference counted object handled by the queue. Using it as signal parameters will amongst other things prevent thejob from being memory managed and deleted.

Implements ThreadWeaver::Job.

Definition at line 28 of file lambda.h.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:06:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.