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 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 ()
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
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 81 of file qfutureinterface.cpp.

◆ QFutureInterfaceBase() [2/3]

QFutureInterfaceBase::QFutureInterfaceBase ( const QFutureInterfaceBase & other)

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

Member Function Documentation

◆ cancel() [1/2]

void QFutureInterfaceBase::cancel ( )

Definition at line 167 of file qfutureinterface.cpp.

◆ cancel() [2/2]

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

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

◆ cancelChain() [2/2]

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

Definition at line 192 of file qfutureinterface.cpp.

◆ cleanContinuation()

void QFutureInterfaceBase::cleanContinuation ( )
protected

Definition at line 1027 of file qfutureinterface.cpp.

◆ derefT()

bool QFutureInterfaceBase::derefT ( ) const
protectednoexcept

Definition at line 694 of file qfutureinterface.cpp.

◆ exceptionStore()

QtPrivate::ExceptionStore & QFutureInterfaceBase::exceptionStore ( )

Definition at line 658 of file qfutureinterface.cpp.

◆ expectedResultCount()

int QFutureInterfaceBase::expectedResultCount ( )

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

◆ isAddResultsIfCanceledEnabled()

bool QFutureInterfaceBase::isAddResultsIfCanceledEnabled ( ) const

Definition at line 182 of file qfutureinterface.cpp.

◆ isCanceled()

bool QFutureInterfaceBase::isCanceled ( ) const

Definition at line 272 of file qfutureinterface.cpp.

◆ isChainCanceled()

bool QFutureInterfaceBase::isChainCanceled ( ) const

Definition at line 1063 of file qfutureinterface.cpp.

◆ isFinished()

bool QFutureInterfaceBase::isFinished ( ) const

Definition at line 277 of file qfutureinterface.cpp.

◆ isProgressUpdateNeeded()

bool QFutureInterfaceBase::isProgressUpdateNeeded ( ) const

Definition at line 408 of file qfutureinterface.cpp.

◆ isResultReadyAt()

bool QFutureInterfaceBase::isResultReadyAt ( int index) const

Definition at line 304 of file qfutureinterface.cpp.

◆ isRunning()

bool QFutureInterfaceBase::isRunning ( ) const

Definition at line 262 of file qfutureinterface.cpp.

◆ isRunningOrPending()

bool QFutureInterfaceBase::isRunningOrPending ( ) const
protected

Definition at line 316 of file qfutureinterface.cpp.

◆ isStarted()

bool QFutureInterfaceBase::isStarted ( ) const

Definition at line 267 of file qfutureinterface.cpp.

◆ isSuspended()

bool QFutureInterfaceBase::isSuspended ( ) const

Definition at line 294 of file qfutureinterface.cpp.

◆ isSuspending()

bool QFutureInterfaceBase::isSuspending ( ) const

Definition at line 282 of file qfutureinterface.cpp.

◆ isThrottled()

bool QFutureInterfaceBase::isThrottled ( ) const

Definition at line 299 of file qfutureinterface.cpp.

◆ isValid()

bool QFutureInterfaceBase::isValid ( ) const

Definition at line 310 of file qfutureinterface.cpp.

◆ launchAsync()

bool QFutureInterfaceBase::launchAsync ( ) const
protected

Definition at line 1073 of file qfutureinterface.cpp.

◆ loadState()

int QFutureInterfaceBase::loadState ( ) const

Definition at line 485 of file qfutureinterface.cpp.

◆ mutex()

QMutex & QFutureInterfaceBase::mutex ( ) const

Definition at line 648 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 676 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 390 of file qfutureinterface.cpp.

◆ progressMinimum()

int QFutureInterfaceBase::progressMinimum ( ) const

Definition at line 384 of file qfutureinterface.cpp.

◆ progressText()

QString QFutureInterfaceBase::progressText ( ) const

Definition at line 402 of file qfutureinterface.cpp.

◆ progressValue()

int QFutureInterfaceBase::progressValue ( ) const

Definition at line 378 of file qfutureinterface.cpp.

◆ queryState()

bool QFutureInterfaceBase::queryState ( State state) const

Definition at line 480 of file qfutureinterface.cpp.

◆ refT()

bool QFutureInterfaceBase::refT ( ) const
protectednoexcept

Definition at line 689 of file qfutureinterface.cpp.

◆ reportCanceled()

void QFutureInterfaceBase::reportCanceled ( )

Definition at line 424 of file qfutureinterface.cpp.

◆ reportException() [1/2]

void QFutureInterfaceBase::reportException ( const QException & e)

Definition at line 430 of file qfutureinterface.cpp.

◆ reportException() [2/2]

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

Definition at line 442 of file qfutureinterface.cpp.

◆ reportFinished()

void QFutureInterfaceBase::reportFinished ( )

Definition at line 458 of file qfutureinterface.cpp.

◆ reportResultsReady()

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

Definition at line 536 of file qfutureinterface.cpp.

◆ reportStarted()

void QFutureInterfaceBase::reportStarted ( )

Definition at line 414 of file qfutureinterface.cpp.

◆ reportSuspended()

void QFutureInterfaceBase::reportSuspended ( ) const

Definition at line 235 of file qfutureinterface.cpp.

◆ reset()

void QFutureInterfaceBase::reset ( )
protected

Definition at line 700 of file qfutureinterface.cpp.

◆ resultCount()

int QFutureInterfaceBase::resultCount ( ) const

Definition at line 396 of file qfutureinterface.cpp.

◆ resultStoreBase() [1/2]

QtPrivate::ResultStoreBase & QFutureInterfaceBase::resultStoreBase ( )

Definition at line 664 of file qfutureinterface.cpp.

◆ resultStoreBase() [2/2]

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

Definition at line 670 of file qfutureinterface.cpp.

◆ rethrowPossibleException()

void QFutureInterfaceBase::rethrowPossibleException ( )
protected

Definition at line 708 of file qfutureinterface.cpp.

◆ runContinuation()

void QFutureInterfaceBase::runContinuation ( ) const
protected

Definition at line 1038 of file qfutureinterface.cpp.

◆ setAddResultsIfCanceledEnabled()

void QFutureInterfaceBase::setAddResultsIfCanceledEnabled ( bool enable)

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

◆ setContinuation() [2/2]

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

Definition at line 897 of file qfutureinterface.cpp.

◆ setExpectedResultCount()

void QFutureInterfaceBase::setExpectedResultCount ( int resultCount)

Definition at line 468 of file qfutureinterface.cpp.

◆ setFilterMode()

void QFutureInterfaceBase::setFilterMode ( bool enable)

Definition at line 577 of file qfutureinterface.cpp.

◆ setLaunchAsync()

void QFutureInterfaceBase::setLaunchAsync ( bool value)
protected

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

◆ setProgressValue()

void QFutureInterfaceBase::setProgressValue ( int progressValue)

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

◆ setRunnable()

void QFutureInterfaceBase::setRunnable ( QRunnable * runnable)

Definition at line 562 of file qfutureinterface.cpp.

◆ setSuspended()

void QFutureInterfaceBase::setSuspended ( bool suspend)

Definition at line 209 of file qfutureinterface.cpp.

◆ setThreadPool()

void QFutureInterfaceBase::setThreadPool ( QThreadPool * pool)

Definition at line 567 of file qfutureinterface.cpp.

◆ setThrottled()

void QFutureInterfaceBase::setThrottled ( bool enable)

Definition at line 249 of file qfutureinterface.cpp.

◆ suspendIfRequested()

void QFutureInterfaceBase::suspendIfRequested ( )

Definition at line 347 of file qfutureinterface.cpp.

◆ swap()

void QFutureInterfaceBase::swap ( QFutureInterfaceBase & other)
noexcept

Definition at line 684 of file qfutureinterface.cpp.

◆ threadPool()

QThreadPool * QFutureInterfaceBase::threadPool ( ) const

Definition at line 572 of file qfutureinterface.cpp.

◆ toggleSuspended()

void QFutureInterfaceBase::toggleSuspended ( )

Definition at line 222 of file qfutureinterface.cpp.

◆ waitForFinished()

void QFutureInterfaceBase::waitForFinished ( )

Definition at line 517 of file qfutureinterface.cpp.

◆ waitForNextResult()

bool QFutureInterfaceBase::waitForNextResult ( )

Definition at line 321 of file qfutureinterface.cpp.

◆ waitForResult()

void QFutureInterfaceBase::waitForResult ( int resultIndex)

Definition at line 493 of file qfutureinterface.cpp.

◆ waitForResume()

void QFutureInterfaceBase::waitForResume ( )

Definition at line 327 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: