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

Overview

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.

Inheritance diagram for pw::async2::ValueFuture< T >:
pw::async2::ListableFutureWithWaker< ValueFuture< T >, T > pw::async2::Future< Derived, T > pw::containers::future::IntrusiveList< T >::Item

Public Types

using Base = ListableFutureWithWaker< ValueFuture< T >, T >
 
- Public Types inherited from pw::async2::Future< Derived, T >
using value_type = std::conditional_t< std::is_void_v< T >, ReadyType, T >
 

Public Member Functions

 ValueFuture (ValueFuture &&other) noexcept
 
ValueFutureoperator= (ValueFuture &&other) noexcept
 
- Public Member Functions inherited from pw::async2::ListableFutureWithWaker< ValueFuture< T >, T >
 ListableFutureWithWaker (const ListableFutureWithWaker &)=delete
 
ListableFutureWithWakeroperator= (const ListableFutureWithWaker &)=delete
 
- Public Member Functions inherited from pw::async2::Future< Derived, T >
Poll< value_type > Pend (Context &cx)
 
bool is_complete () const
 

Static Public Member Functions

static ValueFuture Resolved (T value)
 Creates a ValueFuture that is already resolved with the given value.
 
template<typename... Args>
static ValueFuture Resolved (Args &&... args)
 

Friends

class ValueProvider< T >
 
class BroadcastValueProvider< T >
 

Additional Inherited Members

- Protected Types inherited from pw::async2::ListableFutureWithWaker< ValueFuture< T >, T >
enum  ConstructedState
 Tag to prevent accidental default construction.
 
using Lock = Provider
 
- Protected Member Functions inherited from pw::async2::ListableFutureWithWaker< ValueFuture< T >, T >
 ListableFutureWithWaker (ConstructedState state)
 
 ListableFutureWithWaker (ListFutureProvider< ValueFuture< T > > &provider)
 
 ListableFutureWithWaker (SingleFutureProvider< ValueFuture< T > > &single)
 
void MoveFrom (ListableFutureWithWaker &other)
 
ListFutureProvider< ValueFuture< T > > & provider ()
 
Lock & lock ()
 
void Wake ()
 Wakes the task waiting on the future.
 
- Protected Member Functions inherited from pw::containers::future::IntrusiveList< T >::Item
constexpr Item ()=default
 

Member Function Documentation

◆ Resolved()

template<typename T >
template<typename... Args>
static ValueFuture pw::async2::ValueFuture< T >::Resolved ( Args &&...  args)
inlinestatic

Creates a ValueFuture that is already resolved by constructing its value in-place.


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