C/C++ API Reference
Loading...
Searching...
No Matches
pw::async2::internal::FutureBase< Derived, T > Class Template Reference

Overview

template<typename Derived, typename T>
class pw::async2::internal::FutureBase< Derived, T >

Optional future base class for future implementations. Provides value_type, Pend(), and is_complete(). Requires the derived class to implement DoPend(),DoMarkComplete(), andDoIsComplete()`.

Public Types

using value_type = std::conditional_t< std::is_void_v< T >, ReadyType, T >
 

Public Member Functions

Poll< value_type > Pend (Context &cx)
 
bool is_complete () const
 

Member Function Documentation

◆ is_complete()

template<typename Derived , typename T >
bool pw::async2::internal::FutureBase< Derived, T >::is_complete ( ) const
inline

Returns true if the future has already returned a Ready result.

Calling Pend on a completed future will trigger an assertion.

◆ Pend()

template<typename Derived , typename T >
Poll< value_type > pw::async2::internal::FutureBase< Derived, T >::Pend ( Context cx)
inline

Polls the future to advance its state.

Returns Pending if the future is not yet complete, or Ready with its result if it is.

If this future has already completed, calling Pend will trigger an assertion.


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