futures

The contents of this module can be included with the header hpx/modules/futures.hpp. These headers may be used by user-code but are not guaranteed stable (neither header location nor contents). You are using these at your own risk. If you wish to use non-public functionality from a module we strongly suggest only including the module header hpx/modules/futures.hpp, not the particular header in which the functionality you would like to use is defined. See Public API for a list of names that are part of the public HPX API.

Header hpx/futures/future.hpp

Defines

HPX_MAKE_EXCEPTIONAL_FUTURE(T, errorcode, f, msg)
namespace hpx
namespace lcos

Functions

template<typename R, typename U>
hpx::lcos::future<R> make_future(hpx::lcos::future<U> &&f)
template<typename R, typename U, typename Conv>
hpx::lcos::future<R> make_future(hpx::lcos::future<U> &&f, Conv &&conv)
template<typename R, typename U>
hpx::lcos::future<R> make_future(hpx::lcos::shared_future<U> f)
template<typename R, typename U, typename Conv>
hpx::lcos::future<R> make_future(hpx::lcos::shared_future<U> const &f, Conv &&conv)
template<typename R>
hpx::lcos::shared_future<R> make_shared_future(hpx::lcos::future<R> &&f)
template<typename R>
hpx::lcos::shared_future<R> &make_shared_future(hpx::lcos::shared_future<R> &f)
template<typename R>
hpx::lcos::shared_future<R> &&make_shared_future(hpx::lcos::shared_future<R> &&f)
template<typename R>
hpx::lcos::shared_future<R> const &make_shared_future(hpx::lcos::shared_future<R> const &f)
template<typename T, typename Allocator, typename ...Ts>
std::enable_if<std::is_constructible<T, Ts&&...>::value || std::is_void<T>::value, future<T>>::type make_ready_future_alloc(Allocator const &a, Ts&&... ts)
template<typename T, typename ...Ts>
std::enable_if<std::is_constructible<T, Ts&&...>::value || std::is_void<T>::value, future<T>>::type make_ready_future(Ts&&... ts)
template<int DeductionGuard = 0, typename Allocator, typename T>
future<typename hpx::util::decay_unwrap<T>::type> make_ready_future_alloc(Allocator const &a, T &&init)
template<int DeductionGuard = 0, typename T>
future<typename hpx::util::decay_unwrap<T>::type> make_ready_future(T &&init)
template<typename T>
future<T> make_exceptional_future(std::exception_ptr const &e)
template<typename T, typename E>
future<T> make_exceptional_future(E e)
template<int DeductionGuard = 0, typename T>
future<typename hpx::util::decay_unwrap<T>::type> make_ready_future_at(hpx::util::steady_time_point const &abs_time, T &&init)
template<int DeductionGuard = 0, typename T>
future<typename hpx::util::decay_unwrap<T>::type> make_ready_future_after(hpx::util::steady_duration const &rel_time, T &&init)
template<typename Allocator>
future<void> make_ready_future_alloc(Allocator const &a)
std::enable_if<std::is_void<T>::value, future<void>>::type make_ready_future()
std::enable_if<std::is_void<T>::value, future<void>>::type make_ready_future_at(hpx::util::steady_time_point const &abs_time)
std::enable_if<std::is_void<T>::value, future<void>>::type make_ready_future_after(hpx::util::steady_duration const &rel_time)
template<typename R>
class future : public hpx::lcos::detail::future_base<future<R>, R>
#include <future.hpp>

Public Types

typedef R result_type
typedef base_type::shared_state_type shared_state_type

Public Functions

future()
future(future &&other)
future(future<future> &&other)
future(future<shared_future<R>> &&other)
template<typename T>
future(future<T> &&other, typename std::enable_if<std::is_void<R>::value && !traits::is_future<T>::value, T>::type* = nullptr)
~future()
future &operator=(future &&other)
shared_future<R> share()
hpx::traits::future_traits<future>::result_type get()
hpx::traits::future_traits<future>::result_type get(error_code &ec)
template<typename F>
decltype(auto) then(F &&f, error_code &ec = throws)
template<typename T0, typename F>
decltype(auto) then(T0 &&t0, F &&f, error_code &ec = throws)
template<typename Allocator, typename F>
auto then_alloc(Allocator const &alloc, F &&f, error_code &ec = throws)

Private Types

typedef detail::future_base<future<R>, R> base_type

Private Functions

future(hpx::intrusive_ptr<shared_state_type> const &state)
future(hpx::intrusive_ptr<shared_state_type> &&state)
template<typename SharedState>
future(hpx::intrusive_ptr<SharedState> const &state)

Friends

friend hpx::lcos::hpx::traits::future_access
struct invalidate

Public Functions

template<>
invalidate(future &f)
template<>
~invalidate()

Public Members

template<>
future &f_
template<typename R>
class shared_future : public hpx::lcos::detail::future_base<shared_future<R>, R>
#include <future.hpp>

Public Types

typedef R result_type
typedef base_type::shared_state_type shared_state_type

Public Functions

shared_future()
shared_future(shared_future const &other)
shared_future(shared_future &&other)
shared_future(future<R> &&other)
shared_future(future<shared_future> &&other)
template<typename T>
shared_future(shared_future<T> const &other, typename std::enable_if<std::is_void<R>::value && !traits::is_future<T>::value, T>::type* = nullptr)
~shared_future()
shared_future &operator=(shared_future const &other)
shared_future &operator=(shared_future &&other)
hpx::traits::future_traits<shared_future>::result_type get() const
hpx::traits::future_traits<shared_future>::result_type get(error_code &ec) const
template<typename F>
decltype(auto) then(F &&f, error_code &ec = throws) const
template<typename T0, typename F>
decltype(auto) then(T0 &&t0, F &&f, error_code &ec = throws) const
template<typename Allocator, typename F>
auto then_alloc(Allocator const &alloc, F &&f, error_code &ec = throws)

Private Types

typedef detail::future_base<shared_future<R>, R> base_type

Private Functions

shared_future(hpx::intrusive_ptr<shared_state_type> const &state)
shared_future(hpx::intrusive_ptr<shared_state_type> &&state)
template<typename SharedState>
shared_future(hpx::intrusive_ptr<SharedState> const &state)

Friends

friend hpx::lcos::hpx::traits::future_access
namespace serialization

Functions

template<typename Archive, typename T>
void serialize(Archive &ar, ::hpx::lcos::future<T> &f, unsigned version)
template<typename Archive, typename T>
void serialize(Archive &ar, ::hpx::lcos::shared_future<T> &f, unsigned version)

Header hpx/futures/future_fwd.hpp

Header hpx/futures/futures_factory.hpp

namespace hpx
namespace lcos
namespace local
template<typename Result, bool Cancelable>
class futures_factory<Result(), Cancelable>
#include <futures_factory.hpp>

Public Functions

futures_factory()
template<typename Executor, typename F>
futures_factory(Executor &exec, F &&f)
template<typename Executor>
futures_factory(Executor &exec, Result (*f)())
template<typename F, typename Enable = typename std::enable_if<!std::is_same<typename hpx::util::decay<F>::type, futures_factory>::value>::type>
futures_factory(F &&f)
futures_factory(Result (*f)())
~futures_factory()
futures_factory(futures_factory const &rhs)
futures_factory &operator=(futures_factory const &rhs)
futures_factory(futures_factory &&rhs)
futures_factory &operator=(futures_factory &&rhs)
void operator()() const
threads::thread_id_type apply(const char *annotation = "futures_factory::apply", launch policy = launch::async, threads::thread_priority priority = threads::thread_priority_default, threads::thread_stacksize stacksize = threads::thread_stacksize_default, threads::thread_schedule_hint schedulehint = threads::thread_schedule_hint(), error_code &ec = throws) const
threads::thread_id_type apply(threads::thread_pool_base *pool, const char *annotation = "futures_factory::apply", launch policy = launch::async, threads::thread_priority priority = threads::thread_priority_default, threads::thread_stacksize stacksize = threads::thread_stacksize_default, threads::thread_schedule_hint schedulehint = threads::thread_schedule_hint(), error_code &ec = throws) const
lcos::future<Result> get_future(error_code &ec = throws)
bool valid() const
void set_exception(std::exception_ptr const &e)

Protected Types

typedef lcos::detail::task_base<Result> task_impl_type

Protected Attributes

hpx::intrusive_ptr<task_impl_type> task_
bool future_obtained_

Header hpx/futures/packaged_continuation.hpp

Header hpx/futures/traits/acquire_future.hpp

namespace hpx
namespace traits
struct acquire_future_disp
#include <acquire_future.hpp>

Public Functions

template<typename T>
acquire_future<T>::type operator()(T &&t) const

Header hpx/futures/traits/acquire_shared_state.hpp

namespace hpx
namespace traits
struct acquire_shared_state_disp
#include <acquire_shared_state.hpp>

Public Functions

template<typename T>
acquire_shared_state<T>::type operator()(T &&t) const

Header hpx/futures/traits/future_access.hpp

template<typename R>
struct future_access<lcos::future<R>>
#include <future_access.hpp>

Public Static Functions

template<typename SharedState>
static lcos::future<R> create(hpx::intrusive_ptr<SharedState> const &shared_state)
template<typename T = void>
static lcos::future<R> create(typename detail::shared_state_ptr_for<lcos::future<lcos::future<R>>>::type const &shared_state)
template<typename SharedState>
static lcos::future<R> create(hpx::intrusive_ptr<SharedState> &&shared_state)
template<typename T = void>
static lcos::future<R> create(typename detail::shared_state_ptr_for<lcos::future<lcos::future<R>>>::type &&shared_state)
template<typename SharedState>
static lcos::future<R> create(SharedState *shared_state, bool addref = true)
static traits::detail::shared_state_ptr<R>::type const &get_shared_state(lcos::future<R> const &f)
static traits::detail::shared_state_ptr<R>::type::element_type *detach_shared_state(lcos::future<R> &&f)
template<typename R>
struct future_access<lcos::shared_future<R>>
#include <future_access.hpp>

Public Static Functions

template<typename SharedState>
static lcos::shared_future<R> create(hpx::intrusive_ptr<SharedState> const &shared_state)
template<typename T = void>
static lcos::shared_future<R> create(typename detail::shared_state_ptr_for<lcos::shared_future<lcos::future<R>>>::type const &shared_state)
template<typename SharedState>
static lcos::shared_future<R> create(hpx::intrusive_ptr<SharedState> &&shared_state)
template<typename T = void>
static lcos::shared_future<R> create(typename detail::shared_state_ptr_for<lcos::shared_future<lcos::future<R>>>::type &&shared_state)
template<typename SharedState>
static lcos::shared_future<R> create(SharedState *shared_state, bool addref = true)
static traits::detail::shared_state_ptr<R>::type const &get_shared_state(lcos::shared_future<R> const &f)
static traits::detail::shared_state_ptr<R>::type::element_type *detach_shared_state(lcos::shared_future<R> const &f)
namespace hpx
namespace traits
template<typename R>
struct future_access<lcos::future<R>>
#include <future_access.hpp>

Public Static Functions

template<typename SharedState>
static lcos::future<R> create(hpx::intrusive_ptr<SharedState> const &shared_state)
template<typename T = void>
static lcos::future<R> create(typename detail::shared_state_ptr_for<lcos::future<lcos::future<R>>>::type const &shared_state)
template<typename SharedState>
static lcos::future<R> create(hpx::intrusive_ptr<SharedState> &&shared_state)
template<typename T = void>
static lcos::future<R> create(typename detail::shared_state_ptr_for<lcos::future<lcos::future<R>>>::type &&shared_state)
template<typename SharedState>
static lcos::future<R> create(SharedState *shared_state, bool addref = true)
static traits::detail::shared_state_ptr<R>::type const &get_shared_state(lcos::future<R> const &f)
static traits::detail::shared_state_ptr<R>::type::element_type *detach_shared_state(lcos::future<R> &&f)
template<typename R>
struct future_access<lcos::shared_future<R>>
#include <future_access.hpp>

Public Static Functions

template<typename SharedState>
static lcos::shared_future<R> create(hpx::intrusive_ptr<SharedState> const &shared_state)
template<typename T = void>
static lcos::shared_future<R> create(typename detail::shared_state_ptr_for<lcos::shared_future<lcos::future<R>>>::type const &shared_state)
template<typename SharedState>
static lcos::shared_future<R> create(hpx::intrusive_ptr<SharedState> &&shared_state)
template<typename T = void>
static lcos::shared_future<R> create(typename detail::shared_state_ptr_for<lcos::shared_future<lcos::future<R>>>::type &&shared_state)
template<typename SharedState>
static lcos::shared_future<R> create(SharedState *shared_state, bool addref = true)
static traits::detail::shared_state_ptr<R>::type const &get_shared_state(lcos::shared_future<R> const &f)
static traits::detail::shared_state_ptr<R>::type::element_type *detach_shared_state(lcos::shared_future<R> const &f)

Header hpx/futures/traits/future_then_result.hpp

Header hpx/futures/traits/future_traits.hpp

template<typename R>
struct future_traits<lcos::future<R>>
#include <future_traits.hpp>

Public Types

typedef R type
typedef R result_type
template<typename R>
struct future_traits<lcos::shared_future<R>>
#include <future_traits.hpp>

Public Types

typedef R type
typedef R const &result_type
template<>
struct future_traits<lcos::shared_future<void>>
#include <future_traits.hpp>

Public Types

typedef void type
typedef void result_type
namespace hpx
namespace traits
template<typename R>
struct future_traits<lcos::future<R>>
#include <future_traits.hpp>

Public Types

typedef R type
typedef R result_type
template<typename R>
struct future_traits<lcos::shared_future<R>>
#include <future_traits.hpp>

Public Types

typedef R type
typedef R const &result_type
template<>
struct future_traits<lcos::shared_future<void>>
#include <future_traits.hpp>

Public Types

typedef void type
typedef void result_type

Header hpx/futures/traits/get_remote_result.hpp

namespace hpx
namespace traits
template<typename Result, typename RemoteResult, typename Enable = void>
struct get_remote_result
#include <get_remote_result.hpp>

Public Static Functions

static Result call(RemoteResult const &rhs)
static Result call(RemoteResult &&rhs)
template<typename Result>
struct get_remote_result<Result, Result>
#include <get_remote_result.hpp>

Public Static Functions

static Result const &call(Result const &rhs)
static Result &&call(Result &&rhs)

Header hpx/futures/traits/is_future.hpp

namespace hpx
namespace traits
template<typename Future>
struct is_future : public hpx::traits::detail::is_future_customization_point<Future>
#include <is_future.hpp>

Subclassed by hpx::traits::is_ref_wrapped_future< std::reference_wrapper< Future > >

Header hpx/futures/traits/is_future_range.hpp

namespace hpx
namespace traits
template<typename R>
struct future_range_traits<R, true>
#include <is_future_range.hpp>

Public Types

typedef range_traits<R>::value_type future_type

Header hpx/futures/traits/is_future_tuple.hpp

Header hpx/futures/traits/promise_local_result.hpp

template<>
struct promise_local_result<util::unused_type>
#include <promise_local_result.hpp>

Public Types

typedef void type
namespace hpx
namespace traits
template<typename Result, typename Enable = void>
struct promise_local_result
#include <promise_local_result.hpp>

Public Types

typedef Result type
template<>
struct promise_local_result<util::unused_type>
#include <promise_local_result.hpp>

Public Types

typedef void type

Header hpx/futures/traits/promise_remote_result.hpp

namespace hpx
namespace traits
template<typename Result, typename Enable = void>
struct promise_remote_result
#include <promise_remote_result.hpp>

Public Types

typedef Result type
template<>
struct promise_remote_result<void>
#include <promise_remote_result.hpp>

Public Types

typedef hpx::util::unused_type type