ThreadWeaver

destructedstate.h
1/* -*- C++ -*-
2 This file declares the DestructedState class.
3
4 SPDX-FileCopyrightText: 2005-2013 Mirko Boehm <mirko@kde.org>
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
16namespace ThreadWeaver
17{
18class 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{
25public:
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 QList<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
DestructedState is only active after the thread have been destroyed by the destructor,...
StateId stateId() const override
The state Id.
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 requestAbort() override
Request aborts of the currently executed jobs.
void enqueue(const QList< JobPointer > &job) override
Queue a vector of jobs.
void suspend() override
Suspend job execution.
void finish() override
Finish all queued operations, then return.
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.
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...
Weaver * weaver() override
The Weaver interface this state handles.
void setMaximumNumberOfThreads(int cap) override
Set the maximum number of threads this Weaver object may start.
void resume() override
Resume job queueing.
int currentNumberOfThreads() const override
Returns the current number of threads in the inventory.
void shutDown() override
Shut down the queue.
QueueSignals declares the Qt signals shared by the Queue and Weaver classes.
Thread represents a worker thread in a Queue's inventory.
Definition thread.h:28
Base class for all WeaverImpl states.
A Weaver manages worker threads.
Definition weaver.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 12 2024 11:52:00 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.