QtConcurrent Namespace
The QtConcurrent namespace provides high-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives. More...
#include <QtConcurrent>This namespace was introduced in QtConcurrent 4.4.
Types
| enum | ReduceOption { UnorderedReduce, OrderedReduce, SequentialReduce } |
| flags | ReduceOptions |
Functions
| void | blockingFilter(Sequence & sequence, FilterFunction filterFunction) |
| Sequence | blockingFiltered(const Sequence & sequence, FilterFunction filterFunction) |
| Sequence | blockingFiltered(ConstIterator begin, ConstIterator end, FilterFunction filterFunction) |
| T | blockingFilteredReduced(const Sequence & sequence, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions = UnorderedReduce | SequentialReduce) |
| T | blockingFilteredReduced(ConstIterator begin, ConstIterator end, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions = UnorderedReduce | SequentialReduce) |
| void | blockingMap(Sequence & sequence, MapFunction function) |
| void | blockingMap(Iterator begin, Iterator end, MapFunction function) |
| T | blockingMapped(const Sequence & sequence, MapFunction function) |
| T | blockingMapped(ConstIterator begin, ConstIterator end, MapFunction function) |
| T | blockingMappedReduced(const Sequence & sequence, MapFunction function, ReduceFunction function, QtConcurrent::ReduceOptions options = UnorderedReduce | SequentialReduce) |
| T | blockingMappedReduced(ConstIterator begin, ConstIterator end, MapFunction function, ReduceFunction function, QtConcurrent::ReduceOptions options = UnorderedReduce | SequentialReduce) |
| QFuture<void> | filter(Sequence & sequence, FilterFunction filterFunction) |
| QFuture<T> | filtered(const Sequence & sequence, FilterFunction filterFunction) |
| QFuture<T> | filtered(ConstIterator begin, ConstIterator end, FilterFunction filterFunction) |
| QFuture<T> | filteredReduced(const Sequence & sequence, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions = UnorderedReduce | SequentialReduce) |
| QFuture<T> | filteredReduced(ConstIterator begin, ConstIterator end, FilterFunction filterFunction, ReduceFunction reduceFunction, QtConcurrent::ReduceOptions reduceOptions = UnorderedReduce | SequentialReduce) |
| QFuture<void> | map(Sequence & sequence, MapFunction function) |
| QFuture<void> | map(Iterator begin, Iterator end, MapFunction function) |
| QFuture<T> | mapped(const Sequence & sequence, MapFunction function) |
| QFuture<T> | mapped(ConstIterator begin, ConstIterator end, MapFunction function) |
| QFuture<T> | mappedReduced(const Sequence & sequence, MapFunction function, ReduceFunction function, QtConcurrent::ReduceOptions options = UnorderedReduce | SequentialReduce) |
| QFuture<T> | mappedReduced(ConstIterator begin, ConstIterator end, MapFunction function, ReduceFunction function, QtConcurrent::ReduceOptions options = UnorderedReduce | SequentialReduce) |
| QFuture<T> | run(Function function, ...) |
Detailed Description
The QtConcurrent namespace provides high-level APIs that make it possible to write multi-threaded programs without using low-level threading primitives.
See the Qt Concurrent chapter in the threading documentation.
Type Documentation
enum QtConcurrent::ReduceOption
flags QtConcurrent::ReduceOptions
This enum specifies the order of which results from the map or filter function are passed to the reduce function.
| Constant | Value | Description |
|---|---|---|
| QtConcurrent::UnorderedReduce | 0x1 | Reduction is done in an arbitrary order. |
| QtConcurrent::OrderedReduce | 0x2 | Reduction is done in the order of the original sequence. |
| QtConcurrent::SequentialReduce | 0x4 | Reduction is done sequentially: only one thread will enter the reduce function at a time. (Parallel reduction might be supported in a future version of Qt Concurrent.) |
The ReduceOptions type is a typedef for QFlags<ReduceOption>. It stores an OR combination of ReduceOption values.