ORIGINAL
Loading...
Searching...
No Matches
original::async::promise< TYPE, Callback > Class Template Reference

Represents a promise of a future result. More...

#include <async.h>

Collaboration diagram for original::async::promise< TYPE, Callback >:
Collaboration graph

Public Member Functions

 promise (Callback &&c)
 Constructs a promise with a computation callback.
 
future< TYPE > getFuture ()
 Gets the future associated with this promise.
 
void run ()
 Executes the computation and sets the result.
 

Detailed Description

template<typename TYPE, typename Callback>
class original::async::promise< TYPE, Callback >

Represents a promise of a future result.

Template Parameters
TYPEThe result type of the computation
CallbackThe type of the computation callback

Provides the means to set the result of an asynchronous computation

Constructor & Destructor Documentation

◆ promise()

template<typename TYPE , typename Callback >
original::async::promise< TYPE, Callback >::promise ( Callback && c)
explicit

Constructs a promise with a computation callback.

Parameters
cCallback that will produce the result

Member Function Documentation

◆ getFuture()

template<typename TYPE , typename Callback >
original::async::future< TYPE > original::async::promise< TYPE, Callback >::getFuture ( )

Gets the future associated with this promise.

Returns
A future that will receive the result

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