Provides a mechanism to access the result of asynchronous operations. More...
Public Member Functions | |
future (std::unique_ptr< handle_type > p) | |
future (handle_type &h) | |
T | get (void) |
Returns the result. More... | |
bool | valid (void) const |
Returns true if the result is available. | |
void | wait (void) const |
Waits for the result to become available. More... | |
template<typename Function > | |
void | async_then (Function &&f) |
Executes f when the result is available. More... | |
Public Types | |
using | handle_type = typename runtime::future_base< T > |
Provides a mechanism to access the result of asynchronous operations.
T | Object type. |
T stapl::future< T >::get | ( | void | ) |
Returns the result.
This function waits until the result is available and returns it. valid()==false
after a call to this method.
void stapl::future< T >::wait | ( | void | ) | const |
Waits for the result to become available.
Blocks until valid()==true
.
void stapl::future< T >::async_then | ( | Function && | f | ) |
Executes f
when the result is available.
If the result is already available, then the function is executed in-place.