|
CoopSync for TBB 0.1.0
Cooperative synchronization primitives for TBB resumable tasks
|
Copyable future that allows retrieving the result multiple times. More...
#include <coopsync_tbb/future.hpp>
Public Member Functions | |
| shared_future () noexcept=default | |
| Constructs an invalid shared_future. | |
| shared_future (const shared_future &other) noexcept=default | |
| The shared_future is copy-constructible. | |
| shared_future & | operator= (const shared_future &other) noexcept=default |
| The shared_future is copy-assignable. | |
| shared_future (shared_future &&other) noexcept=default | |
| The shared_future is move-constructible. | |
| shared_future & | operator= (shared_future &&other) noexcept=default |
| The shared_future is move-assignable. | |
| ~shared_future ()=default | |
| Destroys the shared_future releasing any shared state. | |
| bool | valid () const noexcept |
| Tests whether the shared_future is valid and refers to a shared state. | |
| bool | try_wait () const |
| Checks whether the shared state is ready without suspending. | |
| void | wait () const |
| Suspends the current task until the shared state is ready. | |
| const T & | get () const |
| Obtains a reference to the value stored in the shared state. If the shared state is ready, this function returns immediately. Otherwise, the task is suspended until the state becomes ready. This function can be called multiple times without invalidating the shared state. | |
Friends | |
| template<typename U> | |
| class | future |
Copyable future that allows retrieving the result multiple times.
Unlike future, shared_future does not consume the shared state when get() is called.
| T | The type of the value stored in the shared state. |
|
defaultnoexcept |
The shared_future is copy-constructible.
| other | The shared_future to copy from, after copying both objects refer to the same shared state. |
|
defaultnoexcept |
The shared_future is move-constructible.
| other | The shared_future to move from, after construction has no shared state and is not valid. |
|
inline |
Obtains a reference to the value stored in the shared state. If the shared state is ready, this function returns immediately. Otherwise, the task is suspended until the state becomes ready. This function can be called multiple times without invalidating the shared state.
| future_error | if not valid or if the promise is broken. |
| Any | exception stored in the shared state. |
|
defaultnoexcept |
The shared_future is copy-assignable.
| other | The shared_future to copy from, after assignment both objects refer to the same shared state. |
|
defaultnoexcept |
The shared_future is move-assignable.
| other | The shared_future to move from, after assignment has no shared state and is not valid. |
|
inline |
Checks whether the shared state is ready without suspending.
| future_error | with std::future_errc::no_state if not valid. |
|
inlinenoexcept |
Tests whether the shared_future is valid and refers to a shared state.
|
inline |
Suspends the current task until the shared state is ready.
| future_error | with std::future_errc::no_state if not valid. |