Google Cloud C++ Client  0.4.0
C++ Client Library for Google Cloud Platform
Public Member Functions | List of all members
google::cloud::v0::promise< void > Class Template Referencefinal

Specialize promise as defined in ISO/IEC TS 19571:2016 for void. More...

#include <google/cloud/future_void.h>

Public Member Functions

 promise ()=default
 Creates a promise with an unsatisfied shared state. More...
 
 promise (promise &&rhs) noexcept=default
 Constructs a new promise and transfer any shared state from rhs. More...
 
promiseoperator= (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
 
promiseoperator= (promise const &)=delete
 
void swap (promise &other) noexcept
 Swaps the shared state in *this with rhs. More...
 
future< void > get_future ()
 Creates the future<void> using the same shared state as *this. More...
 
void set_value ()
 Satisfies the shared state. More...
 

Detailed Description

template<>
class google::cloud::v0::promise< void >

Specialize promise as defined in ISO/IEC TS 19571:2016 for void.

Definition at line 128 of file future_void.h.

Constructor & Destructor Documentation

◆ promise() [1/3]

google::cloud::v0::promise< void >::promise ( )
default

Creates a promise with an unsatisfied shared state.

◆ promise() [2/3]

google::cloud::v0::promise< void >::promise ( promise< void > &&  rhs)
defaultnoexcept

Constructs a new promise and transfer any shared state from rhs.

◆ ~promise()

google::cloud::v0::promise< void >::~promise ( )
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.

◆ promise() [3/3]

google::cloud::v0::promise< void >::promise ( promise< void > const &  )
delete

Member Function Documentation

◆ get_future()

future<void> google::cloud::v0::promise< void >::get_future ( )
inline

Creates the future<void> using the same shared state as *this.

Definition at line 164 of file future_void.h.

◆ operator=() [1/2]

promise& google::cloud::v0::promise< void >::operator= ( promise< void > &&  rhs)
inlinenoexcept

Abandons the shared state in *this, if any, and transfers the shared state from rhs.

Definition at line 138 of file future_void.h.

◆ operator=() [2/2]

promise& google::cloud::v0::promise< void >::operator= ( promise< void > const &  )
delete

◆ set_value()

void google::cloud::v0::promise< void >::set_value ( )
inline

Satisfies the shared state.

Exceptions
std::future_errorwith std::future_errc::promise_already_satisfied if the shared state is already satisfied.
std::future_errorwith std::no_state if the promise does not have a shared state.

Definition at line 177 of file future_void.h.

◆ swap()

void google::cloud::v0::promise< void >::swap ( promise< void > &  other)
inlinenoexcept

Swaps the shared state in *this with rhs.

Definition at line 157 of file future_void.h.