Google Cloud C++ Client
1.42.0
C++ Client Library for Google Cloud Platform
|
Implement promise<T>
as defined in ISO/IEC TS 19571:2016.
More...
#include <google/cloud/future_generic.h>
Public Member Functions | |
promise () | |
Creates a promise with an unsatisfied shared state. More... | |
promise (std::function< void()> cancellation_callback) | |
Creates a promise with an unsatisfied shared state. More... | |
promise (null_promise_t x) | |
Creates a promise without a shared state. More... | |
promise (promise &&)=default | |
Constructs a new promise and transfer any shared state from rhs . More... | |
promise & | operator= (promise &&rhs) noexcept |
Abandons the shared state in *this , if any, and transfers the shared state from rhs . More... | |
~promise ()=default | |
Abandons any shared state. More... | |
promise (promise const &)=delete | |
promise & | operator= (promise const &)=delete |
void | swap (promise &other) noexcept |
Swaps the shared state in *this with rhs . More... | |
future< T > | get_future () |
Creates the future<T> using the same shared state as *this . More... | |
void | set_value (T value) |
Satisfies the shared state. More... | |
Implement promise<T>
as defined in ISO/IEC TS 19571:2016.
Definition at line 147 of file future_generic.h.
|
inline |
Creates a promise with an unsatisfied shared state.
Definition at line 150 of file future_generic.h.
|
inlineexplicit |
Creates a promise with an unsatisfied shared state.
Definition at line 153 of file future_generic.h.
|
inlineexplicit |
Creates a promise without a shared state.
Definition at line 157 of file future_generic.h.
|
default |
Constructs a new promise and transfer any shared state from rhs
.
|
default |
Abandons any shared state.
If the shared state was not already satisfied it becomes satisfied with a std::future_error
exception. The error code in this exception is std::future_errc::broken_promise
.
|
delete |
|
inline |
Creates the future<T>
using the same shared state as *this
.
Definition at line 192 of file future_generic.h.
|
inlinenoexcept |
Abandons the shared state in *this
, if any, and transfers the shared state from rhs
.
Definition at line 166 of file future_generic.h.
|
delete |
|
inline |
Satisfies the shared state.
std::future_error | with std::future_errc::promise_already_satisfied if the shared state is already satisfied. |
std::future_error | with std::no_state if the promise does not have a shared state. |
Definition at line 205 of file future_generic.h.
|
inlinenoexcept |
Swaps the shared state in *this
with rhs
.
Definition at line 185 of file future_generic.h.