MappedEachKernel< Iterator, MapFunctor > Class Template Reference


Detailed Description

template<typename Iterator, typename MapFunctor>
class QtConcurrent::MappedEachKernel< Iterator, MapFunctor >

Definition at line 167 of file qtconcurrentmapkernel.h.

#include <qtconcurrentmapkernel.h>

Inheritance diagram for MappedEachKernel< Iterator, MapFunctor >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef T  ReturnType
typedef T  ResultType

Public Member Functions

  MappedEachKernel (Iterator begin, Iterator end, MapFunctor _map)
bool  runIteration (Iterator it, int, T *result)
bool  runIterations (Iterator sequenceBeginIterator, int begin, int end, T *results)

Member Typedef Documentation

typedef T ReturnType

Constructor & Destructor Documentation

MappedEachKernel ( Iterator  begin,
Iterator  end,
MapFunctor  _map 
) [inline]

Definition at line 175 of file qtconcurrentmapkernel.h.

        : IterateKernel<Iterator, T>(begin, end), map(_map) { }

Member Function Documentation

bool runIteration ( Iterator  it,
int  ,
T *  result 
) [inline, virtual]

Reimplemented from IterateKernel< Iterator, MapFunctor::result_type >.

Definition at line 178 of file qtconcurrentmapkernel.h.

    {
        *result = map(*it);
        return true;
    }
bool runIterations ( Iterator  sequenceBeginIterator,
int  begin,
int  end,
T *  results 
) [inline, virtual]

Reimplemented from IterateKernel< Iterator, MapFunctor::result_type >.

Definition at line 184 of file qtconcurrentmapkernel.h.

    {

        Iterator it = sequenceBeginIterator;
        advance(it, begin);
        for (int i = begin; i < end; ++i) {
            runIteration(it, i, results + (i - begin));
            advance(it, 1);
        }

        return true;
    }

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