|
YACLib
C++ library for concurrent tasks execution
|
An object that allows you to Add some amount of async operations and then Wait for it to be Done. More...
#include <wait_group.hpp>
Public Member Functions | |
| WaitGroup (std::size_t count=0) noexcept | |
| YACLIB_INLINE void | Add (std::size_t count=1) noexcept |
| Add some amount of async operations. | |
| YACLIB_INLINE void | Done (std::size_t count=1) noexcept |
| Done some Add-ed async operations. | |
| YACLIB_INLINE std::size_t | Count (std::memory_order order=std::memory_order_relaxed) const noexcept |
| template<bool NeedAdd = true, typename... V, typename... E> | |
| YACLIB_INLINE void | Consume (FutureBase< V, E > &&... futures) noexcept |
| Consume Future by WaitGroup with auto Done. | |
| template<bool NeedAdd = true, typename It > | |
| YACLIB_INLINE std::enable_if_t<!is_future_base_v< It >, void > | Consume (It begin, It end) noexcept |
| Consume Future by WaitGroup with auto Done. | |
| template<bool NeedAdd = true, typename It > | |
| YACLIB_INLINE void | Consume (It begin, std::size_t count) noexcept |
| Consume Future by WaitGroup with auto Done. | |
| template<bool NeedAdd = true, typename... V, typename... E> | |
| YACLIB_INLINE void | Attach (FutureBase< V, E > &... futures) noexcept |
| Attach Future to WaitGroup with auto Done. | |
| template<bool NeedAdd = true, typename It > | |
| YACLIB_INLINE std::enable_if_t<!is_future_base_v< It >, void > | Attach (It begin, It end) noexcept |
| Attach Future to WaitGroup with auto Done. | |
| template<bool NeedAdd = true, typename It > | |
| YACLIB_INLINE void | Attach (It begin, std::size_t count) noexcept |
| Attach Future to WaitGroup with auto Done. | |
| YACLIB_INLINE void | Wait () noexcept |
| TODO. | |
| template<typename Rep , typename Period > | |
| YACLIB_INLINE bool | WaitFor (const std::chrono::duration< Rep, Period > &timeout_duration) |
| TODO. | |
| template<typename Clock , typename Duration > | |
| YACLIB_INLINE bool | WaitUntil (const std::chrono::time_point< Clock, Duration > &timeout_time) |
| TODO. | |
| YACLIB_INLINE void | Reset (std::size_t count=0) noexcept |
Reinitializes WaitGroup, semantically the same as *this = {}; | |
An object that allows you to Add some amount of async operations and then Wait for it to be Done.
Definition at line 18 of file wait_group.hpp.
|
inlineexplicitnoexcept |
Definition at line 20 of file wait_group.hpp.
|
inlinenoexcept |
Add some amount of async operations.
Can be called parallel with Add, Done, and with Wait, but only if you call it when some Add not Done yet
| count | of async operations |
Definition at line 31 of file wait_group.hpp.
|
inlinenoexcept |
Attach Future to WaitGroup with auto Done.
Also
| NeedAdd | if true make implicit Add, if false you should make explicit Add before call Attach |
| futures | to wait |
Definition at line 98 of file wait_group.hpp.
References yaclib::MakeContract().
|
inlinenoexcept |
Attach Future to WaitGroup with auto Done.
Also
| NeedAdd | if true make implicit Add, if false you should make explicit Add before call Attach |
| begin | iterator to futures to Add |
| end | iterator to futures to Add |
Definition at line 112 of file wait_group.hpp.
References yaclib::MakeContract().
|
inlinenoexcept |
Attach Future to WaitGroup with auto Done.
Also
| NeedAdd | if true make implicit Add, if false you should make explicit Add before call Attach |
| begin | iterator to futures to Add |
| count | count of futures to Add |
Definition at line 126 of file wait_group.hpp.
References yaclib::MakeContract().
|
inlinenoexcept |
Consume Future by WaitGroup with auto Done.
Also
| NeedAdd | if true make implicit Add, if false you should make explicit Add before call Consume |
| futures | to wait |
Definition at line 57 of file wait_group.hpp.
References yaclib::MakeContract().
|
inlinenoexcept |
Consume Future by WaitGroup with auto Done.
Also
| NeedAdd | if true make implicit Add, if false you should make explicit Add before call Consume |
| begin | iterator to futures to Add |
| end | iterator to futures to Add |
Definition at line 71 of file wait_group.hpp.
References yaclib::MakeContract().
|
inlinenoexcept |
Consume Future by WaitGroup with auto Done.
Also
| NeedAdd | if true make implicit Add, if false you should make explicit Add before call Consume |
| begin | iterator to futures to Add |
| count | count of futures to Add |
Definition at line 85 of file wait_group.hpp.
References yaclib::MakeContract().
|
inlinenoexcept |
Definition at line 44 of file wait_group.hpp.
References yaclib::MakeContract().
|
inlinenoexcept |
Done some Add-ed async operations.
| count | of async operations |
Definition at line 40 of file wait_group.hpp.
|
inlinenoexcept |
Reinitializes WaitGroup, semantically the same as *this = {};
If you don't explicitly call this method, then after the first one, Wait will always return immediately.
Definition at line 192 of file wait_group.hpp.
|
inlinenoexcept |
TODO.
Definition at line 133 of file wait_group.hpp.
|
inline |
|
inline |