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 52 of file qfutureinterface.h.

Member Enumeration Documentation

◆ CancelMode

enum class QFutureInterfaceBase::CancelMode
strongprotected
Enumerator
CancelOnly 
CancelAndFinish 

Definition at line 224 of file qfutureinterface.h.

◆ ContinuationType

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

Definition at line 199 of file qfutureinterface.h.

◆ State

Enumerator
NoState 
Running 
Started 
Finished 
Canceled 
Suspending 
Suspended 
Throttled 
Pending 

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

◆ cancelAndFinish()

void QFutureInterfaceBase::cancelAndFinish ( )
inline

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

◆ cleanContinuation()

void QFutureInterfaceBase::cleanContinuation ( )
protected

Definition at line 1001 of file qfutureinterface.cpp.

◆ derefT()

bool QFutureInterfaceBase::derefT ( ) const
protectednoexcept

Definition at line 684 of file qfutureinterface.cpp.

◆ exceptionStore()

QtPrivate::ExceptionStore & QFutureInterfaceBase::exceptionStore ( )

Definition at line 648 of file qfutureinterface.cpp.

◆ expectedResultCount()

int QFutureInterfaceBase::expectedResultCount ( )

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

◆ isCanceled()

bool QFutureInterfaceBase::isCanceled ( ) const

Definition at line 262 of file qfutureinterface.cpp.

◆ isChainCanceled()

bool QFutureInterfaceBase::isChainCanceled ( ) const

Definition at line 1037 of file qfutureinterface.cpp.

◆ isFinished()

bool QFutureInterfaceBase::isFinished ( ) const

Definition at line 267 of file qfutureinterface.cpp.

◆ isProgressUpdateNeeded()

bool QFutureInterfaceBase::isProgressUpdateNeeded ( ) const

Definition at line 398 of file qfutureinterface.cpp.

◆ isResultReadyAt()

bool QFutureInterfaceBase::isResultReadyAt ( int index) const

Definition at line 294 of file qfutureinterface.cpp.

◆ isRunning()

bool QFutureInterfaceBase::isRunning ( ) const

Definition at line 252 of file qfutureinterface.cpp.

◆ isRunningOrPending()

bool QFutureInterfaceBase::isRunningOrPending ( ) const
protected

Definition at line 306 of file qfutureinterface.cpp.

◆ isStarted()

bool QFutureInterfaceBase::isStarted ( ) const

Definition at line 257 of file qfutureinterface.cpp.

◆ isSuspended()

bool QFutureInterfaceBase::isSuspended ( ) const

Definition at line 284 of file qfutureinterface.cpp.

◆ isSuspending()

bool QFutureInterfaceBase::isSuspending ( ) const

Definition at line 272 of file qfutureinterface.cpp.

◆ isThrottled()

bool QFutureInterfaceBase::isThrottled ( ) const

Definition at line 289 of file qfutureinterface.cpp.

◆ isValid()

bool QFutureInterfaceBase::isValid ( ) const

Definition at line 300 of file qfutureinterface.cpp.

◆ launchAsync()

bool QFutureInterfaceBase::launchAsync ( ) const
protected

Definition at line 1047 of file qfutureinterface.cpp.

◆ loadState()

int QFutureInterfaceBase::loadState ( ) const

Definition at line 475 of file qfutureinterface.cpp.

◆ mutex()

QMutex & QFutureInterfaceBase::mutex ( ) const

Definition at line 638 of file qfutureinterface.cpp.

◆ operator!=()

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

Definition at line 151 of file qfutureinterface.h.

◆ operator=()

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

Definition at line 666 of file qfutureinterface.cpp.

◆ operator==()

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

Definition at line 150 of file qfutureinterface.h.

◆ progressMaximum()

int QFutureInterfaceBase::progressMaximum ( ) const

Definition at line 380 of file qfutureinterface.cpp.

◆ progressMinimum()

int QFutureInterfaceBase::progressMinimum ( ) const

Definition at line 374 of file qfutureinterface.cpp.

◆ progressText()

QString QFutureInterfaceBase::progressText ( ) const

Definition at line 392 of file qfutureinterface.cpp.

◆ progressValue()

int QFutureInterfaceBase::progressValue ( ) const

Definition at line 368 of file qfutureinterface.cpp.

◆ queryState()

bool QFutureInterfaceBase::queryState ( State state) const

Definition at line 470 of file qfutureinterface.cpp.

◆ refT()

bool QFutureInterfaceBase::refT ( ) const
protectednoexcept

Definition at line 679 of file qfutureinterface.cpp.

◆ reportCanceled()

void QFutureInterfaceBase::reportCanceled ( )

Definition at line 414 of file qfutureinterface.cpp.

◆ reportException() [1/2]

void QFutureInterfaceBase::reportException ( const QException & e)

Definition at line 420 of file qfutureinterface.cpp.

◆ reportException() [2/2]

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

Definition at line 432 of file qfutureinterface.cpp.

◆ reportFinished()

void QFutureInterfaceBase::reportFinished ( )

Definition at line 448 of file qfutureinterface.cpp.

◆ reportResultsReady()

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

Definition at line 526 of file qfutureinterface.cpp.

◆ reportStarted()

void QFutureInterfaceBase::reportStarted ( )

Definition at line 404 of file qfutureinterface.cpp.

◆ reportSuspended()

void QFutureInterfaceBase::reportSuspended ( ) const

Definition at line 225 of file qfutureinterface.cpp.

◆ reset()

void QFutureInterfaceBase::reset ( )
protected

Definition at line 690 of file qfutureinterface.cpp.

◆ resultCount()

int QFutureInterfaceBase::resultCount ( ) const

Definition at line 386 of file qfutureinterface.cpp.

◆ resultStoreBase() [1/2]

QtPrivate::ResultStoreBase & QFutureInterfaceBase::resultStoreBase ( )

Definition at line 654 of file qfutureinterface.cpp.

◆ resultStoreBase() [2/2]

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

Definition at line 660 of file qfutureinterface.cpp.

◆ rethrowPossibleException()

void QFutureInterfaceBase::rethrowPossibleException ( )
protected

Definition at line 698 of file qfutureinterface.cpp.

◆ runContinuation()

void QFutureInterfaceBase::runContinuation ( ) const
protected

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

◆ setContinuation() [2/2]

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

Definition at line 887 of file qfutureinterface.cpp.

◆ setExpectedResultCount()

void QFutureInterfaceBase::setExpectedResultCount ( int resultCount)

Definition at line 458 of file qfutureinterface.cpp.

◆ setFilterMode()

void QFutureInterfaceBase::setFilterMode ( bool enable)

Definition at line 567 of file qfutureinterface.cpp.

◆ setLaunchAsync()

void QFutureInterfaceBase::setLaunchAsync ( bool value)
protected

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

◆ setProgressValue()

void QFutureInterfaceBase::setProgressValue ( int progressValue)

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

◆ setRunnable()

void QFutureInterfaceBase::setRunnable ( QRunnable * runnable)

Definition at line 552 of file qfutureinterface.cpp.

◆ setSuspended()

void QFutureInterfaceBase::setSuspended ( bool suspend)

Definition at line 199 of file qfutureinterface.cpp.

◆ setThreadPool()

void QFutureInterfaceBase::setThreadPool ( QThreadPool * pool)

Definition at line 557 of file qfutureinterface.cpp.

◆ setThrottled()

void QFutureInterfaceBase::setThrottled ( bool enable)

Definition at line 239 of file qfutureinterface.cpp.

◆ suspendIfRequested()

void QFutureInterfaceBase::suspendIfRequested ( )

Definition at line 337 of file qfutureinterface.cpp.

◆ swap()

void QFutureInterfaceBase::swap ( QFutureInterfaceBase & other)
noexcept

Definition at line 674 of file qfutureinterface.cpp.

◆ threadPool()

QThreadPool * QFutureInterfaceBase::threadPool ( ) const

Definition at line 562 of file qfutureinterface.cpp.

◆ toggleSuspended()

void QFutureInterfaceBase::toggleSuspended ( )

Definition at line 212 of file qfutureinterface.cpp.

◆ waitForFinished()

void QFutureInterfaceBase::waitForFinished ( )

Definition at line 507 of file qfutureinterface.cpp.

◆ waitForNextResult()

bool QFutureInterfaceBase::waitForNextResult ( )

Definition at line 311 of file qfutureinterface.cpp.

◆ waitForResult()

void QFutureInterfaceBase::waitForResult ( int resultIndex)

Definition at line 483 of file qfutureinterface.cpp.

◆ waitForResume()

void QFutureInterfaceBase::waitForResume ( )

Definition at line 317 of file qfutureinterface.cpp.

◆ QFutureInterfaceBasePrivate

friend class QFutureInterfaceBasePrivate
friend

Definition at line 172 of file qfutureinterface.h.

◆ QFutureWatcherBase

friend class QFutureWatcherBase
friend

Definition at line 176 of file qfutureinterface.h.

◆ QFutureWatcherBasePrivate

friend class QFutureWatcherBasePrivate
friend

Definition at line 177 of file qfutureinterface.h.

◆ QPromise

template<class T>
friend class QPromise
friend

Definition at line 196 of file qfutureinterface.h.

◆ QtPrivate::CanceledHandler

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

Definition at line 183 of file qfutureinterface.h.

◆ QtPrivate::CompactContinuation

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

Definition at line 180 of file qfutureinterface.h.

◆ QtPrivate::FailureHandler

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

Definition at line 187 of file qfutureinterface.h.


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