Future class to support asynchronous data retrieval Look into std::future semantics to understand it.
More...
#include <Future.h>
List of all members.
Public Member Functions |
| Future () noexcept |
| Constructor for empty useless shell of a future.
|
| Future (Future &&mv) noexcept |
Future & | operator= (Future &&) noexcept |
Result< Error > | cancel (const ExecutionPolicy policy) noexcept |
| Cancel method. Might be called on some heavy long running task that is not needed anymore. Only makes sense if underlying state is Promised.
|
FuturePromiseState | state () const noexcept |
| Returns current state of future-promise pair.
|
Result< Error > | takeInto (DataType &container) noexcept |
| Method to retrieve data out of fulfilled future. Only makes sense if current state is Fulfilled.
|
Result< Error > | wait () const noexcept |
| Blocks called thread until internal state changes to Fulfilled, Canceled or Failed.
|
Result< Error > | waitFor (const USec usec) const noexcept |
| Blocks called thread until internal state changes to Fulfilled, Canceled or Failed, OR passed time is over.
|
Static Public Member Functions |
static void | swap (Future &first, Future &second) noexcept |
| Static method that swaps internal data between two passed futures.
|
Detailed Description
template<typename T>
class fsdk::Future< T >
Future class to support asynchronous data retrieval Look into std::future semantics to understand it.
- Note:
- Is not instantiable using this header only.
- Template Parameters:
-
Member Function Documentation
Cancel method. Might be called on some heavy long running task that is not needed anymore. Only makes sense if underlying state is Promised.
- Parameters:
-
policy | Policy on how to behave: block till state becomes Canceled or run async. |
- Returns:
- Result type containing
- See also:
- Error code.
Returns current state of future-promise pair.
- Returns:
- Current state
- See also:
- FuturePromiseState.
Method to retrieve data out of fulfilled future. Only makes sense if current state is Fulfilled.
- Parameters:
-
container | Reference to DataType object to fill with future' data. |
- Returns:
- Result type containing
- See also:
- Error code.
Blocks called thread until internal state changes to Fulfilled, Canceled or Failed.
- Returns:
- Result type containing
- See also:
- Error code.
Blocks called thread until internal state changes to Fulfilled, Canceled or Failed, OR passed time is over.
- Parameters:
-
usec | Upper bound of microseconds to wait. |
- Returns:
- Result type containing
- See also:
- Error code.
The documentation for this class was generated from the following file: