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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions

# FilteredEachKernel< Iterator, KeepFunctor > Class Template Reference

Search for all occurrences

## Detailed Description

### template<typename Iterator, typename KeepFunctor>
class QtConcurrent::FilteredEachKernel< Iterator, KeepFunctor >

Definition at line 247 of file qtconcurrentfilterkernel.h.

`#include <qtconcurrentfilterkernel.h>`

Inheritance diagram for FilteredEachKernel< Iterator, KeepFunctor >:
[legend]

List of all members.

## Public Types
typedef T | ReturnType
typedef T | ResultType
## Public Member Functions
| FilteredEachKernel (Iterator begin, Iterator end, KeepFunctor _keep)
void | start ()
bool | runIteration (Iterator it, int index, T *)
bool | runIterations (Iterator sequenceBeginIterator, int begin, int end, T *)

## Member Typedef Documentation

typedef T ReturnType

Search for all occurrences

Definition at line 255 of file qtconcurrentfilterkernel.h.

typedef T ResultType

Search for all occurrences

Reimplemented from IterateKernel< Iterator, qValueType< Iterator >::value_type >.

Definition at line 256 of file qtconcurrentfilterkernel.h.

## Constructor & Destructor Documentation

FilteredEachKernel | ( | Iterator | begin,
|  | Iterator | end,
|  | KeepFunctor | _keep
| ) |  | `[inline]`

Definition at line 258 of file qtconcurrentfilterkernel.h.

            : IterateKernelType(begin, end), keep(_keep)
        { }

## Member Function Documentation

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

Search for all occurrences

Reimplemented from IterateKernel< Iterator, qValueType< Iterator >::value_type >.

Definition at line 262 of file qtconcurrentfilterkernel.h.

        {
            if (this->futureInterface)
                this->futureInterface->setFilterMode(true);
            IterateKernelType::start();
        }

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

Search for all occurrences

Definition at line 269 of file qtconcurrentfilterkernel.h.

        {
            if (keep(*it))
                this->reportResult(&(*it), index);
            else
                this->reportResult(0, index);
            return false;
        }

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

Search for all occurrences

Definition at line 278 of file qtconcurrentfilterkernel.h.

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

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

            this->reportResults(results.vector, begin, count);
            return false;
        }

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

- QtCore/qtconcurrentfilterkernel.h