5#ifndef QTCONCURRENT_THREADENGINE_H
6#define QTCONCURRENT_THREADENGINE_H
8#include <QtConcurrent/qtconcurrent_global.h>
10#if !defined(QT_NO_CONCURRENT) ||defined(Q_QDOC)
12#include <QtCore/qthreadpool.h>
13#include <QtCore/qfuture.h>
14#include <QtCore/qexception.h>
15#include <QtCore/qwaitcondition.h>
16#include <QtCore/qatomic.h>
17#include <QtCore/qsemaphore.h>
85#ifndef QT_NO_EXCEPTIONS
109 return static_cast<QFutureInterface<T> *>(futureInterface);
115 ThreadEngineBase::startSingleThreaded();
123 futureInterface =
new QFutureInterface<T>();
128 futureInterface->reportStarted();
129 QFuture<T> future = QFuture<T>(futureInterfaceTyped());
132 acquireBarrierSemaphore();
133 threadPool->start(
this);
140 futureInterfaceTyped()->reportFinished(result());
141 delete futureInterfaceTyped();
149 futureInterfaceTyped()->reportResult(_result, index);
155 futureInterfaceTyped()->reportResults(_result, index, count);
175 return threadEngine->startAsynchronously();
211template <
typename ThreadEngine>
ThreadEngineStarterBase(ThreadEngine< T > *_threadEngine)
ThreadEngineStarterBase(const ThreadEngineStarterBase &other)
QFuture< T > startAsynchronously()
ThreadEngineStarter(ThreadEngine< void > *_threadEngine)
ThreadEngineStarter(TypedThreadEngine *eng)
ThreadEngine(QThreadPool *pool)
T * startSingleThreaded()
QFuture< T > startAsynchronously()
QFutureInterface< T > * futureInterfaceTyped()
void reportResult(const T *_result, int index=-1)
void asynchronousFinish() override
void reportResults(const QList< T > &_result, int index=-1, int count=-1)
ThreadEngineStarter< typename ThreadEngine::ResultType > startThreadEngine(ThreadEngine *threadEngine)
[qtconcurrentthreadengine-1]