Specialization of shared_future for reference types.
More...
#include <coopsync_tbb/future.hpp>
|
|
| shared_future () noexcept=default |
| | Constructs the shared_future in a not valid state.
|
| | shared_future (const shared_future &other) noexcept=default |
| | Copy-constructs the shared_future, after copying both objects refer to the same shared state.
|
| shared_future & | operator= (const shared_future &other) noexcept=default |
| | Copy-assigns the shared_future, after assignment both objects refer to the same shared state.
|
| | shared_future (shared_future &&other) noexcept=default |
| | Move-constructs the shared_future, after moving the current object refers to the shared state of the moved-from object and the moved-from object is left in not valid state.
|
| shared_future & | operator= (shared_future &&other) noexcept=default |
| | Move-assigns the shared_future, after moving the current object refers to the shared state of the moved-from object and the moved-from object is left in not valid state.
|
|
| ~shared_future ()=default |
| | Destroys the shared_future. If it was the last shared_future referring to the shared state, the shared state is released.
|
| 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. If the shared state is ready this function returns immediately.
|
| T & | get () const |
| | Obtains a reference 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.
|
|
|
template<typename U> |
| class | future |
template<typename T>
class coopsync_tbb::shared_future< T & >
Specialization of shared_future for reference types.
◆ shared_future() [1/2]
Copy-constructs the shared_future, after copying both objects refer to the same shared state.
- Parameters
-
◆ shared_future() [2/2]
Move-constructs the shared_future, after moving the current object refers to the shared state of the moved-from object and the moved-from object is left in not valid state.
- Parameters
-
◆ get()
Obtains a reference 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.
- Returns
- A reference stored in the shared state.
- Exceptions
-
| future_error | if the future is not valid or if the promise was broken. |
| Any | exception stored in the shared state. |
◆ operator=() [1/2]
Copy-assigns the shared_future, after assignment both objects refer to the same shared state.
- Parameters
-
◆ operator=() [2/2]
Move-assigns the shared_future, after moving the current object refers to the shared state of the moved-from object and the moved-from object is left in not valid state.
- Parameters
-
◆ try_wait()
Checks whether the shared state is ready without suspending.
- Returns
- true if the shared state is ready, false otherwise.
- Exceptions
-
| future_error | with std::future_errc::no_state if the future is not valid. |
◆ valid()
Tests whether the shared_future is valid and refers to a shared state.
- Returns
- true if the shared_future is valid, false otherwise.
◆ wait()
Suspends the current task until the shared state is ready. If the shared state is ready this function returns immediately.
- Exceptions
-
| future_error | with std::future_errc::no_state if the future is not valid. |
The documentation for this class was generated from the following file: