Public Member Functions |
| Promise () noexcept |
| Constructor for empty Promise.
|
| Promise (Promise &&) noexcept |
Promise & | operator= (Promise &&) noexcept |
Result< Error > | cancel () noexcept |
| Cancel method. Think of it as acceptance of cancel requested by.
|
Result< Error > | fail () noexcept |
| Fail method. Think of it as valid failure to run some promised function. Only makes sense if underlying state is Promised.
|
Result< Error > | fulfill (DataType &&promisedData) noexcept |
| Fulfill promise with data. Only makes sense if underlying state is Promised.
|
Future< DataType > | future (Result< Error > &error) noexcept |
| Create tethered future object. Only makes sense if underlying state is Empty.
|
FuturePromiseState | state () const noexcept |
| Returns current state of future-promise pair.
|
Static Public Member Functions |
static void | swap (Promise &first, Promise &second) noexcept |
| Static method that swaps internal data between two passed promises.
|
template<typename T>
class fsdk::Promise< T >
Promise class to support asynchronous data retrieval Look into std::promise semantics to understand it.
- Note:
- Is not instantiable using this header only.
- Template Parameters:
-