ThreadWeaver::Collection
#include <collection.h>
Public Member Functions | |
Collection (ThreadWeaver::Private::Collection_Private *d) | |
virtual void | addJob (JobPointer) |
int | elementCount () const |
Collection & | operator<< (const ThreadWeaver::JobPointer &job) |
Collection & | operator<< (JobInterface &job) |
Collection & | operator<< (ThreadWeaver::JobInterface *job) |
void | requestAbort () override |
void | stop () |
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 |
QMutex * | mutex () 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 | aboutToBeDequeued_locked (QueueAPI *api) override |
void | aboutToBeQueued_locked (QueueAPI *api) override |
ThreadWeaver::Private::Collection_Private * | d () |
const ThreadWeaver::Private::Collection_Private * | d () const |
void | execute (const JobPointer &job, Thread *) override |
JobPointer | jobAt (int i) |
virtual int | jobListLength_locked () const |
void | run (JobPointer self, Thread *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
A Collection is a vector of Jobs that will be queued together.
In a Collection, the order of execution of the elements is not specified.
It is intended that the collection is set up first and then queued. After queuing, no further jobs should be added to the collection.
Definition at line 34 of file collection.h.
Constructor & Destructor Documentation
◆ Collection()
ThreadWeaver::Collection::Collection | ( | ) |
Definition at line 65 of file collection.cpp.
◆ ~Collection()
|
override |
Definition at line 75 of file collection.cpp.
Member Function Documentation
◆ aboutToBeDequeued_locked()
|
overrideprotected |
Overload to dequeue the collection.
Definition at line 122 of file collection.cpp.
◆ aboutToBeQueued_locked()
|
overrideprotected |
Overload to queue the collection.
Definition at line 110 of file collection.cpp.
◆ addJob()
|
virtual |
Append a job to the collection.
To use Collection, create the Job objects first, add them to the collection, and then queue it. After the collection has been queued, no further Jobs are supposed to be added.
- Note
- Once the job has been added, execute wrappers can no more be set on it
Definition at line 86 of file collection.cpp.
◆ d() [1/2]
|
protected |
Definition at line 158 of file collection.cpp.
◆ d() [2/2]
|
protected |
Definition at line 163 of file collection.cpp.
◆ elementCount()
int ThreadWeaver::Collection::elementCount | ( | ) | const |
Return the number of elements in the collection.
Definition at line 175 of file collection.cpp.
◆ execute()
|
overrideprotected |
Overload the execute method.
Definition at line 140 of file collection.cpp.
◆ jobAt()
|
protected |
Return a ref-erence to the job in the job list at position i.
Definition at line 168 of file collection.cpp.
◆ jobListLength_locked()
|
protectedvirtual |
Return the number of jobs in the joblist.
Assumes that the mutex is being held.
Definition at line 182 of file collection.cpp.
◆ operator<<() [1/3]
Collection & ThreadWeaver::Collection::operator<< | ( | const ThreadWeaver::JobPointer & | job | ) |
Add the job to this collection.
Definition at line 193 of file collection.cpp.
◆ operator<<() [2/3]
Collection & ThreadWeaver::Collection::operator<< | ( | JobInterface & | job | ) |
Definition at line 199 of file collection.cpp.
◆ operator<<() [3/3]
Collection & ThreadWeaver::Collection::operator<< | ( | ThreadWeaver::JobInterface * | job | ) |
Add the job to this collection by pointer.
Definition at line 187 of file collection.cpp.
◆ requestAbort()
|
override |
Dequeue all remaining Jobs and request abortion of all running jobs.
- See also
- Job::requestAbort()
- Since
- 6.0
Definition at line 104 of file collection.cpp.
◆ run()
|
overrideprotectedvirtual |
Overload run().
We have to.
Implements ThreadWeaver::Job.
Definition at line 153 of file collection.cpp.
◆ stop()
void ThreadWeaver::Collection::stop | ( | ) |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.