C/C++ API Reference
Loading...
Searching...
No Matches
pw::async2::BroadcastValueProvider< T > Class Template Reference

Overview

template<typename T>
class pw::async2::BroadcastValueProvider< T >

A one-to-many provider for a single value.

A BroadcastValueProvider can vend multiple ValueFuture objects. When the provider is resolved, all futures vended by it are completed with the same value.

This provider is multi-shot: after Resolve is called, new futures can be retrieved with Get to wait for the next Resolve event.

Public Member Functions

ValueFuture< T > Get ()
 
template<typename U = T, std::enable_if_t<!std::is_void_v< U >, int > = 0>
void Resolve (const U &value)
 Resolves every pending ValueFuture with a copy of the provided value.
 
template<typename U = T, std::enable_if_t< std::is_void_v< U >, int > = 0>
void Resolve ()
 Resolves every pending ValueFuture.
 

Member Function Documentation

◆ Get()

template<typename T >
ValueFuture< T > pw::async2::BroadcastValueProvider< T >::Get ( )
inline

Returns a ValueFuture that will be completed when Resolve is called.

Multiple futures can be retrieved and will pend concurrently.


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