ThreadWeaver
ThreadWeaver::JobCollection Class Reference
A JobCollection is a vector of Jobs that will be queued together. More...
#include <JobCollection.h>

Public Slots | |
void | stop (ThreadWeaver::Job *job) |
Public Member Functions | |
virtual void | addJob (Job *) |
bool | canBeExecuted () |
JobCollection (QObject *parent=0) | |
~JobCollection () | |
Protected Member Functions | |
void | aboutToBeDequeued (WeaverInterface *weaver) |
void | aboutToBeQueued (WeaverInterface *weaver) |
void | finalCleanup () |
virtual void | internalJobDone (Job *) |
Job * | jobAt (int i) |
const int | jobListLength () |
Detailed Description
A JobCollection is a vector of Jobs that will be queued together.In a JobCollection, the order of execution of the elements is not guaranteed.
It is intended that the collection is set up first and then queued. After queuing, no further jobs should be added to the collection.
JobCollection emits a done(Job*) signal when all of the jobs in the collection have completed.
Definition at line 49 of file JobCollection.h.
Constructor & Destructor Documentation
JobCollection::JobCollection | ( | QObject * | parent = 0 |
) | [explicit] |
Definition at line 131 of file JobCollection.cpp.
JobCollection::~JobCollection | ( | ) |
Definition at line 137 of file JobCollection.cpp.
Member Function Documentation
void JobCollection::aboutToBeDequeued | ( | WeaverInterface * | weaver | ) | [protected, virtual] |
Overload to dequeue the collection.
Reimplemented from ThreadWeaver::Job.
Definition at line 181 of file JobCollection.cpp.
void JobCollection::aboutToBeQueued | ( | WeaverInterface * | weaver | ) | [protected, virtual] |
Overload to queue the collection.
Reimplemented from ThreadWeaver::Job.
Reimplemented in ThreadWeaver::JobSequence.
Definition at line 167 of file JobCollection.cpp.
void JobCollection::addJob | ( | Job * | job | ) | [virtual] |
Append a job to the collection.
To use JobCollection, 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.
Definition at line 145 of file JobCollection.cpp.
bool JobCollection::canBeExecuted | ( | ) | [virtual] |
Overload to manage recursive sets.
Reimplemented from ThreadWeaver::Job.
Definition at line 249 of file JobCollection.cpp.
void JobCollection::finalCleanup | ( | ) | [protected] |
Perform the task usually done when one individual job is finished, but in our case only when the whole collection is finished or partly dequeued.
Definition at line 305 of file JobCollection.cpp.
void JobCollection::internalJobDone | ( | Job * | job | ) | [protected, virtual] |
Callback method for done jobs.
Reimplemented in ThreadWeaver::JobSequence.
Definition at line 299 of file JobCollection.cpp.
Job * JobCollection::jobAt | ( | int | i | ) | [protected] |
Return a reference to the job in the job list at position i.
Definition at line 236 of file JobCollection.cpp.
const int JobCollection::jobListLength | ( | ) | [protected] |
void JobCollection::stop | ( | ThreadWeaver::Job * | job | ) | [slot] |
Stop processing, dequeue all remaining Jobs.
job is supposed to be an element of the collection.
Definition at line 155 of file JobCollection.cpp.
The documentation for this class was generated from the following files: