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>.
Loading...
Searching...
No Matches
QFutureInterface< T > Class Template Reference

#include <qfutureinterface.h>

+ Inheritance diagram for QFutureInterface< T >:
+ Collaboration diagram for QFutureInterface< T >:

Public Member Functions

 QFutureInterface (State initialState=NoState)
 
 QFutureInterface (const QFutureInterface &other)
 
 QFutureInterface (const QFutureInterfaceBase &dd)
 
 QFutureInterface (QFutureInterfaceBase &&dd) noexcept
 
QFutureInterfaceoperator= (const QFutureInterface &other)
 
 QFutureInterface (QFutureInterface &&other)=default
 
 ~QFutureInterface ()
 
QFuture< T > future ()
 
template<typename... Args, std::enable_if_t< std::is_constructible_v< T, Args... >, bool > = true>
bool reportAndEmplaceResult (int index, Args &&...args)
 
bool reportResult (const T *result, int index=-1)
 
bool reportAndMoveResult (T &&result, int index=-1)
 
bool reportResult (T &&result, int index=-1)
 
bool reportResult (const T &result, int index=-1)
 
bool reportResults (const QList< T > &results, int beginIndex=-1, int count=-1)
 
bool reportFinished (const T *result)
 
void reportFinished ()
 
const T & resultReference (int index) const
 
const T * resultPointer (int index) const
 
QList< T > results ()
 
takeResult ()
 
void reportException (const std::exception_ptr &e)
 
void reportException (const QException &e)
 
- Public Member Functions inherited from QFutureInterfaceBase
 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 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

static QFutureInterface canceledResult ()
 
- Static Public Member Functions inherited from QFutureInterfaceBase
template<typename T >
static QFutureInterfaceBase get (const QFuture< T > &future)
 

Additional Inherited Members

- Public Types inherited from QFutureInterfaceBase
enum  State {
  NoState = 0x00 , Running = 0x01 , Started = 0x02 , Finished = 0x04 ,
  Canceled = 0x08 , Suspending = 0x10 , Suspended = 0x20 , Throttled = 0x40 ,
  Pending = 0x80
}
 
- Protected Types inherited from QFutureInterfaceBase
enum class  CancelMode { CancelOnly , CancelAndFinish }
 
- Protected Member Functions inherited from QFutureInterfaceBase
bool refT () const noexcept
 
bool derefT () const noexcept
 
void reset ()
 
void rethrowPossibleException ()
 
void setContinuation (std::function< void(const QFutureInterfaceBase &)> func)
 
void setContinuation (std::function< void(const QFutureInterfaceBase &)> func, QFutureInterfaceBasePrivate *continuationFutureData)
 
void cleanContinuation ()
 
void runContinuation () const
 
void setLaunchAsync (bool value)
 
bool launchAsync () const
 
bool isRunningOrPending () const
 
void cancel (CancelMode mode)
 

Detailed Description

template<typename T>
class QFutureInterface< T >

Definition at line 212 of file qfutureinterface.h.

Constructor & Destructor Documentation

◆ QFutureInterface() [1/5]

template<typename T >
QFutureInterface< T >::QFutureInterface ( State initialState = NoState)
inline

Definition at line 215 of file qfutureinterface.h.

References QFutureInterfaceBase::refT().

Referenced by QFutureInterface< T >::canceledResult().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ QFutureInterface() [2/5]

template<typename T >
QFutureInterface< T >::QFutureInterface ( const QFutureInterface< T > & other)
inline

Definition at line 220 of file qfutureinterface.h.

References QFutureInterfaceBase::refT().

+ Here is the call graph for this function:

◆ QFutureInterface() [3/5]

template<typename T >
QFutureInterface< T >::QFutureInterface ( const QFutureInterfaceBase & dd)
inline

Definition at line 225 of file qfutureinterface.h.

References QFutureInterfaceBase::refT().

+ Here is the call graph for this function:

◆ QFutureInterface() [4/5]

template<typename T >
QFutureInterface< T >::QFutureInterface ( QFutureInterfaceBase && dd)
inlinenoexcept

Definition at line 226 of file qfutureinterface.h.

References QFutureInterfaceBase::refT().

+ Here is the call graph for this function:

◆ QFutureInterface() [5/5]

template<typename T >
QFutureInterface< T >::QFutureInterface ( QFutureInterface< T > && other)
default

◆ ~QFutureInterface()

template<typename T >
QFutureInterface< T >::~QFutureInterface ( )
inline

Definition at line 236 of file qfutureinterface.h.

References QFutureInterfaceBase::derefT(), QFutureInterfaceBase::hasException(), and QFutureInterfaceBase::resultStoreBase().

+ Here is the call graph for this function:

Member Function Documentation

◆ canceledResult()

template<typename T >
static QFutureInterface QFutureInterface< T >::canceledResult ( )
inlinestatic

Definition at line 242 of file qfutureinterface.h.

References QFutureInterface< T >::QFutureInterface(), QFutureInterfaceBase::Canceled, QFutureInterfaceBase::Finished, and QFutureInterfaceBase::Started.

+ Here is the call graph for this function:

◆ future()

template<typename T >
QFuture< T > QFutureInterface< T >::future ( )
inline

Definition at line 320 of file qfuture.h.

◆ operator=()

template<typename T >
QFutureInterface & QFutureInterface< T >::operator= ( const QFutureInterface< T > & other)
inline

Definition at line 227 of file qfutureinterface.h.

References copy(), other(), and QFutureInterfaceBase::swap().

+ Here is the call graph for this function:

◆ reportAndEmplaceResult()

template<typename T >
template<typename... Args, std::enable_if_t< std::is_constructible_v< T, Args... >, bool > >
bool QFutureInterface< T >::reportAndEmplaceResult ( int index,
Args &&... args )
inline

Definition at line 315 of file qfutureinterface.h.

References args, QtPrivate::ResultStoreBase::count(), QtPrivate::ResultStoreBase::emplaceResult(), QtPrivate::ResultStoreBase::filterMode(), mutex, and Q_ASSERT.

+ Here is the call graph for this function:

◆ reportAndMoveResult()

template<typename T >
bool QFutureInterface< T >::reportAndMoveResult ( T && result,
int index = -1 )
inline

Definition at line 333 of file qfutureinterface.h.

Referenced by QtConcurrent::StoredFunctionCall< Function, Args >::runFunctor().

+ Here is the caller graph for this function:

◆ reportException() [1/2]

template<typename T >
void QFutureInterface< T >::reportException ( const QException & e)
inline

Definition at line 280 of file qfutureinterface.h.

References QFutureInterfaceBase::hasException(), QFutureInterfaceBase::reportException(), and QFutureInterfaceBase::resultStoreBase().

+ Here is the call graph for this function:

◆ reportException() [2/2]

template<typename T >
void QFutureInterface< T >::reportException ( const std::exception_ptr & e)
inline

Definition at line 272 of file qfutureinterface.h.

References QFutureInterfaceBase::hasException(), QFutureInterfaceBase::reportException(), and QFutureInterfaceBase::resultStoreBase().

+ Here is the call graph for this function:

◆ reportFinished() [1/2]

template<typename T >
void QFutureInterface< T >::reportFinished ( )
inline

Definition at line 255 of file qfutureinterface.h.

References QFutureInterfaceBase::reportFinished(), and QFutureInterfaceBase::runContinuation().

+ Here is the call graph for this function:

◆ reportFinished() [2/2]

template<typename T >
bool QFutureInterface< T >::reportFinished ( const T * result)
inline

Definition at line 373 of file qfutureinterface.h.

References reportResult().

+ Here is the call graph for this function:

◆ reportResult() [1/3]

template<typename T >
bool QFutureInterface< T >::reportResult ( const T & result,
int index = -1 )
inline

Definition at line 345 of file qfutureinterface.h.

References reportResult().

+ Here is the call graph for this function:

◆ reportResult() [2/3]

template<typename T >
bool QFutureInterface< T >::reportResult ( const T * result,
int index = -1 )
inline

Definition at line 292 of file qfutureinterface.h.

References QtPrivate::ResultStoreBase::addResult(), QtPrivate::ResultStoreBase::count(), QtPrivate::ResultStoreBase::filterMode(), mutex, and Q_ASSERT.

Referenced by QtConcurrent::StoredFunctionCall< Function, Args >::runFunctor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reportResult() [3/3]

template<typename T >
bool QFutureInterface< T >::reportResult ( T && result,
int index = -1 )
inline

Definition at line 339 of file qfutureinterface.h.

◆ reportResults()

template<typename T >
bool QFutureInterface< T >::reportResults ( const QList< T > & results,
int beginIndex = -1,
int count = -1 )
inline

Definition at line 351 of file qfutureinterface.h.

References mutex, and Q_ASSERT.

◆ resultPointer()

template<typename T >
const T * QFutureInterface< T >::resultPointer ( int index) const
inline

Definition at line 392 of file qfutureinterface.h.

References mutex, and Q_ASSERT.

◆ resultReference()

template<typename T >
const T & QFutureInterface< T >::resultReference ( int index) const
inline

Definition at line 383 of file qfutureinterface.h.

References mutex, and Q_ASSERT.

◆ results()

template<typename T >
QList< T > QFutureInterface< T >::results ( )
inline

Definition at line 401 of file qfutureinterface.h.

References QSet< T >::begin(), it, mutex, and QFutureInterfaceBase::waitForResult().

+ Here is the call graph for this function:

◆ takeResult()

template<typename T >
T QFutureInterface< T >::takeResult ( )

Definition at line 423 of file qfutureinterface.h.

References mutex, position(), Q_ASSERT, and ret.

+ Here is the call graph for this function:

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