ThreadWeaver

destructedstate.cpp
1/* -*- C++ -*-
2 This file implements 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.cpp 30 2005-08-16 16:16:04Z mirko $
9*/
10
11#include "destructedstate.h"
12
13namespace ThreadWeaver
14{
15DestructedState::DestructedState(QueueSignals *)
16 : WeaverImplState(nullptr) // make sure we cannot use weaver, ever :-)
17{
18}
19
23
25{
26 return nullptr;
27}
28
30{
31 return nullptr;
32}
33
37
39{
40 return 0;
41}
42
44{
45 return 0;
46}
47
51
52bool DestructedState::dequeue(const JobPointer &)
53{
54 return false;
55}
56
60
64
66{
67 return true;
68}
69
71{
72 return true;
73}
74
76{
77 return 0;
78}
79
83
87
91
92JobPointer DestructedState::applyForWork(Thread *, bool wasBusy)
93{
94 Q_UNUSED(wasBusy) // except in Q_ASSERT
95 Q_ASSERT(wasBusy == false);
96 return JobPointer();
97}
98
99void DestructedState::waitForAvailableJob(Thread *)
100{
101}
102
104{
105 return Destructed;
106}
107
108}
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?
bool isIdle() const override
Is the weaver idle?
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.
bool dequeue(const JobPointer &job) override
Remove a job from 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-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:57:09 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.