hpx/async_distributed/promise.hpp

See Public API for a list of names and headers that are part of the public HPX API.

template<>
class promise<void, hpx::util::unused_type> : public lcos::detail::promise_base<void, hpx::util::unused_type, lcos::detail::promise_data<void>>

Public Functions

promise()

constructs a promise object and a shared state.

template<typename Allocator>
promise(std::allocator_arg_t, Allocator const &a)

constructs a promise object and a shared state. The constructor uses the allocator a to allocate the memory for the shared state.

promise(promise &&other)

constructs a new promise object and transfers ownership of the shared state of other (if any) to the newly- constructed object.

Post

other has no shared state.

~promise()

Abandons any shared state.

promise &operator=(promise &&other)

Abandons any shared state (30.6.4) and then as if promise(HPX_MOVE(other)).swap(*this).

Return

*this.

void swap(promise &other)

Exchanges the shared state of *this and other.

Post

*this has the shared state (if any) that other had prior to the call to swap. other has the shared state (if any) that *this had prior to the call to swap.

void set_value()

atomically stores the value r in the shared state and makes that state ready (30.6.4).

Exceptions
  • future_error: if its shared state already has a stored value. if shared state has no stored value exception is raised. promise_already_satisfied if its shared state already has a stored value or exception. no_state if *this has no shared state.

Private Types

template<>
using base_type = lcos::detail::promise_base<void, hpx::util::unused_type, lcos::detail::promise_data<void>>
template<typename R, typename Allocator>
struct uses_allocator<hpx::distributed::promise<R>, Allocator> : public true_type
#include <promise.hpp>

Requires: Allocator shall be an allocator (17.6.3.5)

namespace hpx
namespace distributed

Functions

template<typename Result, typename RemoteResult>
void swap(promise<Result, RemoteResult> &x, promise<Result, RemoteResult> &y)
template<>
class promise<void, hpx::util::unused_type> : public lcos::detail::promise_base<void, hpx::util::unused_type, lcos::detail::promise_data<void>>

Public Functions

promise()

constructs a promise object and a shared state.

template<typename Allocator>
promise(std::allocator_arg_t, Allocator const &a)

constructs a promise object and a shared state. The constructor uses the allocator a to allocate the memory for the shared state.

promise(promise &&other)

constructs a new promise object and transfers ownership of the shared state of other (if any) to the newly- constructed object.

Post

other has no shared state.

~promise()

Abandons any shared state.

promise &operator=(promise &&other)

Abandons any shared state (30.6.4) and then as if promise(HPX_MOVE(other)).swap(*this).

Return

*this.

void swap(promise &other)

Exchanges the shared state of *this and other.

Post

*this has the shared state (if any) that other had prior to the call to swap. other has the shared state (if any) that *this had prior to the call to swap.

void set_value()

atomically stores the value r in the shared state and makes that state ready (30.6.4).

Exceptions
  • future_error: if its shared state already has a stored value. if shared state has no stored value exception is raised. promise_already_satisfied if its shared state already has a stored value or exception. no_state if *this has no shared state.

Private Types

template<>
using base_type = lcos::detail::promise_base<void, hpx::util::unused_type, lcos::detail::promise_data<void>>
namespace std
template<typename R, typename Allocator>
struct uses_allocator<hpx::distributed::promise<R>, Allocator> : public true_type
#include <promise.hpp>

Requires: Allocator shall be an allocator (17.6.3.5)