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.
Defines
-
HPX_MAKE_EXCEPTIONAL_FUTURE
(T, errorcode, f, msg)¶
-
namespace
hpx
-
namespace
lcos
Functions
-
template<typename
R
, typenameU
, typenameConv
>
hpx::lcos::future<R>make_future
(hpx::lcos::future<U> &&f, Conv &&conv)¶
-
template<typename
T
, typenameAllocator
, typename ...Ts
>
std::enable_if<std::is_constructible<T, Ts&&...>::value || std::is_void<T>::value, future<T>>::typemake_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>>::typemake_ready_future
(Ts&&... ts)¶
-
template<int
DeductionGuard
= 0, typenameAllocator
, typenameT
>
future<typename hpx::util::decay_unwrap<T>::type>make_ready_future_alloc
(Allocator const &a, T &&init)¶
-
template<int
DeductionGuard
= 0, typenameT
>
future<typename hpx::util::decay_unwrap<T>::type>make_ready_future
(T &&init)¶
-
template<int
DeductionGuard
= 0, typenameT
>
future<typename hpx::util::decay_unwrap<T>::type>make_ready_future_at
(hpx::chrono::steady_time_point const &abs_time, T &&init)¶
-
template<int
DeductionGuard
= 0, typenameT
>
future<typename hpx::util::decay_unwrap<T>::type>make_ready_future_after
(hpx::chrono::steady_duration const &rel_time, T &&init)¶
-
future<void>
make_ready_future
()¶
-
future<void>
make_ready_future_at
(hpx::chrono::steady_time_point const &abs_time)¶
-
future<void>
make_ready_future_after
(hpx::chrono::steady_duration const &rel_time)¶
-
template<typename
R
>
classfuture
: public hpx::lcos::detail::future_base<future<R>, R>¶ -
Public Functions
-
future
()¶
-
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)¶
-
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
, typenameF
>
decltype(auto)then
(T0 &&t0, F &&f, error_code &ec = throws)¶
-
template<typename
Allocator
, typenameF
>
autothen_alloc
(Allocator const &alloc, F &&f, error_code &ec = throws)¶
Private Types
-
template<>
usingbase_type
= detail::future_base<future<R>, R>¶
Private Functions
Friends
-
friend
hpx::lcos::hpx::traits::future_access
-
Public Types
Public Functions
Private Types
Private Functions
Friends
-
friend
hpx::lcos::hpx::traits::future_access
-
friend
-
template<typename
-
namespace
serialization
-
namespace
-
namespace
hpx
-
namespace
lcos
-
namespace
local
-
template<typename
Result
, boolCancelable
>
classfutures_factory
<Result(), Cancelable>¶ Public Functions
-
futures_factory
()¶
-
template<typename
F
, typenameEnable
= typename std::enable_if<!std::is_same<typename std::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¶
-
-
template<typename
-
namespace
-
namespace
-
namespace
hpx
-
namespace
lcos
-
namespace
local
-
-
template<typename
R
>
classpromise
: public hpx::lcos::local::detail::promise_base<R>¶ Public Functions
-
promise
()¶
-
~promise
()¶
-
promise &
operator=
(promise &&other)¶
-
void
swap
(promise &other)¶
-
void
set_value
(R const &r)¶
-
void
set_value
(R &&r)¶
Private Types
-
template<>
usingbase_type
= detail::promise_base<R>¶
-
-
template<typename
R
>
classpromise
<R&> : public hpx::lcos::local::detail::promise_base<R&>¶ Public Functions
-
promise
()
-
promise
(promise &&other)
-
~promise
()
-
promise &
operator=
(promise &&other)
-
void
swap
(promise &other)
-
void
set_value
(R &r)¶
Private Types
-
template<>
usingbase_type
= detail::promise_base<R&>¶
-
-
template<typename
-
namespace
-
namespace
-
namespace
hpx
-
namespace
traits
-
struct
acquire_future_disp
¶
-
struct
-
namespace
-
namespace
hpx
-
namespace
traits
Public Functions
-
namespace
-
template<typename
R
>
structfuture_access
<lcos::future<R>>¶ Public Static Functions
-
template<typename
Destination
>
static voidtransfer_result
(lcos::future<R> &&src, Destination &dest)¶
Private Static Functions
-
template<typename
Destination
>
static voidtransfer_result_impl
(lcos::future<R> &&src, Destination &dest, std::false_type)¶
-
template<typename
Destination
>
static voidtransfer_result_impl
(lcos::future<R> &&src, Destination &dest, std::true_type)¶
-
template<typename
Public Static Functions
Private Static Functions
-
namespace
hpx
-
namespace
traits
-
template<typename
R
>
structfuture_access
<lcos::future<R>> 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
(detail::shared_state_ptr_for_t<lcos::future<lcos::future<R>>> 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
(detail::shared_state_ptr_for_t<lcos::future<lcos::future<R>>> &&shared_state)
-
template<typename
SharedState
>
static lcos::future<R>create
(SharedState *shared_state, bool addref = true)
-
static traits::detail::shared_state_ptr_t<R>::element_type *
detach_shared_state
(lcos::future<R> &&f)
-
template<typename
Destination
>
static voidtransfer_result
(lcos::future<R> &&src, Destination &dest)
Private Static Functions
-
template<typename
Destination
>
static voidtransfer_result_impl
(lcos::future<R> &&src, Destination &dest, std::false_type)
-
template<typename
Destination
>
static voidtransfer_result_impl
(lcos::future<R> &&src, Destination &dest, std::true_type)
-
template<typename
-
template<typename
R
>
structfuture_access
<lcos::shared_future<R>> 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
(detail::shared_state_ptr_for_t<lcos::shared_future<lcos::future<R>>> 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
(detail::shared_state_ptr_for_t<lcos::shared_future<lcos::future<R>>> &&shared_state)
-
template<typename
SharedState
>
static lcos::shared_future<R>create
(SharedState *shared_state, bool addref = true)
-
static traits::detail::shared_state_ptr_t<R> const &
get_shared_state
(lcos::shared_future<R> const &f)
-
static traits::detail::shared_state_ptr_t<R>::element_type *
detach_shared_state
(lcos::shared_future<R> const &f)
-
template<typename
Destination
>
static voidtransfer_result
(lcos::shared_future<R> &&src, Destination &dest)
Private Static Functions
-
template<typename
Destination
>
static voidtransfer_result_impl
(lcos::shared_future<R> &&src, Destination &dest, std::false_type)
-
template<typename
Destination
>
static voidtransfer_result_impl
(lcos::shared_future<R> &&src, Destination &dest, std::true_type)
-
template<typename
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
traits
-
namespace
Public Types
Public Types
-
namespace
hpx
-
namespace
traits
-
-
template<typename
R
>
structfuture_traits
<lcos::future<R>> Public Types
-
template<>
usingtype
= R
-
template<>
usingresult_type
= R
-
template<>
-
template<typename
R
>
structfuture_traits
<lcos::shared_future<R>> Public Types
-
template<>
usingtype
= R
-
template<>
usingresult_type
= R const&
-
template<>
-
template<>
structfuture_traits
<lcos::shared_future<void>> Public Types
-
template<>
usingtype
= void
-
template<>
usingresult_type
= void
-
template<>
-
template<typename
-
namespace
-
namespace
hpx
-
namespace
hpx
-
namespace
traits
Variables
-
template<typename R>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_future_v = is_future<R>::value
-
template<typename R>HPX_INLINE_CONSTEXPR_VARIABLE bool hpx::traits::is_ref_wrapped_future_v=is_ref_wrapped_future<R>::value
-
-
namespace
-
namespace
hpx
-
template<>
structpromise_local_result
<util::unused_type>¶ Public Types
-
typedef void
type
-
typedef void
-
namespace
hpx
-
namespace
traits
-
template<typename
Result
, typenameEnable
= void>
structpromise_local_result
¶ Public Types
-
typedef Result
type
-
typedef Result
-
template<>
structpromise_local_result
<util::unused_type> Public Types
-
typedef void
type
-
typedef void
-
template<typename
-
namespace