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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions

# FilteredReducedKernel< ReducedResultType, Iterator, KeepFunctor, ReduceFunctor, Reducer > Class Template Reference

Search for all occurrences

## Detailed Description

### template<typename ReducedResultType, typename Iterator, typename KeepFunctor, typename ReduceFunctor, typename Reducer = ReduceKernel<ReduceFunctor, ReducedResultType, typename qValueType<Iterator>::value_type>>
class QtConcurrent::FilteredReducedKernel< ReducedResultType, Iterator, KeepFunctor, ReduceFunctor, Reducer >

Definition at line 164 of file qtconcurrentfilterkernel.h.

`#include <qtconcurrentfilterkernel.h>`

Inheritance diagram for FilteredReducedKernel< ReducedResultType, Iterator, KeepFunctor, ReduceFunctor, Reducer >:
[legend]

List of all members.

## Public Types
typedef ReducedResultType | ReturnType
typedef ReducedResultType | ResultType
## Public Member Functions
| FilteredReducedKernel (Iterator begin, Iterator end, KeepFunctor _keep, ReduceFunctor _reduce, ReduceOptions reduceOption)
bool | runIteration (Iterator it, int index, ReducedResultType *)
bool | runIterations (Iterator sequenceBeginIterator, int begin, int end, ReducedResultType *)
void | finish ()
bool | shouldThrottleThread ()
bool | shouldStartThread ()
ReducedResultType * | result ()

## Member Typedef Documentation

typedef ReducedResultType ReturnType

Search for all occurrences

Definition at line 237 of file qtconcurrentfilterkernel.h.

typedef ReducedResultType ResultType

Search for all occurrences

Reimplemented from IterateKernel< Iterator, ReducedResultType >.

Definition at line 238 of file qtconcurrentfilterkernel.h.

## Constructor & Destructor Documentation

FilteredReducedKernel | ( | Iterator | begin,
|  | Iterator | end,
|  | KeepFunctor | _keep,
|  | ReduceFunctor | _reduce,
|  | ReduceOptions | reduceOption
| ) |  | `[inline]`

Definition at line 173 of file qtconcurrentfilterkernel.h.

            : IterateKernelType(begin, end), reducedResult(), keep(_keep), reduce(_reduce), reducer(reduceOption)
        { }

## Member Function Documentation

bool runIteration | ( | Iterator | it,
|  | int | index,
|  | ReducedResultType * |
| ) |  | `[inline, virtual]`

Search for all occurrences

Reimplemented from IterateKernel< Iterator, ReducedResultType >.

Definition at line 190 of file qtconcurrentfilterkernel.h.

        {
            IntermediateResults<typename qValueType<Iterator>::value_type> results;
            results.begin = index;
            results.end = index + 1;

            if (keep(*it))
                results.vector.append(*it);

            reducer.runReduce(reduce, reducedResult, results);
            return false;
        }

bool runIterations | ( | Iterator | sequenceBeginIterator,
|  | int | begin,
|  | int | end,
|  | ReducedResultType * |
| ) |  | `[inline, virtual]`

Search for all occurrences

Reimplemented from IterateKernel< Iterator, ReducedResultType >.

Definition at line 203 of file qtconcurrentfilterkernel.h.

        {
            IntermediateResults<typename qValueType<Iterator>::value_type> results;
            results.begin = begin;
            results.end = end;
            results.vector.reserve(end - begin);

            Iterator it = sequenceBeginIterator;
            advance(it, begin);
            for (int i = begin; i < end; ++i) {
                if (keep(*it))
                    results.vector.append(*it);
                advance(it, 1);
            }

            reducer.runReduce(reduce, reducedResult, results);
            return false;
        }

void finish | ( |  | ) | `[inline, virtual]`

Search for all occurrences

Reimplemented from ThreadEngineBase.

Definition at line 222 of file qtconcurrentfilterkernel.h.

        {
            reducer.finish(reduce, reducedResult);
        }

bool shouldThrottleThread | ( |  | ) | `[inline, virtual]`

Search for all occurrences

Reimplemented from ThreadEngineBase.

Definition at line 227 of file qtconcurrentfilterkernel.h.

        {
            return IterateKernelType::shouldThrottleThread() || reducer.shouldThrottle();
        }

bool shouldStartThread | ( |  | ) | `[inline, virtual]`

Search for all occurrences

Reimplemented from IterateKernel< Iterator, ReducedResultType >.

Definition at line 232 of file qtconcurrentfilterkernel.h.

        {
            return IterateKernelType::shouldStartThread() && reducer.shouldStartThread();
        }

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

Search for all occurrences

Reimplemented from ThreadEngine< ReducedResultType >.

Definition at line 239 of file qtconcurrentfilterkernel.h.

        {
            return &reducedResult;
        }

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

- QtCore/qtconcurrentfilterkernel.h