42 #ifndef QTCONCURRENT_RUNBASE_H 43 #define QTCONCURRENT_RUNBASE_H 45 #include <QtCore/qglobal.h> 47 #ifndef QT_NO_CONCURRENT 49 #include <QtCore/qfuture.h> 50 #include <QtCore/qrunnable.h> 51 #include <QtCore/qthreadpool.h> 63 struct SelectSpecialization
65 template <
class Normal,
class Vo
id>
66 struct Type {
typedef Normal
type; };
70 struct SelectSpecialization<void>
72 template <
class Normal,
class Vo
id>
82 this->setRunnable(
this);
83 this->reportStarted();
90 virtual void runFunctor() = 0;
94 class RunFunctionTask :
public RunFunctionTaskBase<T>
99 if (this->isCanceled()) {
100 this->reportFinished();
103 #ifndef QT_NO_EXCEPTIONS 107 #ifndef QT_NO_EXCEPTIONS 115 this->reportResult(result);
116 this->reportFinished();
122 class RunFunctionTask<void> :
public RunFunctionTaskBase<void>
127 if (this->isCanceled()) {
128 this->reportFinished();
131 #ifndef QT_NO_EXCEPTIONS 135 #ifndef QT_NO_EXCEPTIONS 142 this->reportFinished();
153 #endif // QT_NO_CONCURRENT
#define QT_END_NAMESPACE
This macro expands to.
The UnhandledException class represents an unhandled exception in a worker thread.
The QRunnable class is the base class for all runnable objects.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void start(QRunnable *runnable, int priority=0)
Reserves a thread and uses it to run runnable, unless this thread will make the current thread count ...
void reportException(const QtConcurrent::Exception &e)
The QFuture class represents the result of an asynchronous computation.
The Exception class provides a base class for exceptions that can transferred across threads...
The QtConcurrent namespace provides high-level APIs that make it possible to write multi-threaded pro...
static QThreadPool * globalInstance()
Returns the global QThreadPool instance.
QFuture< T > run(Function function,...)