- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions

# ThreadEngine< T > Class Template Reference

Search for all occurrences

## 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 >:
[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

typedef T ResultType

Search for all occurrences

Reimplemented in FilterKernel< Sequence, KeepFunctor, ReduceFunctor >, FilteredReducedKernel< ReducedResultType, Iterator, KeepFunctor, ReduceFunctor, Reducer >, FilteredEachKernel< Iterator, KeepFunctor >, IterateKernel< Iterator, T >, MappedReducedKernel< ReducedResultType, Iterator, MapFunctor, ReduceFunctor, Reducer >, MappedEachKernel< Iterator, MapFunctor >, IterateKernel< Iterator, void >, IterateKernel< Iterator, MapFunctor::result_type >, IterateKernel< Iterator, qValueType< Iterator >::value_type >, IterateKernel< Sequence::const_iterator, void >, and IterateKernel< Iterator, ReducedResultType >.

Definition at line 141 of file qtconcurrentthreadengine.h.

## Member Function Documentation

virtual T* result | ( |  | ) | `[inline, virtual]`

Search for all occurrences

Reimplemented in FilteredReducedKernel< ReducedResultType, Iterator, KeepFunctor, ReduceFunctor, Reducer >, and MappedReducedKernel< ReducedResultType, Iterator, MapFunctor, ReduceFunctor, Reducer >.

Definition at line 143 of file qtconcurrentthreadengine.h.

    { return 0; }

QFutureInterface<T>* futureInterfaceTyped | ( |  | ) | `[inline]`

Search for all occurrences

Definition at line 145 of file qtconcurrentthreadengine.h.

        {
            return static_cast<QFutureInterface<T> *>(futureInterface);
        }

T* startSingleThreaded | ( |  | ) | `[inline]`

Search for all occurrences

Reimplemented from ThreadEngineBase.

Definition at line 151 of file qtconcurrentthreadengine.h.

        {
            ThreadEngineBase::startSingleThreaded();
            return result();
        }

T* startBlocking | ( |  | ) | `[inline]`

Search for all occurrences

Reimplemented from ThreadEngineBase.

Definition at line 160 of file qtconcurrentthreadengine.h.

        {
            ThreadEngineBase::startBlocking();
            return result();
        }

QFuture<T> startAsynchronously | ( |  | ) | `[inline]`

Search for all occurrences

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]`

Search for all occurrences

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]`

Search for all occurrences

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]`

Search for all occurrences

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:

- QtCore/qtconcurrentthreadengine.h