Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QFutureInterfaceBase Class Reference

#include <qfutureinterface.h>

Inheritance diagram for QFutureInterfaceBase:
Collaboration diagram for QFutureInterfaceBase:

Public Types

enum  State {
  NoState = 0x00 , Running = 0x01 , Started = 0x02 , Finished = 0x04 ,
  Canceled = 0x08 , Suspending = 0x10 , Suspended = 0x20 , Throttled = 0x40 ,
  Pending = 0x80
}

Public Member Functions

 QFutureInterfaceBase (State initialState=NoState)
 QFutureInterfaceBase (const QFutureInterfaceBase &other)
 QFutureInterfaceBase (QFutureInterfaceBase &&other) noexcept
QFutureInterfaceBase & operator= (const QFutureInterfaceBase &other)
virtual ~QFutureInterfaceBase ()
void reportStarted ()
void reportFinished ()
void reportCanceled ()
void reportException (const QException &e)
void reportException (const std::exception_ptr &e)
void reportResultsReady (int beginIndex, int endIndex)
void setRunnable (QRunnable *runnable)
void setThreadPool (QThreadPool *pool)
QThreadPool * threadPool () const
void setFilterMode (bool enable)
void setProgressRange (int minimum, int maximum)
int progressMinimum () const
int progressMaximum () const
bool isProgressUpdateNeeded () const
void setProgressValue (int progressValue)
int progressValue () const
void setProgressValueAndText (int progressValue, const QString &progressText)
QString progressText () const
void setExpectedResultCount (int resultCount)
int expectedResultCount ()
int resultCount () const
bool queryState (State state) const
bool isRunning () const
bool isStarted () const
bool isCanceled () const
bool isFinished () const
bool isSuspending () const
bool isSuspended () const
bool isThrottled () const
bool isResultReadyAt (int index) const
bool isValid () const
int loadState () const
void cancel ()
void cancelAndFinish ()
void cancelChain ()
void setAddResultsIfCanceledEnabled (bool enable)
bool isAddResultsIfCanceledEnabled () const
void setSuspended (bool suspend)
void toggleSuspended ()
void reportSuspended () const
void setThrottled (bool enable)
void waitForFinished ()
bool waitForNextResult ()
void waitForResult (int resultIndex)
void waitForResume ()
void suspendIfRequested ()
QMutex & mutex () const
bool hasException () const
QtPrivate::ExceptionStore & exceptionStore ()
QtPrivate::ResultStoreBase & resultStoreBase ()
const QtPrivate::ResultStoreBase & resultStoreBase () const
bool operator== (const QFutureInterfaceBase &other) const
bool operator!= (const QFutureInterfaceBase &other) const
void swap (QFutureInterfaceBase &other) noexcept
bool isChainCanceled () const

Static Public Member Functions

template<typename T>
static QFutureInterfaceBase get (const QFuture< T > &future)

Protected Types

enum class  ContinuationType : quint8 { Unknown , Then , OnFailed , OnCanceled }
enum class  CancelMode { CancelOnly , CancelAndFinish }

Protected Member Functions

bool refT () const noexcept
bool derefT () const noexcept
void reset ()
void rethrowPossibleException ()
void setContinuation (std::function< void(const QFutureInterfaceBase &)> func, void *continuationFutureData, ContinuationType type)
void setContinuation (const QObject *context, std::function< void()> func, const QVariant &continuationFuture, ContinuationType type)
void cleanContinuation ()
void runContinuation () const
void setLaunchAsync (bool value)
bool launchAsync () const
bool isRunningOrPending () const
void cancel (CancelMode mode)
void cancelChain (CancelMode mode)

Friends

class QFutureInterfaceBasePrivate
class QFutureWatcherBase
class QFutureWatcherBasePrivate
template<typename Function, typename ResultType, typename ParentResultType>
class QtPrivate::CompactContinuation
template<class Function, class ResultType>
class QtPrivate::CanceledHandler
template<class Function, class ResultType>
class QtPrivate::FailureHandler
struct QtPrivate::UnwrapHandler
template<class T>
class QPromise

Detailed Description

Definition at line 54 of file qfutureinterface.h.

Member Enumeration Documentation

◆ CancelMode

enum class QFutureInterfaceBase::CancelMode
strongprotected
Enumerator
CancelOnly 
CancelAndFinish 

Definition at line 230 of file qfutureinterface.h.

◆ ContinuationType

enum class QFutureInterfaceBase::ContinuationType : quint8
strongprotected
Enumerator
Unknown 
Then 
OnFailed 
OnCanceled 

Definition at line 205 of file qfutureinterface.h.

◆ State

Enumerator
NoState 
Running 
Started 
Finished 
Canceled 
Suspending 
Suspended 
Throttled 
Pending 

Definition at line 57 of file qfutureinterface.h.

Constructor & Destructor Documentation

◆ QFutureInterfaceBase() [1/3]

QFutureInterfaceBase::QFutureInterfaceBase ( State initialState = NoState)

Definition at line 82 of file qfutureinterface.cpp.

◆ QFutureInterfaceBase() [2/3]

QFutureInterfaceBase::QFutureInterfaceBase ( const QFutureInterfaceBase & other)

Definition at line 86 of file qfutureinterface.cpp.

◆ QFutureInterfaceBase() [3/3]

QFutureInterfaceBase::QFutureInterfaceBase ( QFutureInterfaceBase && other)
inlinenoexcept

Definition at line 72 of file qfutureinterface.h.

◆ ~QFutureInterfaceBase()

QFutureInterfaceBase::~QFutureInterfaceBase ( )
virtual

Definition at line 92 of file qfutureinterface.cpp.

Member Function Documentation

◆ cancel() [1/2]

void QFutureInterfaceBase::cancel ( )

Definition at line 168 of file qfutureinterface.cpp.

◆ cancel() [2/2]

void QFutureInterfaceBase::cancel ( QFutureInterfaceBase::CancelMode mode)
protected

Definition at line 188 of file qfutureinterface.cpp.

◆ cancelAndFinish()

void QFutureInterfaceBase::cancelAndFinish ( )
inline

Definition at line 132 of file qfutureinterface.h.

◆ cancelChain() [1/2]

void QFutureInterfaceBase::cancelChain ( )

Definition at line 173 of file qfutureinterface.cpp.

◆ cancelChain() [2/2]

void QFutureInterfaceBase::cancelChain ( QFutureInterfaceBase::CancelMode mode)
protected

Definition at line 193 of file qfutureinterface.cpp.

◆ cleanContinuation()

void QFutureInterfaceBase::cleanContinuation ( )
protected

Definition at line 1028 of file qfutureinterface.cpp.

◆ derefT()

bool QFutureInterfaceBase::derefT ( ) const
protectednoexcept

Definition at line 695 of file qfutureinterface.cpp.

◆ exceptionStore()

QtPrivate::ExceptionStore & QFutureInterfaceBase::exceptionStore ( )

Definition at line 659 of file qfutureinterface.cpp.

◆ expectedResultCount()

int QFutureInterfaceBase::expectedResultCount ( )

Definition at line 476 of file qfutureinterface.cpp.

◆ get()

template<typename T>
QFutureInterfaceBase QFutureInterfaceBase::get ( const QFuture< T > & future)
static

Definition at line 430 of file qfuture.h.

◆ hasException()

bool QFutureInterfaceBase::hasException ( ) const

Definition at line 654 of file qfutureinterface.cpp.

◆ isAddResultsIfCanceledEnabled()

bool QFutureInterfaceBase::isAddResultsIfCanceledEnabled ( ) const

Definition at line 183 of file qfutureinterface.cpp.

◆ isCanceled()

bool QFutureInterfaceBase::isCanceled ( ) const

Definition at line 273 of file qfutureinterface.cpp.

◆ isChainCanceled()

bool QFutureInterfaceBase::isChainCanceled ( ) const

Definition at line 1080 of file qfutureinterface.cpp.

◆ isFinished()

bool QFutureInterfaceBase::isFinished ( ) const

Definition at line 278 of file qfutureinterface.cpp.

◆ isProgressUpdateNeeded()

bool QFutureInterfaceBase::isProgressUpdateNeeded ( ) const

Definition at line 409 of file qfutureinterface.cpp.

◆ isResultReadyAt()

bool QFutureInterfaceBase::isResultReadyAt ( int index) const

Definition at line 305 of file qfutureinterface.cpp.

◆ isRunning()

bool QFutureInterfaceBase::isRunning ( ) const

Definition at line 263 of file qfutureinterface.cpp.

◆ isRunningOrPending()

bool QFutureInterfaceBase::isRunningOrPending ( ) const
protected

Definition at line 317 of file qfutureinterface.cpp.

◆ isStarted()

bool QFutureInterfaceBase::isStarted ( ) const

Definition at line 268 of file qfutureinterface.cpp.

◆ isSuspended()

bool QFutureInterfaceBase::isSuspended ( ) const

Definition at line 295 of file qfutureinterface.cpp.

◆ isSuspending()

bool QFutureInterfaceBase::isSuspending ( ) const

Definition at line 283 of file qfutureinterface.cpp.

◆ isThrottled()

bool QFutureInterfaceBase::isThrottled ( ) const

Definition at line 300 of file qfutureinterface.cpp.

◆ isValid()

bool QFutureInterfaceBase::isValid ( ) const

Definition at line 311 of file qfutureinterface.cpp.

◆ launchAsync()

bool QFutureInterfaceBase::launchAsync ( ) const
protected

Definition at line 1090 of file qfutureinterface.cpp.

◆ loadState()

int QFutureInterfaceBase::loadState ( ) const

Definition at line 486 of file qfutureinterface.cpp.

◆ mutex()

QMutex & QFutureInterfaceBase::mutex ( ) const

Definition at line 649 of file qfutureinterface.cpp.

◆ operator!=()

bool QFutureInterfaceBase::operator!= ( const QFutureInterfaceBase & other) const
inline

Definition at line 155 of file qfutureinterface.h.

◆ operator=()

QFutureInterfaceBase & QFutureInterfaceBase::operator= ( const QFutureInterfaceBase & other)

Definition at line 677 of file qfutureinterface.cpp.

◆ operator==()

bool QFutureInterfaceBase::operator== ( const QFutureInterfaceBase & other) const
inline

Definition at line 154 of file qfutureinterface.h.

◆ progressMaximum()

int QFutureInterfaceBase::progressMaximum ( ) const

Definition at line 391 of file qfutureinterface.cpp.

◆ progressMinimum()

int QFutureInterfaceBase::progressMinimum ( ) const

Definition at line 385 of file qfutureinterface.cpp.

◆ progressText()

QString QFutureInterfaceBase::progressText ( ) const

Definition at line 403 of file qfutureinterface.cpp.

◆ progressValue()

int QFutureInterfaceBase::progressValue ( ) const

Definition at line 379 of file qfutureinterface.cpp.

◆ queryState()

bool QFutureInterfaceBase::queryState ( State state) const

Definition at line 481 of file qfutureinterface.cpp.

◆ refT()

bool QFutureInterfaceBase::refT ( ) const
protectednoexcept

Definition at line 690 of file qfutureinterface.cpp.

◆ reportCanceled()

void QFutureInterfaceBase::reportCanceled ( )

Definition at line 425 of file qfutureinterface.cpp.

◆ reportException() [1/2]

void QFutureInterfaceBase::reportException ( const QException & e)

Definition at line 431 of file qfutureinterface.cpp.

◆ reportException() [2/2]

void QFutureInterfaceBase::reportException ( const std::exception_ptr & e)

Definition at line 443 of file qfutureinterface.cpp.

◆ reportFinished()

void QFutureInterfaceBase::reportFinished ( )

Definition at line 459 of file qfutureinterface.cpp.

◆ reportResultsReady()

void QFutureInterfaceBase::reportResultsReady ( int beginIndex,
int endIndex )

Definition at line 537 of file qfutureinterface.cpp.

◆ reportStarted()

void QFutureInterfaceBase::reportStarted ( )

Definition at line 415 of file qfutureinterface.cpp.

◆ reportSuspended()

void QFutureInterfaceBase::reportSuspended ( ) const

Definition at line 236 of file qfutureinterface.cpp.

◆ reset()

void QFutureInterfaceBase::reset ( )
protected

Definition at line 701 of file qfutureinterface.cpp.

◆ resultCount()

int QFutureInterfaceBase::resultCount ( ) const

Definition at line 397 of file qfutureinterface.cpp.

◆ resultStoreBase() [1/2]

QtPrivate::ResultStoreBase & QFutureInterfaceBase::resultStoreBase ( )

Definition at line 665 of file qfutureinterface.cpp.

◆ resultStoreBase() [2/2]

const QtPrivate::ResultStoreBase & QFutureInterfaceBase::resultStoreBase ( ) const

Definition at line 671 of file qfutureinterface.cpp.

◆ rethrowPossibleException()

void QFutureInterfaceBase::rethrowPossibleException ( )
protected

Definition at line 709 of file qfutureinterface.cpp.

◆ runContinuation()

void QFutureInterfaceBase::runContinuation ( ) const
protected

Definition at line 1039 of file qfutureinterface.cpp.

◆ setAddResultsIfCanceledEnabled()

void QFutureInterfaceBase::setAddResultsIfCanceledEnabled ( bool enable)

Definition at line 178 of file qfutureinterface.cpp.

◆ setContinuation() [1/2]

void QFutureInterfaceBase::setContinuation ( const QObject * context,
std::function< void()> func,
const QVariant & continuationFuture,
ContinuationType type )
protected

Definition at line 959 of file qfutureinterface.cpp.

◆ setContinuation() [2/2]

void QFutureInterfaceBase::setContinuation ( std::function< void(const QFutureInterfaceBase &)> func,
void * continuationFutureData,
ContinuationType type )
protected

Definition at line 898 of file qfutureinterface.cpp.

◆ setExpectedResultCount()

void QFutureInterfaceBase::setExpectedResultCount ( int resultCount)

Definition at line 469 of file qfutureinterface.cpp.

◆ setFilterMode()

void QFutureInterfaceBase::setFilterMode ( bool enable)

Definition at line 578 of file qfutureinterface.cpp.

◆ setLaunchAsync()

void QFutureInterfaceBase::setLaunchAsync ( bool value)
protected

Definition at line 1085 of file qfutureinterface.cpp.

◆ setProgressRange()

void QFutureInterfaceBase::setProgressRange ( int minimum,
int maximum )

Sets the progress range's minimum and maximum values to minimum and maximum respectively.

If maximum is smaller than minimum, minimum becomes the only legal value.

The progress value is reset to be minimum.

The progress range usage can be disabled by using setProgressRange(0, 0). In this case progress value is also reset to 0.

The behavior of this method is mostly inspired by \l QProgressBar::setRange.

Definition at line 601 of file qfutureinterface.cpp.

◆ setProgressValue()

void QFutureInterfaceBase::setProgressValue ( int progressValue)

Definition at line 612 of file qfutureinterface.cpp.

◆ setProgressValueAndText()

void QFutureInterfaceBase::setProgressValueAndText ( int progressValue,
const QString & progressText )

In case of the progressValue falling out of the progress range, this method has no effect. Such behavior is inspired by \l QProgressBar::setValue.

Definition at line 623 of file qfutureinterface.cpp.

◆ setRunnable()

void QFutureInterfaceBase::setRunnable ( QRunnable * runnable)

Definition at line 563 of file qfutureinterface.cpp.

◆ setSuspended()

void QFutureInterfaceBase::setSuspended ( bool suspend)

Definition at line 210 of file qfutureinterface.cpp.

◆ setThreadPool()

void QFutureInterfaceBase::setThreadPool ( QThreadPool * pool)

Definition at line 568 of file qfutureinterface.cpp.

◆ setThrottled()

void QFutureInterfaceBase::setThrottled ( bool enable)

Definition at line 250 of file qfutureinterface.cpp.

◆ suspendIfRequested()

void QFutureInterfaceBase::suspendIfRequested ( )

Definition at line 348 of file qfutureinterface.cpp.

◆ swap()

void QFutureInterfaceBase::swap ( QFutureInterfaceBase & other)
noexcept

Definition at line 685 of file qfutureinterface.cpp.

◆ threadPool()

QThreadPool * QFutureInterfaceBase::threadPool ( ) const

Definition at line 573 of file qfutureinterface.cpp.

◆ toggleSuspended()

void QFutureInterfaceBase::toggleSuspended ( )

Definition at line 223 of file qfutureinterface.cpp.

◆ waitForFinished()

void QFutureInterfaceBase::waitForFinished ( )

Definition at line 518 of file qfutureinterface.cpp.

◆ waitForNextResult()

bool QFutureInterfaceBase::waitForNextResult ( )

Definition at line 322 of file qfutureinterface.cpp.

◆ waitForResult()

void QFutureInterfaceBase::waitForResult ( int resultIndex)

Definition at line 494 of file qfutureinterface.cpp.

◆ waitForResume()

void QFutureInterfaceBase::waitForResume ( )

Definition at line 328 of file qfutureinterface.cpp.

◆ QFutureInterfaceBasePrivate

friend class QFutureInterfaceBasePrivate
friend

Definition at line 176 of file qfutureinterface.h.

◆ QFutureWatcherBase

friend class QFutureWatcherBase
friend

Definition at line 180 of file qfutureinterface.h.

◆ QFutureWatcherBasePrivate

friend class QFutureWatcherBasePrivate
friend

Definition at line 181 of file qfutureinterface.h.

◆ QPromise

template<class T>
friend class QPromise
friend

Definition at line 202 of file qfutureinterface.h.

◆ QtPrivate::CanceledHandler

template<class Function, class ResultType>
friend class QtPrivate::CanceledHandler
friend

Definition at line 187 of file qfutureinterface.h.

◆ QtPrivate::CompactContinuation

template<typename Function, typename ResultType, typename ParentResultType>
friend class QtPrivate::CompactContinuation
friend

Definition at line 184 of file qfutureinterface.h.

◆ QtPrivate::FailureHandler

template<class Function, class ResultType>
friend class QtPrivate::FailureHandler
friend

Definition at line 191 of file qfutureinterface.h.

◆ QtPrivate::UnwrapHandler

friend struct QtPrivate::UnwrapHandler
friend

Definition at line 194 of file qfutureinterface.h.


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