Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QFutureInterfaceBasePrivate Class Reference

#include <qfutureinterface_p.h>

+ Collaboration diagram for QFutureInterfaceBasePrivate:

Classes

union  Data
 
struct  ProgressData
 
class  RefCount
 

Public Types

enum  ContinuationState : quint8 { Default , Canceled , Cleaned }
 

Public Member Functions

 QFutureInterfaceBasePrivate (QFutureInterfaceBase::State initialState)
 
 ~QFutureInterfaceBasePrivate ()
 
QThreadPoolpool () const
 
int internal_resultCount () const
 
bool internal_isResultReadyAt (int index) const
 
bool internal_waitForNextResult ()
 
bool internal_updateProgressValue (int progress)
 
bool internal_updateProgress (int progress, const QString &progressText=QString())
 
void internal_setThrottled (bool enable)
 
void sendCallOut (const QFutureCallOutEvent &callOut)
 
void sendCallOuts (const QFutureCallOutEvent &callOut1, const QFutureCallOutEvent &callOut2)
 
void connectOutputInterface (QFutureCallOutInterface *iface)
 
void disconnectOutputInterface (QFutureCallOutInterface *iface)
 
void setState (QFutureInterfaceBase::State state)
 

Public Attributes

QMutex m_mutex
 
QBasicMutex continuationMutex
 
QList< QFutureCallOutInterface * > outputConnections
 
QElapsedTimer progressTime
 
QWaitCondition waitCondition
 
QWaitCondition pausedWaitCondition
 
Data data = { QtPrivate::ResultStoreBase() }
 
QRunnablerunnable = nullptr
 
QThreadPoolm_pool = nullptr
 
std::function< void(const QFutureInterfaceBase &)> continuation
 
QFutureInterfaceBasePrivatecontinuationData = nullptr
 
RefCount refCount = 1
 
QAtomicInt state
 
int m_progressValue = 0
 
QScopedPointer< ProgressDatam_progress
 
int m_expectedResultCount = 0
 
bool launchAsync = false
 
bool isValid = false
 
bool hasException = false
 
std::atomic< ContinuationStatecontinuationState { Default }
 

Detailed Description

Definition at line 84 of file qfutureinterface_p.h.

Member Enumeration Documentation

◆ ContinuationState

Enumerator
Default 
Canceled 
Cleaned 

Definition at line 163 of file qfutureinterface_p.h.

Constructor & Destructor Documentation

◆ QFutureInterfaceBasePrivate()

QFutureInterfaceBasePrivate::QFutureInterfaceBasePrivate ( QFutureInterfaceBase::State  initialState)

Definition at line 632 of file qfutureinterface.cpp.

References QElapsedTimer::invalidate(), and progressTime.

+ Here is the call graph for this function:

◆ ~QFutureInterfaceBasePrivate()

QFutureInterfaceBasePrivate::~QFutureInterfaceBasePrivate ( )

Definition at line 638 of file qfutureinterface.cpp.

References hasException.

Member Function Documentation

◆ connectOutputInterface()

◆ disconnectOutputInterface()

void QFutureInterfaceBasePrivate::disconnectOutputInterface ( QFutureCallOutInterface iface)

Definition at line 806 of file qfutureinterface.cpp.

References QListSpecialMethodsBase< T >::indexOf(), interface, lock, m_mutex, outputConnections, and QList< T >::removeAt().

Referenced by QFutureWatcherBase::disconnectOutputInterface().

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

◆ internal_isResultReadyAt()

bool QFutureInterfaceBasePrivate::internal_isResultReadyAt ( int  index) const

Definition at line 651 of file qfutureinterface.cpp.

References false, and hasException.

Referenced by QFutureInterfaceBase::isResultReadyAt(), and QFutureInterfaceBase::waitForResult().

+ Here is the caller graph for this function:

◆ internal_resultCount()

int QFutureInterfaceBasePrivate::internal_resultCount ( ) const

Definition at line 646 of file qfutureinterface.cpp.

References hasException.

Referenced by QFutureInterfaceBase::resultCount().

+ Here is the caller graph for this function:

◆ internal_setThrottled()

void QFutureInterfaceBasePrivate::internal_setThrottled ( bool  enable)

Definition at line 707 of file qfutureinterface.cpp.

References QBasicAtomicInteger< T >::loadRelaxed(), pausedWaitCondition, state, switch_off(), switch_on(), QFutureInterfaceBase::Throttled, and QWaitCondition::wakeAll().

+ Here is the call graph for this function:

◆ internal_updateProgress()

bool QFutureInterfaceBasePrivate::internal_updateProgress ( int  progress,
const QString progressText = QString() 
)

Definition at line 688 of file qfutureinterface.cpp.

References QElapsedTimer::elapsed(), QElapsedTimer::isValid(), m_progress, m_progressValue, MaxProgressEmitsPerSecond, progressTime, Q_ASSERT, and QElapsedTimer::start().

Referenced by QFutureInterfaceBase::setProgressValueAndText().

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

◆ internal_updateProgressValue()

bool QFutureInterfaceBasePrivate::internal_updateProgressValue ( int  progress)

Definition at line 672 of file qfutureinterface.cpp.

References QElapsedTimer::elapsed(), QElapsedTimer::isValid(), m_progressValue, MaxProgressEmitsPerSecond, progressTime, and QElapsedTimer::start().

Referenced by QFutureInterfaceBase::reportResultsReady().

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

◆ internal_waitForNextResult()

bool QFutureInterfaceBasePrivate::internal_waitForNextResult ( )

Definition at line 656 of file qfutureinterface.cpp.

References QFutureInterfaceBase::Canceled, hasException, QBasicAtomicInteger< T >::loadRelaxed(), m_mutex, QFutureInterfaceBase::Running, state, QWaitCondition::wait(), and waitCondition.

Referenced by QFutureInterfaceBase::waitForNextResult().

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

◆ pool()

QThreadPool * QFutureInterfaceBasePrivate::pool ( ) const
inline

Definition at line 166 of file qfutureinterface_p.h.

References QThreadPool::globalInstance(), and m_pool.

Referenced by QFutureInterfaceBase::suspendIfRequested(), QFutureInterfaceBase::waitForFinished(), QFutureInterfaceBase::waitForResult(), and QFutureInterfaceBase::waitForResume().

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

◆ sendCallOut()

void QFutureInterfaceBasePrivate::sendCallOut ( const QFutureCallOutEvent callOut)

Definition at line 724 of file qfutureinterface.cpp.

References QList< T >::at(), i, QList< T >::isEmpty(), outputConnections, QFutureCallOutInterface::postCallOutEvent(), and QList< T >::size().

Referenced by QFutureInterfaceBase::cancel(), QFutureInterfaceBase::reportFinished(), QFutureInterfaceBase::reportResultsReady(), QFutureInterfaceBase::reportStarted(), QFutureInterfaceBase::reportSuspended(), QFutureInterfaceBase::setProgressRange(), QFutureInterfaceBase::setProgressValueAndText(), QFutureInterfaceBase::setSuspended(), QFutureInterfaceBase::suspendIfRequested(), and QFutureInterfaceBase::toggleSuspended().

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

◆ sendCallOuts()

void QFutureInterfaceBasePrivate::sendCallOuts ( const QFutureCallOutEvent callOut1,
const QFutureCallOutEvent callOut2 
)

Definition at line 733 of file qfutureinterface.cpp.

References i, interface, QList< T >::isEmpty(), outputConnections, and QList< T >::size().

Referenced by QFutureInterfaceBase::reportResultsReady().

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

◆ setState()

void QFutureInterfaceBasePrivate::setState ( QFutureInterfaceBase::State  state)

Definition at line 817 of file qfutureinterface.cpp.

References newState(), state, and QBasicAtomicInteger< T >::storeRelaxed().

Referenced by QFutureInterfaceBase::reportStarted().

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

Member Data Documentation

◆ continuation

std::function<void(const QFutureInterfaceBase &)> QFutureInterfaceBasePrivate::continuation

Definition at line 143 of file qfutureinterface_p.h.

◆ continuationData

QFutureInterfaceBasePrivate* QFutureInterfaceBasePrivate::continuationData = nullptr

Definition at line 144 of file qfutureinterface_p.h.

Referenced by QFutureInterfaceBase::cancel().

◆ continuationMutex

QBasicMutex QFutureInterfaceBasePrivate::continuationMutex

Definition at line 117 of file qfutureinterface_p.h.

◆ continuationState

std::atomic<ContinuationState> QFutureInterfaceBasePrivate::continuationState { Default }

Definition at line 164 of file qfutureinterface_p.h.

◆ data

◆ hasException

◆ isValid

◆ launchAsync

bool QFutureInterfaceBasePrivate::launchAsync = false

Definition at line 159 of file qfutureinterface_p.h.

◆ m_expectedResultCount

int QFutureInterfaceBasePrivate::m_expectedResultCount = 0

◆ m_mutex

◆ m_pool

QThreadPool* QFutureInterfaceBasePrivate::m_pool = nullptr

◆ m_progress

◆ m_progressValue

◆ outputConnections

QList<QFutureCallOutInterface *> QFutureInterfaceBasePrivate::outputConnections

◆ pausedWaitCondition

◆ progressTime

◆ refCount

◆ runnable

◆ state

◆ waitCondition


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