ThreadWeaver::WeaverImplState

Search for usage in LXR

ThreadWeaver::WeaverImplState Class Reference

#include <weaverimplstate.h>

Inheritance diagram for ThreadWeaver::WeaverImplState:

Public Member Functions

 WeaverImplState (QueueSignals *weaver)
 
int currentNumberOfThreads () const override
 
void dequeue () override
 
bool dequeue (const JobPointer &job) override
 
void enqueue (const QList< JobPointer > &jobs) override
 
void finish () override
 
bool isEmpty () const override
 
bool isIdle () const override
 
int maximumNumberOfThreads () const override
 
int queueLength () const override
 
void requestAbort () override
 
void reschedule () override
 
void setMaximumNumberOfThreads (int cap) override
 
void shutDown () override
 
const Statestate () const override
 
void waitForAvailableJob (Thread *th) override
 
- Public Member Functions inherited from ThreadWeaver::State
 State (QueueSignals *weaver)
 
 ~State () override
 
virtual void activated ()
 
virtual StateId stateId () const =0
 
QString stateName () const
 
- Public Member Functions inherited from ThreadWeaver::QueueInterface
virtual void resume ()=0
 
virtual void suspend ()=0
 

Protected Member Functions

const Weaverweaver () const override
 
Weaverweaver () override
 
- Protected Member Functions inherited from ThreadWeaver::State

Detailed Description

Base class for all WeaverImpl states.

Definition at line 20 of file weaverimplstate.h.

Constructor & Destructor Documentation

◆ WeaverImplState()

ThreadWeaver::WeaverImplState::WeaverImplState ( QueueSignals * weaver)
explicit

Definition at line 15 of file weaverimplstate.cpp.

Member Function Documentation

◆ currentNumberOfThreads()

int ThreadWeaver::WeaverImplState::currentNumberOfThreads ( ) const
overridevirtual

Returns the current number of threads in the inventory.

Implements ThreadWeaver::QueueInterface.

Definition at line 52 of file weaverimplstate.cpp.

◆ dequeue() [1/2]

void ThreadWeaver::WeaverImplState::dequeue ( )
overridevirtual

Dequeue all jobs.

Implements ThreadWeaver::QueueInterface.

Definition at line 67 of file weaverimplstate.cpp.

◆ dequeue() [2/2]

bool ThreadWeaver::WeaverImplState::dequeue ( const JobPointer & job)
overridevirtual

Dequeue a job.

Implements ThreadWeaver::QueueInterface.

Definition at line 62 of file weaverimplstate.cpp.

◆ enqueue()

void ThreadWeaver::WeaverImplState::enqueue ( const QList< JobPointer > & jobs)
overridevirtual

Enqueue a job.

Implements ThreadWeaver::QueueInterface.

Definition at line 57 of file weaverimplstate.cpp.

◆ finish()

void ThreadWeaver::WeaverImplState::finish ( )
overridevirtual

Finish all queued jobs.

Implements ThreadWeaver::QueueInterface.

Definition at line 72 of file weaverimplstate.cpp.

◆ isEmpty()

bool ThreadWeaver::WeaverImplState::isEmpty ( ) const
overridevirtual

Are no more jobs queued?

Implements ThreadWeaver::QueueInterface.

Definition at line 77 of file weaverimplstate.cpp.

◆ isIdle()

bool ThreadWeaver::WeaverImplState::isIdle ( ) const
overridevirtual

Are all threads waiting?

Implements ThreadWeaver::QueueInterface.

Definition at line 82 of file weaverimplstate.cpp.

◆ maximumNumberOfThreads()

int ThreadWeaver::WeaverImplState::maximumNumberOfThreads ( ) const
overridevirtual

Get the maximum number of threads this Weaver may start.

Implements ThreadWeaver::QueueInterface.

Definition at line 47 of file weaverimplstate.cpp.

◆ queueLength()

int ThreadWeaver::WeaverImplState::queueLength ( ) const
overridevirtual

How many jobs are currently queued?

Implements ThreadWeaver::QueueInterface.

Definition at line 87 of file weaverimplstate.cpp.

◆ requestAbort()

void ThreadWeaver::WeaverImplState::requestAbort ( )
overridevirtual

Request abort for all queued and currently executed jobs.

Implements ThreadWeaver::QueueInterface.

Definition at line 92 of file weaverimplstate.cpp.

◆ reschedule()

void ThreadWeaver::WeaverImplState::reschedule ( )
overridevirtual

Reschedule jobs to threads.

Implements ThreadWeaver::QueueInterface.

Definition at line 97 of file weaverimplstate.cpp.

◆ setMaximumNumberOfThreads()

void ThreadWeaver::WeaverImplState::setMaximumNumberOfThreads ( int cap)
overridevirtual

Set the maximum number of threads this Weaver object may start.

Implements ThreadWeaver::QueueInterface.

Definition at line 42 of file weaverimplstate.cpp.

◆ shutDown()

void ThreadWeaver::WeaverImplState::shutDown ( )
overridevirtual

Shut down the queue.

Implements ThreadWeaver::QueueInterface.

Definition at line 25 of file weaverimplstate.cpp.

◆ state()

const State * ThreadWeaver::WeaverImplState::state ( ) const
overridevirtual

Return the state of the weaver object.

Implements ThreadWeaver::QueueInterface.

Definition at line 20 of file weaverimplstate.cpp.

◆ waitForAvailableJob()

void ThreadWeaver::WeaverImplState::waitForAvailableJob ( Thread * th)
override

Wait (by suspending the calling thread) until a job becomes available.

Definition at line 102 of file weaverimplstate.cpp.

◆ weaver() [1/2]

const Weaver * ThreadWeaver::WeaverImplState::weaver ( ) const
overrideprotectedvirtual

Reimplemented from ThreadWeaver::State.

Definition at line 36 of file weaverimplstate.cpp.

◆ weaver() [2/2]

Weaver * ThreadWeaver::WeaverImplState::weaver ( )
overrideprotectedvirtual

Provide correct return type for WeaverImpl states.

Reimplemented from ThreadWeaver::State.

Definition at line 30 of file weaverimplstate.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 1 2024 18:47:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.