RunFunctionTask< T > Class Template Reference

RunFunctionTask< T > Class Template Reference

#include <qtconcurrentrunbase.h>

Class Description

template<typename T>
class QtConcurrent::RunFunctionTask< T >

Definition at line 94 of file qtconcurrentrunbase.h.

+ Inheritance diagram for RunFunctionTask< T >:

Public Member Functions

void run ()
 
- Public Member Functions inherited from RunFunctionTaskBase< T >
QFuture< T > start ()
 
virtual void runFunctor ()=0
 
- Public Member Functions inherited from QFutureInterface< T >
 QFutureInterface (State initialState=NoState)
 
 QFutureInterface (const QFutureInterface &other)
 
 ~QFutureInterface ()
 
QFutureInterfaceoperator= (const QFutureInterface &other)
 
QFuture< T > future ()
 
void reportResult (const T *result, int index=-1)
 
void reportResult (const T &result, int index=-1)
 
void reportResults (const QVector< T > &results, int beginIndex=-1, int count=-1)
 
void reportFinished (const T *result=0)
 
const T & resultReference (int index) const
 
const T * resultPointer (int index) const
 
QList< T > results ()
 
- Public Member Functions inherited from QFutureInterfaceBase
 QFutureInterfaceBase (State initialState=NoState)
 
 QFutureInterfaceBase (const QFutureInterfaceBase &other)
 
virtual ~QFutureInterfaceBase ()
 
void reportStarted ()
 
void reportFinished ()
 
void reportCanceled ()
 
void reportException (const QtConcurrent::Exception &e)
 
void reportResultsReady (int beginIndex, int endIndex)
 
void setRunnable (QRunnable *runnable)
 
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 isPaused () const
 
bool isThrottled () const
 
bool isResultReadyAt (int index) const
 
void cancel ()
 
void setPaused (bool paused)
 
void togglePaused ()
 
void setThrottled (bool enable)
 
void waitForFinished ()
 
bool waitForNextResult ()
 
void waitForResult (int resultIndex)
 
void waitForResume ()
 
QMutexmutex () const
 
QtConcurrent::internal::ExceptionStoreexceptionStore ()
 
QtConcurrent::ResultStoreBaseresultStoreBase ()
 
const QtConcurrent::ResultStoreBaseresultStoreBase () const
 
bool operator== (const QFutureInterfaceBase &other) const
 
bool operator!= (const QFutureInterfaceBase &other) const
 
QFutureInterfaceBaseoperator= (const QFutureInterfaceBase &other)
 
- Public Member Functions inherited from QRunnable
 QRunnable ()
 
virtual ~QRunnable ()
 
bool autoDelete () const
 
void setAutoDelete (bool _autoDelete)
 

Public Attributes

result
 

Additional Inherited Members

- Public Types inherited from QFutureInterfaceBase
enum  State {
  NoState = 0x00, Running = 0x01, Started = 0x02, Finished = 0x04,
  Canceled = 0x08, Paused = 0x10, Throttled = 0x20
}
 
- Static Public Member Functions inherited from QFutureInterface< T >
static QFutureInterface canceledResult ()
 
- Protected Member Functions inherited from QFutureInterfaceBase
bool referenceCountIsOne () const
 

Member Function Documentation

void run ( )
inlinevirtual

Reimplemented from RunFunctionTaskBase< T >.

Definition at line 97 of file qtconcurrentrunbase.h.

98  {
99  if (this->isCanceled()) {
100  this->reportFinished();
101  return;
102  }
103 #ifndef QT_NO_EXCEPTIONS
104  try {
105 #endif
106  this->runFunctor();
107 #ifndef QT_NO_EXCEPTIONS
108  } catch (QtConcurrent::Exception &e) {
110  } catch (...) {
112  }
113 #endif
114 
115  this->reportResult(result);
116  this->reportFinished();
117  }
bool isCanceled() const
void reportException(const QtConcurrent::Exception &e)
void reportResult(const T *result, int index=-1)

Member Data Documentation

T result

Definition at line 118 of file qtconcurrentrunbase.h.


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