Classes | |
struct | moving_init_t |
Public Types | |
enum |
Public Member Functions | |
bool | valid () const ONIXS_FIXENGINE_NOTHROW |
ONIXS_FIXENGINE_API bool | isReady () const |
ONIXS_FIXENGINE_API bool | hasValue () const |
ONIXS_FIXENGINE_API bool | hasException () const |
ONIXS_FIXENGINE_API FutureStatus::Enum | wait (int timeoutInMs=InfiniteTimeout) const |
Protected Member Functions | |
FutureBase () | |
ONIXS_FIXENGINE_API | FutureBase (const FutureBase &other) ONIXS_FIXENGINE_NOTHROW |
ONIXS_FIXENGINE_API FutureBase & | operator= (const FutureBase &other) ONIXS_FIXENGINE_NOTHROW |
ONIXS_FIXENGINE_API | FutureBase (const System::FutureSharedState *state) ONIXS_FIXENGINE_NOTHROW |
ONIXS_FIXENGINE_API | FutureBase (const System::FutureSharedState *state, moving_init_t) ONIXS_FIXENGINE_NOTHROW |
ONIXS_FIXENGINE_API | ~FutureBase () ONIXS_FIXENGINE_NOTHROW |
ONIXS_FIXENGINE_API void | swap (FutureBase &other) ONIXS_FIXENGINE_NOTHROW |
ONIXS_FIXENGINE_API const FutureValue & | getValue () const |
ONIXS_FIXENGINE_API void | getVoid () const |
Friends | |
class | FutureHelper |
class | PromiseBase |
|
inlineprotected |
|
protected |
|
protected |
Initializes the instance with shared state.
|
protected |
Initializes the instance with shared state.
|
protected |
Destroys a future object.
If this is the last reference to the asynchronous result associated with *this (if any), then destroy that asynchronous result.
|
protected |
|
protected |
ONIXS_FIXENGINE_API bool hasException | ( | ) | const |
Returns true
if the asynchronous result associated with this Future has a stored exception, false
otherwise.
The | std::logic_error if this instance does not refer to a shared state. |
ONIXS_FIXENGINE_API bool hasValue | ( | ) | const |
Returns true
if the asynchronous result associated with this Future has a stored value, false
otherwise.
The | std::logic_error if this instance does not refer to a shared state. |
ONIXS_FIXENGINE_API bool isReady | ( | ) | const |
Returns true
if the asynchronous result associated with this Future is ready (has a value or an exception stored in the shared state), false
otherwise.
There are often situations where a get()
call on a Future may not be a blocking call, or is only a blocking call under certain circumstances. This method gives the ability to test for early completion and allows us to avoid associating a continuation, which needs to be scheduled with some non-trivial overhead and near-certain loss of the cache efficiency.
The | std::logic_error if this instance does not refer to a shared state. |
|
protected |
|
protected |
|
inline |
ONIXS_FIXENGINE_API FutureStatus::Enum wait | ( | int | timeoutInMs = InfiniteTimeout | ) | const |
Waits for the result to become available during the timeout.
wait
on the same Future from multiple threads is not safe; the intended use is for each thread that waits on the same shared state to have a copy of a Future.The | std::logic_error if this instance does not refer to a shared state. |
|
friend |