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
 
QFutureInterfaceBaseoperator= (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)
 
QThreadPoolthreadPool () 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 setSuspended (bool suspend)
 
void toggleSuspended ()
 
void reportSuspended () const
 
void setThrottled (bool enable)
 
void waitForFinished ()
 
bool waitForNextResult ()
 
void waitForResult (int resultIndex)
 
void waitForResume ()
 
void suspendIfRequested ()
 
QMutexmutex () const
 
bool hasException () const
 
QtPrivate::ExceptionStoreexceptionStore ()
 
QtPrivate::ResultStoreBaseresultStoreBase ()
 
const QtPrivate::ResultStoreBaseresultStoreBase () 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
 
template<class T>
class QPromise
 

Detailed Description

Definition at line 51 of file qfutureinterface.h.

Member Enumeration Documentation

◆ CancelMode

enum class QFutureInterfaceBase::CancelMode
strongprotected
Enumerator
CancelOnly 
CancelAndFinish 

Definition at line 223 of file qfutureinterface.h.

◆ ContinuationType

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

Definition at line 198 of file qfutureinterface.h.

◆ State

Enumerator
NoState 
Running 
Started 
Finished 
Canceled 
Suspending 
Suspended 
Throttled 
Pending 

Definition at line 54 of file qfutureinterface.h.

Constructor & Destructor Documentation

◆ QFutureInterfaceBase() [1/3]

QFutureInterfaceBase::QFutureInterfaceBase ( State initialState = NoState)

Definition at line 63 of file qfutureinterface.cpp.

◆ QFutureInterfaceBase() [2/3]

QFutureInterfaceBase::QFutureInterfaceBase ( const QFutureInterfaceBase & other)

Definition at line 67 of file qfutureinterface.cpp.

◆ QFutureInterfaceBase() [3/3]

QFutureInterfaceBase::QFutureInterfaceBase ( QFutureInterfaceBase && other)
inlinenoexcept

Definition at line 69 of file qfutureinterface.h.

◆ ~QFutureInterfaceBase()

QFutureInterfaceBase::~QFutureInterfaceBase ( )
virtual

Definition at line 73 of file qfutureinterface.cpp.

Member Function Documentation

◆ cancel() [1/2]

void QFutureInterfaceBase::cancel ( )

Definition at line 149 of file qfutureinterface.cpp.

◆ cancel() [2/2]

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

Definition at line 159 of file qfutureinterface.cpp.

◆ cancelAndFinish()

void QFutureInterfaceBase::cancelAndFinish ( )
inline

Definition at line 129 of file qfutureinterface.h.

◆ cancelChain() [1/2]

void QFutureInterfaceBase::cancelChain ( )

Definition at line 154 of file qfutureinterface.cpp.

◆ cancelChain() [2/2]

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

Definition at line 164 of file qfutureinterface.cpp.

◆ cleanContinuation()

void QFutureInterfaceBase::cleanContinuation ( )
protected

Definition at line 983 of file qfutureinterface.cpp.

◆ derefT()

bool QFutureInterfaceBase::derefT ( ) const
protectednoexcept

Definition at line 666 of file qfutureinterface.cpp.

◆ exceptionStore()

QtPrivate::ExceptionStore & QFutureInterfaceBase::exceptionStore ( )

Definition at line 630 of file qfutureinterface.cpp.

◆ expectedResultCount()

int QFutureInterfaceBase::expectedResultCount ( )

Definition at line 447 of file qfutureinterface.cpp.

◆ get()

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

Definition at line 429 of file qfuture.h.

◆ hasException()

bool QFutureInterfaceBase::hasException ( ) const

Definition at line 625 of file qfutureinterface.cpp.

◆ isCanceled()

bool QFutureInterfaceBase::isCanceled ( ) const

Definition at line 244 of file qfutureinterface.cpp.

◆ isChainCanceled()

bool QFutureInterfaceBase::isChainCanceled ( ) const

Definition at line 1019 of file qfutureinterface.cpp.

◆ isFinished()

bool QFutureInterfaceBase::isFinished ( ) const

Definition at line 249 of file qfutureinterface.cpp.

◆ isProgressUpdateNeeded()

bool QFutureInterfaceBase::isProgressUpdateNeeded ( ) const

Definition at line 380 of file qfutureinterface.cpp.

◆ isResultReadyAt()

bool QFutureInterfaceBase::isResultReadyAt ( int index) const

Definition at line 276 of file qfutureinterface.cpp.

◆ isRunning()

bool QFutureInterfaceBase::isRunning ( ) const

Definition at line 234 of file qfutureinterface.cpp.

◆ isRunningOrPending()

bool QFutureInterfaceBase::isRunningOrPending ( ) const
protected

Definition at line 288 of file qfutureinterface.cpp.

◆ isStarted()

bool QFutureInterfaceBase::isStarted ( ) const

Definition at line 239 of file qfutureinterface.cpp.

◆ isSuspended()

bool QFutureInterfaceBase::isSuspended ( ) const

Definition at line 266 of file qfutureinterface.cpp.

◆ isSuspending()

bool QFutureInterfaceBase::isSuspending ( ) const

Definition at line 254 of file qfutureinterface.cpp.

◆ isThrottled()

bool QFutureInterfaceBase::isThrottled ( ) const

Definition at line 271 of file qfutureinterface.cpp.

◆ isValid()

bool QFutureInterfaceBase::isValid ( ) const

Definition at line 282 of file qfutureinterface.cpp.

◆ launchAsync()

bool QFutureInterfaceBase::launchAsync ( ) const
protected

Definition at line 1029 of file qfutureinterface.cpp.

◆ loadState()

int QFutureInterfaceBase::loadState ( ) const

Definition at line 457 of file qfutureinterface.cpp.

◆ mutex()

QMutex & QFutureInterfaceBase::mutex ( ) const

Definition at line 620 of file qfutureinterface.cpp.

◆ operator!=()

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

Definition at line 150 of file qfutureinterface.h.

◆ operator=()

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

Definition at line 648 of file qfutureinterface.cpp.

◆ operator==()

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

Definition at line 149 of file qfutureinterface.h.

◆ progressMaximum()

int QFutureInterfaceBase::progressMaximum ( ) const

Definition at line 362 of file qfutureinterface.cpp.

◆ progressMinimum()

int QFutureInterfaceBase::progressMinimum ( ) const

Definition at line 356 of file qfutureinterface.cpp.

◆ progressText()

QString QFutureInterfaceBase::progressText ( ) const

Definition at line 374 of file qfutureinterface.cpp.

◆ progressValue()

int QFutureInterfaceBase::progressValue ( ) const

Definition at line 350 of file qfutureinterface.cpp.

◆ queryState()

bool QFutureInterfaceBase::queryState ( State state) const

Definition at line 452 of file qfutureinterface.cpp.

◆ refT()

bool QFutureInterfaceBase::refT ( ) const
protectednoexcept

Definition at line 661 of file qfutureinterface.cpp.

◆ reportCanceled()

void QFutureInterfaceBase::reportCanceled ( )

Definition at line 396 of file qfutureinterface.cpp.

◆ reportException() [1/2]

void QFutureInterfaceBase::reportException ( const QException & e)

Definition at line 402 of file qfutureinterface.cpp.

◆ reportException() [2/2]

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

Definition at line 414 of file qfutureinterface.cpp.

◆ reportFinished()

void QFutureInterfaceBase::reportFinished ( )

Definition at line 430 of file qfutureinterface.cpp.

◆ reportResultsReady()

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

Definition at line 508 of file qfutureinterface.cpp.

◆ reportStarted()

void QFutureInterfaceBase::reportStarted ( )

Definition at line 386 of file qfutureinterface.cpp.

◆ reportSuspended()

void QFutureInterfaceBase::reportSuspended ( ) const

Definition at line 207 of file qfutureinterface.cpp.

◆ reset()

void QFutureInterfaceBase::reset ( )
protected

Definition at line 672 of file qfutureinterface.cpp.

◆ resultCount()

int QFutureInterfaceBase::resultCount ( ) const

Definition at line 368 of file qfutureinterface.cpp.

◆ resultStoreBase() [1/2]

QtPrivate::ResultStoreBase & QFutureInterfaceBase::resultStoreBase ( )

Definition at line 636 of file qfutureinterface.cpp.

◆ resultStoreBase() [2/2]

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

Definition at line 642 of file qfutureinterface.cpp.

◆ rethrowPossibleException()

void QFutureInterfaceBase::rethrowPossibleException ( )
protected

Definition at line 680 of file qfutureinterface.cpp.

◆ runContinuation()

void QFutureInterfaceBase::runContinuation ( ) const
protected

Definition at line 994 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 914 of file qfutureinterface.cpp.

◆ setContinuation() [2/2]

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

Definition at line 869 of file qfutureinterface.cpp.

◆ setExpectedResultCount()

void QFutureInterfaceBase::setExpectedResultCount ( int resultCount)

Definition at line 440 of file qfutureinterface.cpp.

◆ setFilterMode()

void QFutureInterfaceBase::setFilterMode ( bool enable)

Definition at line 549 of file qfutureinterface.cpp.

◆ setLaunchAsync()

void QFutureInterfaceBase::setLaunchAsync ( bool value)
protected

Definition at line 1024 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 572 of file qfutureinterface.cpp.

◆ setProgressValue()

void QFutureInterfaceBase::setProgressValue ( int progressValue)

Definition at line 583 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 594 of file qfutureinterface.cpp.

◆ setRunnable()

void QFutureInterfaceBase::setRunnable ( QRunnable * runnable)

Definition at line 534 of file qfutureinterface.cpp.

◆ setSuspended()

void QFutureInterfaceBase::setSuspended ( bool suspend)

Definition at line 181 of file qfutureinterface.cpp.

◆ setThreadPool()

void QFutureInterfaceBase::setThreadPool ( QThreadPool * pool)

Definition at line 539 of file qfutureinterface.cpp.

◆ setThrottled()

void QFutureInterfaceBase::setThrottled ( bool enable)

Definition at line 221 of file qfutureinterface.cpp.

◆ suspendIfRequested()

void QFutureInterfaceBase::suspendIfRequested ( )

Definition at line 319 of file qfutureinterface.cpp.

◆ swap()

void QFutureInterfaceBase::swap ( QFutureInterfaceBase & other)
noexcept

Definition at line 656 of file qfutureinterface.cpp.

◆ threadPool()

QThreadPool * QFutureInterfaceBase::threadPool ( ) const

Definition at line 544 of file qfutureinterface.cpp.

◆ toggleSuspended()

void QFutureInterfaceBase::toggleSuspended ( )

Definition at line 194 of file qfutureinterface.cpp.

◆ waitForFinished()

void QFutureInterfaceBase::waitForFinished ( )

Definition at line 489 of file qfutureinterface.cpp.

◆ waitForNextResult()

bool QFutureInterfaceBase::waitForNextResult ( )

Definition at line 293 of file qfutureinterface.cpp.

◆ waitForResult()

void QFutureInterfaceBase::waitForResult ( int resultIndex)

Definition at line 465 of file qfutureinterface.cpp.

◆ waitForResume()

void QFutureInterfaceBase::waitForResume ( )

Definition at line 299 of file qfutureinterface.cpp.

Friends And Related Symbol Documentation

◆ QFutureInterfaceBasePrivate

friend class QFutureInterfaceBasePrivate
friend

Definition at line 171 of file qfutureinterface.h.

◆ QFutureWatcherBase

friend class QFutureWatcherBase
friend

Definition at line 175 of file qfutureinterface.h.

◆ QFutureWatcherBasePrivate

friend class QFutureWatcherBasePrivate
friend

Definition at line 176 of file qfutureinterface.h.

◆ QPromise

template<class T>
friend class QPromise
friend

Definition at line 195 of file qfutureinterface.h.

◆ QtPrivate::CanceledHandler

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

Definition at line 182 of file qfutureinterface.h.

◆ QtPrivate::CompactContinuation

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

Definition at line 179 of file qfutureinterface.h.

◆ QtPrivate::FailureHandler

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

Definition at line 186 of file qfutureinterface.h.


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