10#define JOBCOLLECTION_H
13#include "jobpointer.h"
18class CollectionExecuteWrapper;
22class Collection_Private;
35 Collection(ThreadWeaver::Private::Collection_Private *d);
50 void stop(ThreadWeaver::JobPointer job);
55#if THREADWEAVER_ENABLE_DEPRECATED_SINCE(5, 0)
57 THREADWEAVER_DEPRECATED_VERSION(5, 0,
"Use Collection::elementCount()")
58 int jobListLength() const;
93 friend class CollectionExecuteWrapper;
94 friend class Collection_Private;
95 ThreadWeaver::Private::Collection_Private *d();
96 const ThreadWeaver::Private::Collection_Private *d()
const;
A Collection is a vector of Jobs that will be queued together.
Definition collection.h:32
int elementCount() const
Return the number of elements in the collection.
void stop(ThreadWeaver::JobPointer job)
Stop processing, dequeue all remaining Jobs.
void aboutToBeQueued_locked(QueueAPI *api) override
Overload to queue the collection.
void execute(const JobPointer &job, Thread *) override
Overload the execute method.
Collection & operator<<(ThreadWeaver::JobInterface *job)
Add the job to this collection by pointer.
virtual int jobListLength_locked() const
Return the number of jobs in the joblist.
void run(JobPointer self, Thread *thread) override
Overload run().
virtual void addJob(JobPointer)
Append a job to the collection.
void aboutToBeDequeued_locked(QueueAPI *api) override
Overload to dequeue the collection.
Collection & operator<<(const ThreadWeaver::JobPointer &job)
Add the job to this collection.
JobPointer jobAt(int i)
Return a ref-erence to the job in the job list at position i.
A Job is a simple abstraction of an action that is to be executed in a thread context.
Definition job.h:47
Thread represents a worker thread in a Queue's inventory.
Definition thread.h:28