9#ifndef THREADWEAVER_QUEUE_H
10#define THREADWEAVER_QUEUE_H
14#include "queuesignals.h"
15#include "queuestream.h"
39 explicit Queue(QObject *parent =
nullptr);
54 void enqueue(
const QVector<JobPointer> &jobs)
override;
55 void enqueue(
const JobPointer &job);
56 bool dequeue(
const JobPointer &)
override;
73 virtual Queue *create(QObject *parent) = 0;
QueueSignals declares the Qt signals shared by the Queue and Weaver classes.
Definition queuesignals.h:24
QueueStream implements a stream based API to access ThreadWeaver queues.
Definition queuestream.h:22
Queue implements a ThreadWeaver job queue.
Definition queue.h:36
void resume() override
Resume job queueing.
void enqueue(const QVector< JobPointer > &jobs) override
Queue a vector of jobs.
void shutDown() override
Shut down the queue.
void reschedule() override
Reschedule the jobs in the queue.
void suspend() override
Suspend job execution.
int maximumNumberOfThreads() const override
Get the maximum number of threads this Weaver may start.
void requestAbort() override
Request aborts of the currently executed jobs.
bool dequeue(const JobPointer &) override
Remove a job from the queue.
bool isEmpty() const override
Is the queue empty? The queue is empty if no more jobs are queued.
void dequeue() override
Remove all queued jobs.
int queueLength() const override
Returns the number of pending jobs.
Queue(QueueSignals *implementation, QObject *parent=nullptr)
Construct a queue with a customized implementation The queue takes ownership and will delete the impl...
bool isIdle() const override
Is the weaver idle? The weaver is idle if no jobs are queued and no jobs are processed by the threads...
void setMaximumNumberOfThreads(int cap) override
Set the maximum number of threads this Weaver object may start.
int currentNumberOfThreads() const override
Returns the current number of threads in the inventory.
const State * state() const override
Return the state of the weaver object.
void finish() override
Finish all queued operations, then return.
We use a State pattern to handle the system state in ThreadWeaver.
Definition state.h:56
Interface for the global queue factory.
Definition queue.h:69