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

Overview

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

A ValueProvider that may or may not produce a value.

Adds a Cancel() function that resolves the pending future with std::nullopt.

Public Member Functions

 OptionalValueProvider (OptionalValueProvider &&)=default
 
OptionalValueProvideroperator= (OptionalValueProvider &&other)
 
 OptionalValueProvider (const OptionalValueProvider &)=delete
 
OptionalValueProvideroperator= (const OptionalValueProvider &)=delete
 
OptionalValueFuture< T > Get ()
 
template<typename... Args>
void Resolve (Args &&... args)
 Resolves the pending ValueFuture by constructing it in-place.
 
void Cancel ()
 Resolves the pending ValueFuture with std::nullopt.
 

Member Function Documentation

◆ Get()

template<typename T >
OptionalValueFuture< T > pw::async2::OptionalValueProvider< T >::Get ( )
inline

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


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