Definition at line 82 of file qtconcurrentfilterkernel.h.
#include <qtconcurrentfilterkernel.h>

Public Types |
|
| typedef void | ReturnType |
| typedef void | ResultType |
Public Member Functions |
|
| FilterKernel (Sequence &_sequence, KeepFunctor _keep, ReduceFunctor _reduce) | |
| bool | runIteration (typename Sequence::const_iterator it, int index, T *) |
| bool | runIterations (typename Sequence::const_iterator sequenceBeginIterator, int begin, int end, T *) |
| void | finish () |
| bool | shouldThrottleThread () |
| bool | shouldStartThread () |
| typedef void ReturnType |
Definition at line 152 of file qtconcurrentfilterkernel.h.
| typedef void ResultType |
Reimplemented from IterateKernel< Sequence::const_iterator, void >.
Definition at line 153 of file qtconcurrentfilterkernel.h.
| FilterKernel | ( | Sequence & | _sequence, |
| KeepFunctor | _keep, | ||
| ReduceFunctor | _reduce | ||
| ) | [inline] |
Definition at line 95 of file qtconcurrentfilterkernel.h.
: IterateKernelType(const_cast<const Sequence &>(_sequence).begin(), const_cast<const Sequence &>(_sequence).end()), reducedResult(),
sequence(_sequence),
keep(_keep),
reduce(_reduce),
reducer(OrderedReduce)
{ }
| bool runIteration | ( | typename Sequence::const_iterator | it, |
| int | index, | ||
| T * | |||
| ) | [inline] |
Definition at line 103 of file qtconcurrentfilterkernel.h.
{
IntermediateResults<typename Sequence::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 | ( | typename Sequence::const_iterator | sequenceBeginIterator, |
| int | begin, | ||
| int | end, | ||
| T * | |||
| ) | [inline] |
Definition at line 116 of file qtconcurrentfilterkernel.h.
{
IntermediateResults<typename Sequence::value_type> results;
results.begin = begin;
results.end = end;
results.vector.reserve(end - begin);
typename Sequence::const_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] |
Reimplemented from ThreadEngineBase.
Definition at line 136 of file qtconcurrentfilterkernel.h.
{
reducer.finish(reduce, reducedResult);
sequence = reducedResult;
}
| bool shouldThrottleThread | ( | ) | [inline, virtual] |
Reimplemented from ThreadEngineBase.
Definition at line 142 of file qtconcurrentfilterkernel.h.
{
return IterateKernelType::shouldThrottleThread() || reducer.shouldThrottle();
}
| bool shouldStartThread | ( | ) | [inline, virtual] |
Reimplemented from IterateKernel< Sequence::const_iterator, void >.
Definition at line 147 of file qtconcurrentfilterkernel.h.
{
return IterateKernelType::shouldStartThread() && reducer.shouldStartThread();
}