Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QtConcurrent::ThreadEngineBase Class Referenceabstract

\inmodule QtConcurrent More...

#include <qtconcurrentthreadengine.h>

+ Inheritance diagram for QtConcurrent::ThreadEngineBase:
+ Collaboration diagram for QtConcurrent::ThreadEngineBase:

Public Member Functions

 ThreadEngineBase (QThreadPool *pool)
 
virtual ~ThreadEngineBase ()
 
void startSingleThreaded ()
 
void startThread ()
 
bool isCanceled ()
 
void waitForResume ()
 
bool isProgressReportingEnabled ()
 
void setProgressValue (int progress)
 
void setProgressRange (int minimum, int maximum)
 
void acquireBarrierSemaphore ()
 
void reportIfSuspensionDone () const
 
- Public Member Functions inherited from QRunnable
constexpr QRunnable () noexcept=default
 Constructs a QRunnable.
 
virtual ~QRunnable ()
 QRunnable virtual destructor.
 
bool autoDelete () const
 Returns true is auto-deletion is enabled; false otherwise.
 
void setAutoDelete (bool autoDelete)
 Enables auto-deletion if autoDelete is true; otherwise auto-deletion is disabled.
 
template<typename Callable , if_callable< Callable > = true>
 QGenericRunnable (Callable &&c)
 
 ~QGenericRunnable () override
 
void run () override
 

Protected Member Functions

virtual void start ()
 
virtual void finish ()
 
virtual ThreadFunctionResult threadFunction ()
 
virtual bool shouldStartThread ()
 
virtual bool shouldThrottleThread ()
 

Protected Attributes

QFutureInterfaceBasefutureInterface
 
QThreadPoolthreadPool
 
ThreadEngineBarrier barrier
 
QtPrivate::ExceptionStore exceptionStore
 
QBasicMutex mutex
 

Private Member Functions

void run () override
 Implement this pure virtual function in your subclass.
 
virtual void asynchronousFinish ()=0
 

Additional Inherited Members

- Public Types inherited from QRunnable
template<typename Callable >
using if_callable = std::enable_if_t<std::is_invocable_r_v<void, Callable>, bool>
 
- Static Public Member Functions inherited from QRunnable
template<typename Callable , if_callable< Callable > = true>
static QRunnablecreate (Callable &&functionToRun)
 
static QRunnablecreate (std::nullptr_t)=delete
 

Detailed Description

\inmodule QtConcurrent

Definition at line 51 of file qtconcurrentthreadengine.h.

Constructor & Destructor Documentation

◆ ThreadEngineBase()

QtConcurrent::ThreadEngineBase::ThreadEngineBase ( QThreadPool * pool)

Definition at line 131 of file qtconcurrentthreadengine.cpp.

References QRunnable::setAutoDelete().

+ Here is the call graph for this function:

◆ ~ThreadEngineBase()

QtConcurrent::ThreadEngineBase::~ThreadEngineBase ( )
virtual

Definition at line 137 of file qtconcurrentthreadengine.cpp.

Member Function Documentation

◆ acquireBarrierSemaphore()

void QtConcurrent::ThreadEngineBase::acquireBarrierSemaphore ( )

Definition at line 152 of file qtconcurrentthreadengine.cpp.

References QtConcurrent::ThreadEngineBarrier::acquire(), and barrier.

Referenced by QtConcurrent::ThreadEngine< T >::startAsynchronously().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ asynchronousFinish()

◆ finish()

virtual void QtConcurrent::ThreadEngineBase::finish ( )
inlineprotectedvirtual

◆ isCanceled()

bool QtConcurrent::ThreadEngineBase::isCanceled ( )

Definition at line 163 of file qtconcurrentthreadengine.cpp.

References futureInterface, and QFutureInterfaceBase::isCanceled().

Referenced by QtConcurrent::IterateKernel< Iterator, T >::forThreadFunction(), and run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isProgressReportingEnabled()

bool QtConcurrent::ThreadEngineBase::isProgressReportingEnabled ( )

Definition at line 177 of file qtconcurrentthreadengine.cpp.

References futureInterface.

Referenced by QtConcurrent::IterateKernel< Iterator, T >::start().

+ Here is the caller graph for this function:

◆ reportIfSuspensionDone()

void QtConcurrent::ThreadEngineBase::reportIfSuspensionDone ( ) const

Definition at line 157 of file qtconcurrentthreadengine.cpp.

References futureInterface, QFutureInterfaceBase::isSuspending(), and QFutureInterfaceBase::reportSuspended().

Referenced by run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run()

void QtConcurrent::ThreadEngineBase::run ( )
overrideprivatevirtual

Implement this pure virtual function in your subclass.

Implements QRunnable.

Definition at line 231 of file qtconcurrentthreadengine.cpp.

References isCanceled(), reportIfSuspensionDone(), threadFunction(), and QtConcurrent::ThrottleThread.

+ Here is the call graph for this function:

◆ setProgressRange()

void QtConcurrent::ThreadEngineBase::setProgressRange ( int minimum,
int maximum )

Definition at line 189 of file qtconcurrentthreadengine.cpp.

References futureInterface, and QFutureInterfaceBase::setProgressRange().

Referenced by QtConcurrent::IterateKernel< Iterator, T >::start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setProgressValue()

void QtConcurrent::ThreadEngineBase::setProgressValue ( int progress)

Definition at line 183 of file qtconcurrentthreadengine.cpp.

References futureInterface, and QFutureInterfaceBase::setProgressValue().

Referenced by QtConcurrent::IterateKernel< Iterator, T >::forThreadFunction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shouldStartThread()

◆ shouldThrottleThread()

◆ start()

◆ startSingleThreaded()

void QtConcurrent::ThreadEngineBase::startSingleThreaded ( )

Definition at line 139 of file qtconcurrentthreadengine.cpp.

References finish(), start(), QtConcurrent::ThreadFinished, and threadFunction().

Referenced by QtConcurrent::ThreadEngine< T >::startSingleThreaded().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startThread()

void QtConcurrent::ThreadEngineBase::startThread ( )

Definition at line 147 of file qtconcurrentthreadengine.cpp.

Referenced by QtConcurrent::IterateKernel< Iterator, T >::forThreadFunction(), and QtConcurrent::IterateKernel< Iterator, T >::whileThreadFunction().

+ Here is the caller graph for this function:

◆ threadFunction()

virtual ThreadFunctionResult QtConcurrent::ThreadEngineBase::threadFunction ( )
inlineprotectedvirtual

◆ waitForResume()

void QtConcurrent::ThreadEngineBase::waitForResume ( )

Definition at line 171 of file qtconcurrentthreadengine.cpp.

References futureInterface, and QFutureInterfaceBase::waitForResume().

Referenced by QtConcurrent::IterateKernel< Iterator, T >::forThreadFunction(), and QtConcurrent::IterateKernel< Iterator, T >::whileThreadFunction().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ barrier

ThreadEngineBarrier QtConcurrent::ThreadEngineBase::barrier
protected

Definition at line 91 of file qtconcurrentthreadengine.h.

Referenced by acquireBarrierSemaphore().

◆ exceptionStore

QtPrivate::ExceptionStore QtConcurrent::ThreadEngineBase::exceptionStore
protected

Definition at line 92 of file qtconcurrentthreadengine.h.

◆ futureInterface

◆ mutex

QBasicMutex QtConcurrent::ThreadEngineBase::mutex
protected

Definition at line 93 of file qtconcurrentthreadengine.h.

◆ threadPool

QThreadPool* QtConcurrent::ThreadEngineBase::threadPool
protected

The documentation for this class was generated from the following files: