ThreadEngine< T > Class Template Reference


Detailed Description

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

Definition at line 138 of file qtconcurrentthreadengine.h.

#include <qtconcurrentthreadengine.h>

Inheritance diagram for ThreadEngine< T >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef T  ResultType

Public Member Functions

virtual T *  result ()
QFutureInterface< T > *  futureInterfaceTyped ()
T *  startSingleThreaded ()
T *  startBlocking ()
QFuture< T >  startAsynchronously ()
void  asynchronousFinish ()
void  reportResult (const T *_result, int index=-1)
void  reportResults (const QVector< T > &_result, int index=-1, int count=-1)

Member Typedef Documentation


Member Function Documentation

QFutureInterface<T>* futureInterfaceTyped ( ) [inline]

Definition at line 145 of file qtconcurrentthreadengine.h.

    {
        return static_cast<QFutureInterface<T> *>(futureInterface);
    }
T* startSingleThreaded ( ) [inline]
T* startBlocking ( ) [inline]
QFuture<T> startAsynchronously ( ) [inline]

Definition at line 168 of file qtconcurrentthreadengine.h.

    {
        futureInterface = new QFutureInterface<T>();

        // reportStart() must be called before starting threads, otherwise the
        // user algorithm might finish while reportStart() is running, which
        // is very bad.
        futureInterface->reportStarted();
        QFuture<T> future = QFuture<T>(futureInterfaceTyped());
        start();

        acquireBarrierSemaphore();
        threadPool->start(this);
        return future;
    }
void asynchronousFinish ( ) [inline, virtual]

Implements ThreadEngineBase.

Definition at line 184 of file qtconcurrentthreadengine.h.

    {
        finish();
        futureInterfaceTyped()->reportFinished(result());
        delete futureInterfaceTyped();
        delete this;
    }
void reportResult ( const T *  _result,
int  index = -1 
) [inline]

Definition at line 193 of file qtconcurrentthreadengine.h.

    {
        if (futureInterface)
            futureInterfaceTyped()->reportResult(_result, index);
    }
void reportResults ( const QVector< T > &  _result,
int  index = -1,
int  count = -1 
) [inline]

Definition at line 199 of file qtconcurrentthreadengine.h.

    {
        if (futureInterface)
            futureInterfaceTyped()->reportResults(_result, index, count);
    }

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