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 hpx::distributed::promise<void, hpx::util::unused_type> : public lcos::detail::promise_base<void, hpx::util::unused_type, lcos::detail::promise_data<void>>#

Public Functions

promise() = default#

constructs a promise object and a shared state.

template<typename Allocator>
inline 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) noexcept = default#

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() = default#

Abandons any shared state.

promise &operator=(promise &&other) noexcept = default#

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

Returns

*this.

inline void swap(promise &other) noexcept#

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.

inline void set_value()#

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

Throws

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

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) noexcept#
template<typename Result, typename RemoteResult>
class promise
#include <promise.hpp>
template<> unused_type > : public lcos::detail::promise_base< void, hpx::util::unused_type, lcos::detail::promise_data< void > >

Public Functions

promise() = default#

constructs a promise object and a shared state.

template<typename Allocator>
inline 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) noexcept = default#

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() = default#

Abandons any shared state.

promise &operator=(promise &&other) noexcept = default#

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

Returns

*this.

inline void swap(promise &other) noexcept#

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.

inline void set_value()#

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

Throws

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

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

Requires: Allocator shall be an allocator (17.6.3.5)