C/C++ API Reference
Loading...
Searching...
No Matches
pw::async2::FutureWithTimeout< T, PrimaryFuture, TimeoutFuture, TimeoutResolution, typename, typename, typename > Class Template Reference

Overview

template<typename T, typename PrimaryFuture, typename TimeoutFuture, typename TimeoutResolution, typename = std::enable_if_t<!std::is_lvalue_reference_v<PrimaryFuture>>, typename = std::enable_if_t<!std::is_lvalue_reference_v<TimeoutFuture>>, typename = std::enable_if_t<!std::is_lvalue_reference_v<TimeoutResolution>>>
class pw::async2::FutureWithTimeout< T, PrimaryFuture, TimeoutFuture, TimeoutResolution, typename, typename, typename >

While this class is public, it should typically be constructed using the factory functions defined later, as those handle appropriate selection of the TimeoutFuture and TimeoutResolution type parameters based on the PrimaryFuture type and timeout value you use in constructing a FutureWithTimeout.

Combines a primary (value) future with a secondary (timeout) future. This type is itself a future.

Invoking the Pend() member function invokes Pend() on both the primary and secondary futures.

When pended, the primary future is checked first. If that result is Ready(T), then that Ready value is returned from the FutureWithTimeout wrapper's Pend().

If the primary future is Pending, then the secondary timeout future is checked. If that is Ready, then the TimeoutResolution policy class type argument is used to decide what value should be returned.

Inheritance diagram for pw::async2::FutureWithTimeout< T, PrimaryFuture, TimeoutFuture, TimeoutResolution, typename, typename, typename >:
pw::async2::Future< FutureWithTimeout< T, PrimaryFuture, TimeoutFuture, TimeoutResolution >, T >

Public Member Functions

 FutureWithTimeout (PrimaryFuture &&primary_future, TimeoutFuture &&timeout_future, TimeoutResolution &&timeout_resolution)
 
- Public Member Functions inherited from pw::async2::Future< FutureWithTimeout< T, PrimaryFuture, TimeoutFuture, TimeoutResolution >, T >
Poll< value_type > Pend (Context &cx)
 
bool is_complete () const
 

Additional Inherited Members

- Public Types inherited from pw::async2::Future< FutureWithTimeout< T, PrimaryFuture, TimeoutFuture, TimeoutResolution >, T >
using value_type = std::conditional_t< std::is_void_v< T >, ReadyType, T >
 

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