9#ifndef WEAVERIMPLSTATE_H
10#define WEAVERIMPLSTATE_H
36 void enqueue(
const QVector<JobPointer> &jobs)
override;
38 bool dequeue(
const JobPointer &job)
override;
QueueSignals declares the Qt signals shared by the Queue and Weaver classes.
Definition queuesignals.h:24
We use a State pattern to handle the system state in ThreadWeaver.
Definition state.h:56
Thread represents a worker thread in a Queue's inventory.
Definition thread.h:28
Base class for all WeaverImpl states.
Definition weaverimplstate.h:21
void finish() override
Finish all queued jobs.
int queueLength() const override
How many jobs are currently queued?
void reschedule() override
Reschedule jobs to threads.
void dequeue() override
Dequeue all jobs.
int currentNumberOfThreads() const override
Returns the current number of threads in the inventory.
Weaver * weaver() override
Provide correct return type for WeaverImpl states.
void waitForAvailableJob(Thread *th) override
Wait (by suspending the calling thread) until a job becomes available.
const State * state() const override
Return the state of the weaver object.
bool isIdle() const override
Are all threads waiting?
void shutDown() override
Shut down the queue.
void requestAbort() override
Request abort for all queued and currently executed jobs.
void setMaximumNumberOfThreads(int cap) override
Set the maximum number of threads this Weaver object may start.
void enqueue(const QVector< JobPointer > &jobs) override
Enqueue a job.
int maximumNumberOfThreads() const override
Get the maximum number of threads this Weaver may start.
bool isEmpty() const override
Are no more jobs queued?
bool dequeue(const JobPointer &job) override
Dequeue a job.
A Weaver manages worker threads.
Definition weaver.h:35