AUI Framework
master
Cross-platform module-based framework for developing C++20 desktop applications
|
Manages multiple futures. More...
Manages multiple futures.
T | future's return type |
AFutureSet involves functions to efficiently manage multiple AFutures.
Guarantees that held futures will never be executed or be during execution after AAsyncHolder is destroyed.
Public Member Functions | |
void | waitForAll () |
Wait for the result of every AFuture. More... | |
void | checkForExceptions () const |
Find AFutures that encountered an exception. If such AFuture is found, AInvocationTargetException is thrown. | |
template<aui::invocable OnComplete> | |
void | onAllComplete (OnComplete &&onComplete) |
Specifies a callback which will be called when all futures in future set would have the result. More... | |
Public Member Functions inherited from AVector< AFuture< void > > | |
AVector (aui::range< Iterator > range) | |
AVector (std::vector< AFuture< void >, Allocator > &&rhs) noexcept | |
iterator | insertAll (const OtherContainer &c) noexcept |
iterator | insertAll (OtherContainer &&c) noexcept |
iterator | insertAll (iterator at, const OtherContainer &c) noexcept |
iterator | insertAll (iterator at, OtherContainer &&c) noexcept |
void | removeAll (const AFuture< void > &item) noexcept |
void | removeAll (const T &item, Projection projection) noexcept |
AOptional< std::size_t > | removeFirst (const AFuture< void > &item) noexcept |
bool | isSubsetOf (const OtherContainer &c) const noexcept |
bool | contains (const AFuture< void > &value) const noexcept |
std::size_t | sizeInBytes () const noexcept |
AFuture< void > & | at (std::size_t index) |
const AFuture< void > & | at (std::size_t index) const |
self & | operator<< (const AFuture< void > &rhs) noexcept |
self & | operator<< (AFuture< void > &&rhs) noexcept |
self & | operator<< (const OtherContainer &c) noexcept |
self & | operator<< (OtherContainer &&c) noexcept |
AFuture< void > & | first () noexcept |
const AFuture< void > & | first () const noexcept |
AFuture< void > & | last () noexcept |
const AFuture< void > & | last () const noexcept |
size_t | indexOf (const AFuture< void > &value) const noexcept |
AVector< AFuture< void > > & | sort () noexcept |
AVector< AFuture< void > > & | sort (Comparator &&comparator) noexcept |
AFuture< void > * | findIf (Predicate &&predicate) noexcept |
Finds element by predicate. More... | |
void | removeAt (size_t index) noexcept |
void | removeIf (Predicate &&predicate) noexcept |
void | removeIfFirst (Predicate &&predicate) noexcept |
ASet< AFuture< void > > | toSet () const noexcept |
auto | map (UnaryOperation &&transformer) -> AVector< decltype(transformer(std::declval< AFuture< void > & >()))> |
auto | map (UnaryOperation &&transformer) const -> AVector< decltype(transformer(std::declval< AFuture< void > >()))> |
auto | toMap (UnaryOperation &&transformer) const -> AMap< decltype(transformer(std::declval< AFuture< void > >()).first), decltype(transformer(std::declval< AFuture< void > >()).second)> |
auto | toMap (UnaryOperation &&transformer) -> AMap< decltype(transformer(std::declval< AFuture< void > >()).first), decltype(transformer(std::declval< AFuture< void > >()).second)> |
self | filter (Predicate &&predicate) |
Additional Inherited Members | |
Public Types inherited from AVector< AFuture< void > > | |
using | iterator = typename super::iterator |
Static Public Member Functions inherited from AVector< AFuture< void > > | |
static AVector< AFuture< void >, Allocator > | generate (size_t size, Callable &&callable) noexcept |
static auto | fromRange (aui::range< Iterator > range, UnaryOperation &&transformer) -> AVector< decltype(transformer(range.first()))> |
Constructs a new vector of transformed items of the range. More... | |
Protected Types inherited from AVector< AFuture< void > > | |
using | super = std::vector< AFuture< void >, Allocator > |
using | self = AVector< AFuture< void >, Allocator > |
|
inline |
Specifies a callback which will be called when all futures in future set would have the result.
Even if all tasks are already completed, it's guaranteed that your callback will be called.
The thread on which your callback will be called is undefined.
|
inline |
Wait for the result of every AFuture.
#include <AUI/Thread/AThreadPool.h>