ThreadWeaver

destructedstate.h
1 /* -*- C++ -*-
2  This file declares the DestructedState class.
3 
4  SPDX-FileCopyrightText: 2005-2013 Mirko Boehm <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 
8  $Id: DestructedState.h 32 2005-08-17 08:38:01Z mirko $
9 */
10 
11 #ifndef DestructedState_H
12 #define DestructedState_H
13 
14 #include "weaverimplstate.h"
15 
16 namespace ThreadWeaver
17 {
18 class QueueSignals;
19 
20 /** DestructedState is only active after the thread have been destroyed by
21  * the destructor, but before superclass destructors have finished.
22  */
24 {
25 public:
27  void shutDown() override;
28  Weaver *weaver() override;
29  const Weaver *weaver() const override;
30  void setMaximumNumberOfThreads(int cap) override;
31  int maximumNumberOfThreads() const override;
32  int currentNumberOfThreads() const override;
33  void enqueue(const QVector<JobPointer> &job) override;
34  bool dequeue(const JobPointer &job) override;
35  void dequeue() override;
36  void finish() override;
37  bool isEmpty() const override;
38  bool isIdle() const override;
39  int queueLength() const override;
40  void requestAbort() override;
41  void suspend() override;
42  void resume() override;
43  JobPointer applyForWork(Thread *th, bool wasBusy) override;
44  void waitForAvailableJob(Thread *th) override;
45  StateId stateId() const override;
46 };
47 
48 }
49 
50 #endif // DestructedState_H
int currentNumberOfThreads() const override
Returns the current number of threads in the inventory.
bool isEmpty() const override
Is the queue empty? The queue is empty if no more jobs are queued.
void finish() override
Finish all queued operations, then return.
void dequeue() override
Remove all queued jobs.
Base class for all WeaverImpl states.
StateId stateId() const override
The state Id.
A Weaver manages worker threads.
Definition: weaver.h:34
void requestAbort() override
Request aborts of the currently executed jobs.
void enqueue(const QVector< JobPointer > &job) override
Queue a vector of jobs.
void setMaximumNumberOfThreads(int cap) override
Set the maximum number of threads this Weaver object may start.
void suspend() override
Suspend job execution.
QueueSignals declares the Qt signals shared by the Queue and Weaver classes.
Definition: queuesignals.h:23
DestructedState is only active after the thread have been destroyed by the destructor,...
void resume() override
Resume job queueing.
Weaver * weaver() override
The Weaver interface this state handles.
Thread represents a worker thread in a Queue's inventory.
Definition: thread.h:27
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...
int queueLength() const override
Returns the number of pending jobs.
int maximumNumberOfThreads() const override
Get the maximum number of threads this Weaver may start.
void shutDown() override
Shut down the queue.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 6 2023 04:08:36 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.