#include <OnixS/CME/MDH/threading/Future.h>
Public Member Functions | |
| SharedFuture () noexcept=default | |
| SharedFuture (const SharedFuture &other) noexcept=default | |
| SharedFuture & | operator= (const SharedFuture &other) noexcept=default |
| SharedFuture (SharedFuture &&other) noexcept=default | |
| SharedFuture & | operator= (SharedFuture &&other) noexcept=default |
| Implementation::FutureGetReturn< T >::Type | get () const |
| void | swap (SharedFuture< T > &other) noexcept |
| void | get () const |
| Public Member Functions inherited from FutureBase | |
| bool | valid () const noexcept |
| bool | is_ready () const |
| bool | has_value () const |
| bool | has_exception () const |
| std::exception_ptr | get_exception_ptr () const |
| std::future_status | wait (int timeoutInMs=InfiniteTimeout) const |
Friends | |
| class | Implementation::FutureHelper |
Additional Inherited Members | |
| Public Types inherited from FutureBase | |
| enum | |
| Protected Member Functions inherited from FutureBase | |
| FutureBase () noexcept=default | |
| FutureBase (const FutureBase &other) noexcept | |
| FutureBase & | operator= (const FutureBase &other) noexcept |
| FutureBase (FutureBase &&other) noexcept | |
| FutureBase & | operator= (FutureBase &&other) noexcept |
| FutureBase (const System::FutureSharedState *state) noexcept | |
| FutureBase (const System::FutureSharedState *state, moving_init_t) noexcept | |
| ~FutureBase () noexcept | |
| void | swap (FutureBase &other) noexcept |
| const void * | getValuePtr () const |
| void | getVoid () const |
Represents the result of an asynchronous operation.
A producer creates a shared state through the internal system future/promise implementation and exposes it through SharedFuture. A consumer can then check readiness, wait for completion, retrieve the value, or observe a stored exception. These operations may block or throw depending on the state.
SharedFuture is copiable, and multiple instances may refer to the same shared state. Access to the same shared state from multiple threads is safe if each thread does it through its own copy of a SharedFuture object.
Reference result types are intentionally not supported by this public wrapper.
|
defaultnoexcept |
|
defaultnoexcept |
Copy constructor.
|
defaultnoexcept |
|
inline |
Waits for completion and returns the stored value.
The returned reference remains valid while the shared state remains alive. If the shared state stores an exception, this method rethrows that exception.
| std::logic_error | if this instance does not refer to a shared state. |
|
inline |
|
defaultnoexcept |
Copy assignment.
|
defaultnoexcept |
|
inlinenoexcept |
Swaps two SharedFuture objects.