#include <OnixS/CME/MDH/threading/Future.h>
Definition at line 45 of file Future.h.
◆ anonymous enum
| Enumerator |
|---|
| InfiniteTimeout | -1 | |
Definition at line 78 of file Future.h.
◆ FutureBase() [1/5]
◆ FutureBase() [2/5]
◆ FutureBase() [3/5]
◆ FutureBase() [4/5]
| FutureBase |
( |
const System::FutureSharedState * | state | ) |
|
|
protectednoexcept |
Initializes the instance and adds a reference to the shared state.
◆ FutureBase() [5/5]
Initializes the instance from a detached shared state reference.
◆ ~FutureBase()
Destroys a future object.
If this is the last reference to the asynchronous result associated with *this, destroys that asynchronous result.
◆ get_exception_ptr()
| std::exception_ptr get_exception_ptr |
( |
| ) |
const |
Returns the stored exception pointer.
- Exceptions
-
| std::logic_error | if this instance does not refer to a shared state. |
| std::logic_error | if the operation has not finished with an error. |
◆ getValuePtr()
| const void * getValuePtr |
( |
| ) |
const |
|
protected |
◆ getVoid()
◆ has_exception()
| bool has_exception |
( |
| ) |
const |
Checks whether the asynchronous result associated with this future stores an exception.
- Exceptions
-
| std::logic_error | if this instance does not refer to a shared state. |
◆ has_value()
Checks whether the asynchronous result associated with this future stores a value.
- Exceptions
-
| std::logic_error | if this instance does not refer to a shared state. |
◆ is_ready()
Checks whether the asynchronous result associated with this future is ready (has a value or exception stored in the shared state), false otherwise.
- Exceptions
-
| std::logic_error | if this instance does not refer to a shared state. |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ swap()
◆ valid()
Checks whether this instance is associated with a shared asynchronous result.
- Returns
true if this instance has an associated shared state, false otherwise.
Definition at line 51 of file Future.h.
◆ wait()
Waits for the result to become available.
- Parameters
-
| timeoutInMs | Maximum wait time in milliseconds. Use InfiniteTimeout to wait without a timeout. |
- Returns
std::future_status::ready when the shared state has a value or exception, or std::future_status::timeout when the timeout expires first.
- Note
- Calling
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.
- Exceptions
-
| std::logic_error | if this instance does not refer to a shared state. |
◆ FutureHelper
| friend class FutureHelper |
|
friend |