libcoro  1.0
Coroutine support library for C++20
Public Member Functions | List of all members
coro::all_of< T > Class Template Reference

this awaitable is resolved, when all objects specified by constructor are resolved More...

#include <future_list.h>

+ Inheritance diagram for coro::all_of< T >:
+ Collaboration diagram for coro::all_of< T >:

Public Member Functions

 all_of (std::initializer_list< pointer_wrapper< T > > lst)
 construct using initializer list More...
 
template<container_type Container>
 all_of (Container &&cont)
 construct using a container More...
 
template<iterator_type Iter>
 all_of (Iter from, Iter to)
 construct using iterator pair More...
 
- Public Member Functions inherited from coro::future< void >
 future (std::in_place_t, Args &&... args)
 Construct future already resolved with a value. More...
 
 future (Fn &&fn)
 Construct future which is evaluated inside of lambda function. More...
 
 future (deferred_tag, Fn &&fn)
 Construct future with deferred evaluation. More...
 
 requires (std::constructible_from< value_store_type, Args ... > &&avoid_same_kind< future, Args... >) future(Args &&... args)
 Construct future already resolved with a value. More...
 
 ~future ()
 dtor More...
 
futureoperator<< (Fn &&fn)
 Store result future in already declared value. More...
 
promise_t get_promise ()
 Retrieve promise and begin evaluation. More...
 
prepared_coro start ()
 Start deferred execution. More...
 
bool set_callback (Fn &&fn)
 Sets callback which is called once future is resolved (in future) More...
 
bool unset_callback ()
 unset callback More...
 
bool then (Fn &&fn)
 Sets function which is called once future is resolved (always) More...
 
bool operator>> (Fn &&fn)
 Sets function which is called once future is resolved (always) More...
 
wait_awaiter wait () noexcept
 Perform synchronous wait on resolution. More...
 
ret_value get ()
 Retrieves value, performs synchronous wait. More...
 
 operator cast_ret_value ()
 Retrieves value, performs synchronous wait. More...
 
bool is_pending () const
 Determines pending status. More...
 
bool is_in_progress () const
 Determine in progress status. More...
 
bool is_deferred () const
 Determine deferred status. More...
 
bool is_awaited () const
 Determine whether an awaiter is set. More...
 
bool await_ready () const noexcept
 co_await support, returns true, if value is ready (resolved) More...
 
std::coroutine_handle await_suspend (std::coroutine_handle<> h) noexcept
 co_await support, called with suspended coroutine More...
 
bool has_value () const
 Determines, whether future has a value. More...
 
bool has_exception () const
 Determines, whether future has exception. More...
 
canceled_awaiter operator! ()
 awaitable for canceled operation More...
 
promise< X >::notify forward_to (promise< X > &prom) &noexcept
 Forward value, possibly convert it, to different promise. More...
 
promise< X >::notify forward_to (promise< X > &prom) &&noexcept
 Forward value, possibly convert it, to different promise. More...
 
promise< X >::notify convert_to (promise< X > &prom, Fn &&convert) noexcept
 Forward value, possibly convert it, to different promise. More...
 

Additional Inherited Members

- Public Types inherited from coro::future< void >
using cast_ret_value = std::conditional_t< std::is_void_v< void >, bool, std::add_rvalue_reference_t< void > >
 type which is used for cast operator () More...
 
using ret_value = std::conditional_t< std::is_void_v< void >, void, std::add_rvalue_reference_t< void > >
 type which is used as return value of get() and await_resume() More...
 
- Protected Member Functions inherited from coro::future< void >
bool startDeferredEvaluation (ResumeFn &&resume_fn) noexcept
 Starts evaluation of deferred future. More...
 
void setDeferredEvaluation (Fn &&fn)
 Initializes deferred evaluation. More...
 
void attach (future *x)
 Attach future to internal linked list. More...
 
futuredetach ()
 Detach linked list from the future. More...
 

Detailed Description

template<typename T>
class coro::all_of< T >

this awaitable is resolved, when all objects specified by constructor are resolved

The list is defined as an container of pointer to these objects. However for initializer list, you don't need to specify list of pointers

co_await all_of({f1,f2,f3,f4});
std::vector<future<int> *> tasks;
co_await all_of(tasks);
all_of(std::initializer_list< pointer_wrapper< T > > lst)
construct using initializer list
Definition: future_list.h:113
Template Parameters
Ttype of object

Definition at line 106 of file future_list.h.


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