template<typename T>
class pw::async2::ValueFuture< T >
A future that holds a single value.
A ValueFuture is a concrete Future implementation that is vended by a ValueProvider or a BroadcastValueProvider. It waits until the provider resolves it with a value.
|
|
class | ValueProvider< T > |
| |
|
class | BroadcastValueProvider< T > |
| |
|
template<typename DerivedFuture > |
| class | DerivedValueProvider |
| |
|
template<typename U , typename FutureType > |
| class | ValueListProvider |
| |
◆ Cancel()
Cancels the future.
Always call Cancel() in the destructor of any class derived from ValueFuture to ensure the future is unlisted before the derived class members are destroyed.
◆ MoveFrom() [1/2]
Moves the base ValueFuture from other while holding the provider lock.
Use this overload when moving a ValueFuture or a derived future that has no additional state accessed by the provider. If the derived class has member variables that may be inspected by the provider (e.g., via ResolveIf or ResolveFirstMatching), use MoveFrom(other,
move_members) instead so that those members are moved atomically under the same lock acquisition.
◆ MoveFrom() [2/2]
template<typename T >
template<typename Fn >
Moves the base ValueFuture from other and invokes move_members while holding the provider lock.
Always call MoveFrom in the move constructor and move assignment operator of any class derived from ValueFuture to ensure derived class members are initialized before a concurrent provider operation can access the moved-to future.
◆ Resolved()
template<typename T >
template<typename... Args>
Creates a ValueFuture that is already resolved by constructing its value in-place.
The documentation for this class was generated from the following file:
- pw_async2/public/pw_async2/value_future.h