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>.
|
\inmodule QtConcurrent More...
#include <qtconcurrentthreadengine.h>
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 | |
QFutureInterfaceBase * | futureInterface |
QThreadPool * | threadPool |
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 QRunnable * | create (Callable &&functionToRun) |
static QRunnable * | create (std::nullptr_t)=delete |
\inmodule QtConcurrent
Definition at line 51 of file qtconcurrentthreadengine.h.
QtConcurrent::ThreadEngineBase::ThreadEngineBase | ( | QThreadPool * | pool | ) |
Definition at line 131 of file qtconcurrentthreadengine.cpp.
References QRunnable::setAutoDelete().
|
virtual |
Definition at line 137 of file qtconcurrentthreadengine.cpp.
void QtConcurrent::ThreadEngineBase::acquireBarrierSemaphore | ( | ) |
Definition at line 152 of file qtconcurrentthreadengine.cpp.
References QtConcurrent::ThreadEngineBarrier::acquire(), and barrier.
Referenced by QtConcurrent::ThreadEngine< T >::startAsynchronously().
|
privatepure virtual |
|
inlineprotectedvirtual |
Reimplemented in QtConcurrent::FilterKernel< Sequence, KeepFunctor, ReduceFunctor >, QtConcurrent::FilteredReducedKernel< ReducedResultType, Iterator, KeepFunctor, ReduceFunctor, Reducer >, and QtConcurrent::MappedReducedKernel< ReducedResultType, Iterator, MapFunctor, ReduceFunctor, Reducer >.
Definition at line 69 of file qtconcurrentthreadengine.h.
Referenced by QtConcurrent::ThreadEngine< T >::asynchronousFinish(), and startSingleThreaded().
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().
bool QtConcurrent::ThreadEngineBase::isProgressReportingEnabled | ( | ) |
Definition at line 177 of file qtconcurrentthreadengine.cpp.
References futureInterface.
Referenced by QtConcurrent::IterateKernel< Iterator, T >::start().
void QtConcurrent::ThreadEngineBase::reportIfSuspensionDone | ( | ) | const |
Definition at line 157 of file qtconcurrentthreadengine.cpp.
References futureInterface, QFutureInterfaceBase::isSuspending(), and QFutureInterfaceBase::reportSuspended().
Referenced by 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.
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().
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().
|
inlineprotectedvirtual |
Reimplemented in QtConcurrent::FilterKernel< Sequence, KeepFunctor, ReduceFunctor >, QtConcurrent::FilteredReducedKernel< ReducedResultType, Iterator, KeepFunctor, ReduceFunctor, Reducer >, QtConcurrent::IterateKernel< Iterator, T >, QtConcurrent::IterateKernel< Iterator, QtPrivate::MapResultType< Iterator, MapFunctor > >, QtConcurrent::IterateKernel< Iterator, qValueType< Iterator >::value_type >, QtConcurrent::IterateKernel< Iterator, ReducedResultType >, QtConcurrent::IterateKernel< Iterator, void >, QtConcurrent::IterateKernel< Sequence::const_iterator, void >, and QtConcurrent::MappedReducedKernel< ReducedResultType, Iterator, MapFunctor, ReduceFunctor, Reducer >.
Definition at line 71 of file qtconcurrentthreadengine.h.
|
inlineprotectedvirtual |
Reimplemented in QtConcurrent::FilterKernel< Sequence, KeepFunctor, ReduceFunctor >, QtConcurrent::FilteredReducedKernel< ReducedResultType, Iterator, KeepFunctor, ReduceFunctor, Reducer >, and QtConcurrent::MappedReducedKernel< ReducedResultType, Iterator, MapFunctor, ReduceFunctor, Reducer >.
Definition at line 72 of file qtconcurrentthreadengine.h.
Referenced by QtConcurrent::IterateKernel< Iterator, T >::forThreadFunction(), QtConcurrent::IterateKernel< Iterator, T >::shouldStartThread(), QtConcurrent::FilteredReducedKernel< ReducedResultType, Iterator, KeepFunctor, ReduceFunctor, Reducer >::shouldThrottleThread(), QtConcurrent::MappedReducedKernel< ReducedResultType, Iterator, MapFunctor, ReduceFunctor, Reducer >::shouldThrottleThread(), and QtConcurrent::IterateKernel< Iterator, T >::whileThreadFunction().
|
inlineprotectedvirtual |
Reimplemented in QtConcurrent::FilteredEachKernel< Iterator, KeepFunctor >, QtConcurrent::IterateKernel< Iterator, T >, QtConcurrent::IterateKernel< Iterator, QtPrivate::MapResultType< Iterator, MapFunctor > >, QtConcurrent::IterateKernel< Iterator, qValueType< Iterator >::value_type >, QtConcurrent::IterateKernel< Iterator, ReducedResultType >, QtConcurrent::IterateKernel< Iterator, void >, and QtConcurrent::IterateKernel< Sequence::const_iterator, void >.
Definition at line 68 of file qtconcurrentthreadengine.h.
Referenced by QtConcurrent::ThreadEngine< T >::startAsynchronously(), and 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().
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().
|
inlineprotectedvirtual |
Reimplemented in QtConcurrent::IterateKernel< Iterator, T >, QtConcurrent::IterateKernel< Iterator, QtPrivate::MapResultType< Iterator, MapFunctor > >, QtConcurrent::IterateKernel< Iterator, qValueType< Iterator >::value_type >, QtConcurrent::IterateKernel< Iterator, ReducedResultType >, QtConcurrent::IterateKernel< Iterator, void >, and QtConcurrent::IterateKernel< Sequence::const_iterator, void >.
Definition at line 70 of file qtconcurrentthreadengine.h.
References QtConcurrent::ThreadFinished.
Referenced by run(), and startSingleThreaded().
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().
|
protected |
Definition at line 91 of file qtconcurrentthreadengine.h.
Referenced by acquireBarrierSemaphore().
|
protected |
Definition at line 92 of file qtconcurrentthreadengine.h.
|
protected |
Definition at line 89 of file qtconcurrentthreadengine.h.
Referenced by QtConcurrent::ThreadEngine< T >::futureInterfaceTyped(), isCanceled(), isProgressReportingEnabled(), reportIfSuspensionDone(), QtConcurrent::ThreadEngine< T >::reportResult(), QtConcurrent::ThreadEngine< T >::reportResults(), setProgressRange(), setProgressValue(), QtConcurrent::FilteredEachKernel< Iterator, KeepFunctor >::start(), QtConcurrent::ThreadEngine< T >::startAsynchronously(), and waitForResume().
|
protected |
Definition at line 93 of file qtconcurrentthreadengine.h.
|
protected |
Definition at line 90 of file qtconcurrentthreadengine.h.
Referenced by QtConcurrent::IterateKernel< Iterator, T >::forThreadFunction(), and QtConcurrent::ThreadEngine< T >::startAsynchronously().