9#ifndef QueueInterface_H
10#define QueueInterface_H
15#include "jobinterface.h"
16#include "jobpointer.h"
17#include "threadweaver_export.h"
79 virtual void enqueue(
const QVector<JobPointer> &jobs) = 0;
96 virtual bool dequeue(
const JobPointer &job) = 0;
WeaverInterface provides a common interface for weaver implementations.
Definition queueinterface.h:45
virtual void enqueue(const QVector< JobPointer > &jobs)=0
Queue a vector of jobs.
virtual bool isEmpty() const =0
Is the queue empty? The queue is empty if no more jobs are queued.
virtual void requestAbort()=0
Request aborts of the currently executed jobs.
virtual bool isIdle() const =0
Is the weaver idle? The weaver is idle if no jobs are queued and no jobs are processed by the threads...
virtual int currentNumberOfThreads() const =0
Returns the current number of threads in the inventory.
virtual void finish()=0
Finish all queued operations, then return.
virtual void dequeue()=0
Remove all queued jobs.
virtual bool dequeue(const JobPointer &job)=0
Remove a job from the queue.
virtual int maximumNumberOfThreads() const =0
Get the maximum number of threads this Weaver may start.
virtual int queueLength() const =0
Returns the number of pending jobs.
virtual void shutDown()=0
Shut down the queue.
virtual void setMaximumNumberOfThreads(int cap)=0
Set the maximum number of threads this Weaver object may start.
virtual const State * state() const =0
Return the state of the weaver object.
virtual void suspend()=0
Suspend job execution.
virtual void reschedule()=0
Reschedule the jobs in the queue.
virtual void resume()=0
Resume job queueing.
We use a State pattern to handle the system state in ThreadWeaver.
Definition state.h:56