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>();
124 futureInterface->setThreadPool(threadPool);
129 futureInterface->reportStarted();
130 QFuture<T> future = QFuture<T>(futureInterfaceTyped());
133 acquireBarrierSemaphore();
134 threadPool->start(
this);
141 futureInterfaceTyped()->reportFinished(result());
142 delete futureInterfaceTyped();
150 futureInterfaceTyped()->reportResult(_result, index);
156 futureInterfaceTyped()->reportResults(_result, index, count);
176 return threadEngine->startAsynchronously();
212template <
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)
Combined button and popup list for selecting options.
ThreadEngineStarter< typename ThreadEngine::ResultType > startThreadEngine(ThreadEngine *threadEngine)
[qtconcurrentthreadengine-1]