ThreadWeaver::Collection
#include <collection.h>

Public Member Functions | |
Collection (ThreadWeaver::Private::Collection_Private *d) | |
virtual void | addJob (JobPointer) |
int | elementCount () const |
int | jobListLength () const |
Collection & | operator<< (const ThreadWeaver::JobPointer &job) |
Collection & | operator<< (JobInterface &job) |
Collection & | operator<< (ThreadWeaver::JobInterface *job) |
void | stop (ThreadWeaver::JobPointer 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 |
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 |
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 |
![]() | |
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 31 of file collection.h.
Member Function Documentation
◆ aboutToBeDequeued_locked()
|
overrideprotected |
Overload to dequeue the collection.
Definition at line 121 of file collection.cpp.
◆ aboutToBeQueued_locked()
|
overrideprotected |
Overload to queue the collection.
Definition at line 109 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 88 of file collection.cpp.
◆ elementCount()
int ThreadWeaver::Collection::elementCount | ( | ) | const |
Return the number of elements in the collection.
Definition at line 165 of file collection.cpp.
◆ execute()
|
overrideprotected |
Overload the execute method.
Definition at line 130 of file collection.cpp.
◆ jobAt()
|
protected |
Return a ref-erence to the job in the job list at position i.
Definition at line 158 of file collection.cpp.
◆ jobListLength()
int ThreadWeaver::Collection::jobListLength | ( | ) | const |
- Deprecated:
- Since 5.0, use elementCount().
Definition at line 173 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 181 of file collection.cpp.
◆ operator<<() [1/2]
Collection & ThreadWeaver::Collection::operator<< | ( | const ThreadWeaver::JobPointer & | job | ) |
Add the job to this collection.
Definition at line 192 of file collection.cpp.
◆ operator<<() [2/2]
Collection & ThreadWeaver::Collection::operator<< | ( | ThreadWeaver::JobInterface * | job | ) |
Add the job to this collection by pointer.
Definition at line 186 of file collection.cpp.
◆ run()
|
overrideprotectedvirtual |
Overload run().
We have to.
Implements ThreadWeaver::Job.
Definition at line 143 of file collection.cpp.
◆ stop()
void ThreadWeaver::Collection::stop | ( | ThreadWeaver::JobPointer | job | ) |
Stop processing, dequeue all remaining Jobs.
job is supposed to be an element of the collection.
Definition at line 101 of file collection.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Mar 23 2023 04:17:46 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.