The iterator type of QVector is just (const) T *, so we cannot call
::reference on it directly. Access via std::iterator_traits instead.
This is especially interesting in the light of Qt 6 replacing QList with
QVector.
Change-Id: Ib4e84f61302822e51b8984e2a44fea874efce81d
Reviewed-by: hjk <hjk@qt.io>
Use a thread pool with reduced max thread count.
Task-number: QTCREATORBUG-18185
Change-Id: I18bd3de82365edaf21d8dcf9c89035da1ac74756
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Adding API for that to the parallel map/reduce functions
Change-Id: Ic7987d899c124dcb04c1ca110b09fc97576873fe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
- simpler mapReduce
- blocking mappedReduced
- map with iterators
- blocking mapped
The special QtConcurrent::map for modifying the container is not needed
(it simply is Utils::map with a map function that takes a reference to a
value, and either non-const iterators or a std::ref container).
The special (blocking)filter((ed)Reduced) is simply done with the
Utils::map(ped)/map(ped)Reduce(d) functions with a map function that
takes a QFutureInterface and only reports values if the value should not
be filtered out. That way it can also be used as a
"filteredMappedReduced".
Change-Id: Id8dcbb7277be4d0e27b9e1691df35535dd481924
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Support move-only types for the container, container's item type, the
state type, and all the involved functions.
Change-Id: I5c46e42cc41e46187f7bb4ee4043f8b3b5d31320
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
If a container is given to mapReduce, it takes the responsibility to
report progress information for the whole operation. If the map function
reports its own progress, that is taken into account for the overall
progress.
The (so far only unordered) Utils::map operation can be used to replace
MultiTask, by passing a member function of the items in the container as
a map function.
Change-Id: I18ca38a6ad2899d73f590bfe59bf2e6eb2f1a57a
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
- QThread instead of std::thread for better integration with Qt
- Use thread pool for recycling threads
- Map and reduce functions are handled like any function passed
to runAsync, so they either report results through the
QFutureInterface, or through the return value.
- Automatically deduce the reduce result type
Change-Id: I7a31370c21f8c27b378cd87c3d5974b162449ce1
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>