STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types
stapl::future< T > Class Template Reference

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)
 
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 >
 

Detailed Description

template<typename T>
class stapl::future< T >

Provides a mechanism to access the result of asynchronous operations.

Template Parameters
TObject type.

Member Function Documentation

◆ get()

template<typename T >
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.

◆ wait()

template<typename T >
void stapl::future< T >::wait ( void  ) const

Waits for the result to become available.

Blocks until valid()==true.

◆ async_then()

template<typename T >
template<typename Function >
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.


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