execution_base

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

namespace hpx
namespace execution_base
struct agent_base

Public Functions

virtual ~agent_base()
virtual std::string description() const = 0
virtual context_base const &context() const = 0
virtual void yield(char const *desc) = 0
virtual void yield_k(std::size_t k, char const *desc) = 0
virtual void suspend(char const *desc) = 0
virtual void resume(char const *desc) = 0
virtual void abort(char const *desc) = 0
virtual void sleep_for(hpx::chrono::steady_duration const &sleep_duration, char const *desc) = 0
virtual void sleep_until(hpx::chrono::steady_time_point const &sleep_time, char const *desc) = 0
namespace hpx
namespace execution_base
class agent_ref

Public Functions

constexpr agent_ref()
constexpr agent_ref(agent_base *impl)
constexpr agent_ref(agent_ref const&)
constexpr agent_ref &operator=(agent_ref const&)
constexpr agent_ref(agent_ref&&)
constexpr agent_ref &operator=(agent_ref&&)
constexpr operator bool() const
void reset(agent_base *impl = nullptr)
void yield(char const *desc = "hpx::execution_base::agent_ref::yield")
void yield_k(std::size_t k, char const *desc = "hpx::execution_base::agent_ref::yield_k")
void suspend(char const *desc = "hpx::execution_base::agent_ref::suspend")
void resume(char const *desc = "hpx::execution_base::agent_ref::resume")
void abort(char const *desc = "hpx::execution_base::agent_ref::abort")
template<typename Rep, typename Period>
void sleep_for(std::chrono::duration<Rep, Period> const &sleep_duration, char const *desc = "hpx::execution_base::agent_ref::sleep_for")
template<typename Clock, typename Duration>
void sleep_until(std::chrono::time_point<Clock, Duration> const &sleep_time, char const *desc = "hpx::execution_base::agent_ref::sleep_until")
agent_base &ref()

Private Functions

void sleep_for(hpx::chrono::steady_duration const &sleep_duration, char const *desc)
void sleep_until(hpx::chrono::steady_time_point const &sleep_time, char const *desc)

Private Members

agent_base *impl_

Friends

friend constexpr bool operator==(agent_ref const &lhs, agent_ref const &rhs)
friend constexpr bool operator!=(agent_ref const &lhs, agent_ref const &rhs)
std::ostream &operator<<(std::ostream&, agent_ref const&)
namespace hpx
namespace execution
namespace experimental
template<typename ...Ts>
class any_sender : private hpx::execution::experimental::detail::any_sender_static_empty_vtable_helper<Ts...>

Public Functions

any_sender()
template<typename Sender, typename = std::enable_if_t<!std::is_same_v<std::decay_t<Sender>, any_sender>>>
any_sender(Sender &&sender)
template<typename Sender, typename = std::enable_if_t<!std::is_same_v<std::decay_t<Sender>, any_sender>>>
any_sender &operator=(Sender &&sender)
~any_sender()
any_sender(any_sender&&)
any_sender(any_sender const&)
any_sender &operator=(any_sender&&)
any_sender &operator=(any_sender const&)

Private Types

template<>
using base_type = detail::any_sender_base<Ts...>
template<typename Sender>
using impl_type = detail::any_sender_impl<Sender, Ts...>
template<>
using storage_type = hpx::detail::copyable_sbo_storage<base_type, 4 * sizeof(void*)>

Private Members

storage_type storage = {}

Friends

template<typename Env>
auto tag_invoke(get_completion_signatures_t, any_sender const&, Env)
template<typename R>
detail::any_operation_state tag_invoke(hpx::execution::experimental::connect_t, any_sender &s, R &&r)
template<typename R>
detail::any_operation_state tag_invoke(hpx::execution::experimental::connect_t, any_sender &&s, R &&r)
template<typename ...Ts>
class unique_any_sender : private hpx::execution::experimental::detail::any_sender_static_empty_vtable_helper<Ts...>

Public Functions

unique_any_sender()
template<typename Sender, typename = std::enable_if_t<!std::is_same_v<std::decay_t<Sender>, unique_any_sender>>>
unique_any_sender(Sender &&sender)
template<typename Sender, typename = std::enable_if_t<!std::is_same_v<std::decay_t<Sender>, unique_any_sender>>>
unique_any_sender &operator=(Sender &&sender)
~unique_any_sender()
unique_any_sender(unique_any_sender&&)
unique_any_sender(unique_any_sender const&)
unique_any_sender &operator=(unique_any_sender&&)
unique_any_sender &operator=(unique_any_sender const&)

Private Types

template<>
using base_type = detail::unique_any_sender_base<Ts...>
template<typename Sender>
using impl_type = detail::unique_any_sender_impl<Sender, Ts...>
template<>
using storage_type = hpx::detail::movable_sbo_storage<base_type, 4 * sizeof(void*)>

Private Members

storage_type storage = {}

Friends

template<typename Env>
auto tag_invoke(get_completion_signatures_t, unique_any_sender const&, Env)
template<typename R>
detail::any_operation_state tag_invoke(hpx::execution::experimental::connect_t, unique_any_sender &&s, R &&r)
namespace hpx
namespace execution
namespace experimental

Variables

template<typename CPO>
constexpr get_completion_scheduler_t<CPO> get_completion_scheduler = {}
namespace hpx
namespace execution
namespace experimental

Typedefs

template<typename ...Signatures>
using completion_signatures = meta::type<detail::generate_completion_signatures<meta::pack<Signatures...>>>
template<typename Env>
using dependent_completion_signatures = detail::dependent_completion_signatures<Env>
template<typename Sender, typename Env = no_env>
using completion_signatures_of_t = detail::completion_signatures_of<Sender, Env>
template<typename Sender, typename Env = no_env, template<typename...> typename Tuple = detail::decayed_tuple, template<typename...> typename Variant = detail::decayed_variant, typename = std::enable_if_t<is_sender_v<Sender, Env>>>
using value_types_of_t = detail::value_types_from<detail::completion_signatures_of<Sender, Env>, meta::func<Tuple>, meta::func<Variant>>
template<typename Sender, typename Env = no_env, template<typename...> typename Variant = detail::decayed_variant, typename = std::enable_if_t<is_sender_v<Sender, Env>>>
using error_types_of_t = detail::error_types_from<detail::completion_signatures_of<Sender, Env>, meta::func<Variant>>
template<typename Sender, typename Env = no_env, typename AddlSignatures = completion_signatures<>, template<typename...> typename SetValue = detail::set_value_signature, template<typename> typename SetError = detail::set_error_signature, bool SendsStopped = completion_signatures_of_t<Sender, Env>::sends_stopped, typename = std::enable_if_t<is_sender_v<Sender, Env>>>
using make_completion_signatures = meta::type<detail::make_helper<Sender, Env, AddlSignatures, meta::func<SetValue>, meta::func1<SetError>, SendsStopped>>

Variables

hpx::execution::experimental::get_completion_signatures_t get_completion_signatures
template<typename Sender, typename Env = empty_env>
constexpr bool is_sender_v = is_sender<Sender, Env>::value
template<typename Sender, typename Receiver>
constexpr bool is_sender_to_v = is_sender_to<Sender, Receiver>::value
template<typename Sender, typename Env = no_env, typename = std::enable_if_t<is_sender_v<Sender, Env>>>
constexpr bool sends_stopped_of_v = meta::value<detail::sends_stopped_from<detail::completion_signatures_of<Sender, Env>>>
struct empty_variant

Public Functions

empty_variant()
struct get_completion_signatures_t : public hpx::functional::detail::tag_fallback<get_completion_signatures_t>

Friends

template<typename Sender, typename Env = no_env>
friend constexpr auto tag_fallback_invoke(get_completion_signatures_t, Sender&&, Env const& = {})
namespace hpx
namespace execution_base
struct context_base

Public Functions

virtual ~context_base()
virtual resource_base const &resource() const = 0
namespace hpx

Variables

hpx::sync_execute_t sync_execute
hpx::async_execute_t async_execute
hpx::then_execute_t then_execute
hpx::post_t post
hpx::bulk_sync_execute_t bulk_sync_execute
hpx::bulk_async_execute_t bulk_async_execute
hpx::bulk_then_execute_t bulk_then_execute
struct async_execute_t : public hpx::functional::detail::tag_fallback<async_execute_t>
#include <execution.hpp>

Customization point for asynchronous execution agent creation.

This asynchronously creates a single function invocation f() using the associated executor.

Note

Executors have to implement only async_execute(). All other functions will be emulated by this or other customization points in terms of this single basic primitive. However, some executors will naturally specialize all operations for maximum efficiency.

Note

This is valid for one way executors (calls make_ready_future(exec.sync_execute(f, ts…) if it exists) and for two way executors (calls exec.async_execute(f, ts…) if it exists).

Return

f(ts…)’s result through a future

Parameters
  • exec: [in] The executor object to use for scheduling of the function f.

  • f: [in] The function which will be scheduled using the given executor.

  • ts: [in] Additional arguments to use to invoke f.

Private Functions

template<typename Executor, typename F, typename ...Ts>
decltype(auto) friend tag_fallback_invoke(async_execute_t, Executor &&exec, F &&f, Ts&&... ts)
struct bulk_async_execute_t : public hpx::functional::detail::tag_fallback<bulk_async_execute_t>
#include <execution.hpp>

Bulk form of asynchronous execution agent creation.

This asynchronously creates a group of function invocations f(i) whose ordering is given by the execution_category associated with the executor.

Note

This is deliberately different from the bulk_async_execute customization points specified in P0443.The bulk_async_execute customization point defined here is more generic and is used as the workhorse for implementing the specified APIs.

Here i takes on all values in the index space implied by shape. All exceptions thrown by invocations of f(i) are reported in a manner consistent with parallel algorithm execution through the returned future.

Return

The return type of executor_type::bulk_async_execute if defined by executor_type. Otherwise a vector of futures holding the returned values of each invocation of f.

Note

This calls exec.bulk_async_execute(f, shape, ts…) if it exists; otherwise it executes async_execute(f, shape, ts…) as often as needed.

Parameters
  • exec: [in] The executor object to use for scheduling of the function f.

  • f: [in] The function which will be scheduled using the given executor.

  • shape: [in] The shape objects which defines the iteration boundaries for the arguments to be passed to f.

  • ts: [in] Additional arguments to use to invoke f.

Private Functions

template<typename Executor, typename F, typename Shape, typename ...Ts>
decltype(auto) friend tag_fallback_invoke(bulk_async_execute_t, Executor &&exec, F &&f, Shape const &shape, Ts&&... ts)
template<typename Executor, typename F, typename Shape, typename ...Ts>
decltype(auto) friend tag_fallback_invoke(bulk_async_execute_t, Executor &&exec, F &&f, Shape const &shape, Ts&&... ts)
struct bulk_sync_execute_t : public hpx::functional::detail::tag_fallback<bulk_sync_execute_t>
#include <execution.hpp>

Bulk form of synchronous execution agent creation.

This synchronously creates a group of function invocations f(i) whose ordering is given by the execution_category associated with the executor. The function synchronizes the execution of all scheduled functions with the caller.

Note

This is deliberately different from the bulk_sync_execute customization points specified in P0443.The bulk_sync_execute customization point defined here is more generic and is used as the workhorse for implementing the specified APIs.

Here i takes on all values in the index space implied by shape. All exceptions thrown by invocations of f(i) are reported in a manner consistent with parallel algorithm execution through the returned future.

Return

The return type of executor_type::bulk_sync_execute if defined by executor_type. Otherwise a vector holding the returned values of each invocation of f except when f returns void, which case void is returned.

Note

This calls exec.bulk_sync_execute(f, shape, ts…) if it exists; otherwise it executes sync_execute(f, shape, ts…) as often as needed.

Parameters
  • exec: [in] The executor object to use for scheduling of the function f.

  • f: [in] The function which will be scheduled using the given executor.

  • shape: [in] The shape objects which defines the iteration boundaries for the arguments to be passed to f.

  • ts: [in] Additional arguments to use to invoke f.

Private Functions

template<typename Executor, typename F, typename Shape, typename ...Ts>
decltype(auto) friend tag_fallback_invoke(bulk_sync_execute_t, Executor &&exec, F &&f, Shape const &shape, Ts&&... ts)
template<typename Executor, typename F, typename Shape, typename ...Ts>
decltype(auto) friend tag_fallback_invoke(bulk_sync_execute_t, Executor &&exec, F &&f, Shape const &shape, Ts&&... ts)
struct bulk_then_execute_t : public hpx::functional::detail::tag_fallback<bulk_then_execute_t>
#include <execution.hpp>

Bulk form of execution agent creation depending on a given future.

This creates a group of function invocations f(i) whose ordering is given by the execution_category associated with the executor.

Note

This is deliberately different from the then_sync_execute customization points specified in P0443.The bulk_then_execute customization point defined here is more generic and is used as the workhorse for implementing the specified APIs.

Here i takes on all values in the index space implied by shape. All exceptions thrown by invocations of f(i) are reported in a manner consistent with parallel algorithm execution through the returned future.

Return

The return type of executor_type::bulk_then_execute if defined by executor_type. Otherwise a vector holding the returned values of each invocation of f.

Note

This calls exec.bulk_then_execute(f, shape, pred, ts…) if it exists; otherwise it executes sync_execute(f, shape, pred.share(), ts…) (if this executor is also an OneWayExecutor), or async_execute(f, shape, pred.share(), ts…) (if this executor is also a TwoWayExecutor) - as often as needed.

Parameters
  • exec: [in] The executor object to use for scheduling of the function f.

  • f: [in] The function which will be scheduled using the given executor.

  • shape: [in] The shape objects which defines the iteration boundaries for the arguments to be passed to f.

  • predecessor: [in] The future object the execution of the given function depends on.

  • ts: [in] Additional arguments to use to invoke f.

Private Functions

template<typename Executor, typename F, typename Shape, typename Future, typename ...Ts>
decltype(auto) friend tag_fallback_invoke(bulk_then_execute_t, Executor &&exec, F &&f, Shape const &shape, Future &&predecessor, Ts&&... ts)
template<typename Executor, typename F, typename Shape, typename Future, typename ...Ts>
decltype(auto) friend tag_fallback_invoke(bulk_then_execute_t, Executor &&exec, F &&f, Shape const &shape, Future &&predecessor, Ts&&... ts)
struct post_t : public hpx::functional::detail::tag_fallback<post_t>
#include <execution.hpp>

Customization point for asynchronous fire & forget execution agent creation.

This asynchronously (fire & forget) creates a single function invocation f() using the associated executor.

Note

This is valid for two way executors (calls exec.post(f, ts…), if available, otherwise it calls exec.async_execute(f, ts…) while discarding the returned future), and for non-blocking two way executors (calls exec.post(f, ts…) if it exists).

Parameters
  • exec: [in] The executor object to use for scheduling of the function f.

  • f: [in] The function which will be scheduled using the given executor.

  • ts: [in] Additional arguments to use to invoke f.

Private Functions

template<typename Executor, typename F, typename ...Ts>
decltype(auto) friend tag_fallback_invoke(post_t, Executor &&exec, F &&f, Ts&&... ts)
struct sync_execute_t : public hpx::functional::detail::tag_fallback<sync_execute_t>
#include <execution.hpp>

Customization point for synchronous execution agent creation.

This synchronously creates a single function invocation f() using the associated executor. The execution of the supplied function synchronizes with the caller

Return

f(ts…)’s result

Note

This is valid for one way executors only, it will call exec.sync_execute(f, ts…) if it exists.

Parameters
  • exec: [in] The executor object to use for scheduling of the function f.

  • f: [in] The function which will be scheduled using the given executor.

  • ts: [in] Additional arguments to use to invoke f.

Private Functions

template<typename Executor, typename F, typename ...Ts>
decltype(auto) friend tag_fallback_invoke(sync_execute_t, Executor &&exec, F &&f, Ts&&... ts)
struct then_execute_t : public hpx::functional::detail::tag_fallback<then_execute_t>
#include <execution.hpp>

Customization point for execution agent creation depending on a given future.

This creates a single function invocation f() using the associated executor after the given future object has become ready.

Return

f(ts…)’s result through a future

Note

This is valid for two way executors (calls exec.then_execute(f, predecessor, ts…) if it exists) and for one way executors (calls predecessor.then(bind(f, ts…))).

Parameters
  • exec: [in] The executor object to use for scheduling of the function f.

  • f: [in] The function which will be scheduled using the given executor.

  • predecessor: [in] The future object the execution of the given function depends on.

  • ts: [in] Additional arguments to use to invoke f.

Private Functions

template<typename Executor, typename F, typename Future, typename ...Ts>
decltype(auto) friend tag_fallback_invoke(then_execute_t, Executor &&exec, F &&f, Future &&predecessor, Ts&&... ts)
namespace execution
struct parallel_execution_tag
#include <execution.hpp>

Function invocations executed by a group of parallel execution agents execute in unordered fashion. Any such invocations executing in the same thread are indeterminately sequenced with respect to each other.

Note

parallel_execution_tag is weaker than sequenced_execution_tag.

struct sequenced_execution_tag
#include <execution.hpp>

Function invocations executed by a group of sequential execution agents execute in sequential order.

struct unsequenced_execution_tag
#include <execution.hpp>

Function invocations executed by a group of vector execution agents are permitted to execute in unordered fashion when executed in different threads, and un-sequenced with respect to one another when executed in the same thread.

Note

unsequenced_execution_tag is weaker than parallel_execution_tag.

namespace hpx
namespace execution
namespace experimental

Typedefs

template<typename T>
using env_of_t = decltype(get_env(std::declval<T>()))
template<typename Tag, typename Value, typename BaseEnv = empty_env>
using make_env_t = decltype(make_env<Tag>(std::declval<Value&&>(), std::declval<BaseEnv&&>()))

Variables

template<typename Env>
constexpr bool is_no_env_v = is_no_env<Env>::value
hpx::execution::experimental::get_env_t get_env
hpx::execution::experimental::forwarding_env_query_t forwarding_env_query
struct forwarding_env_query_t : public hpx::functional::detail::tag_fallback<forwarding_env_query_t>

Friends

template<typename T>
friend constexpr auto tag_fallback_invoke(forwarding_env_query_t, T&&)
struct get_env_t : public hpx::functional::detail::tag_fallback<get_env_t>

Friends

template<typename EnvProvider>
friend constexpr auto tag_fallback_invoke(get_env_t, EnvProvider&&)
namespace exec_envs

Variables

template<typename Tag>
constexpr exec_envs::make_env_t<Tag> make_env = {}
template<typename Tag, typename Value, typename BaseEnvId = meta::hidden<empty_env>>
struct env

Public Types

template<>
using BaseEnv = meta::type<BaseEnvId>

Public Members

HPX_NO_UNIQUE_ADDRESS util::unwrap_reference_t<Value> hpx::execution::experimental::exec_envs::env::value_
HPX_NO_UNIQUE_ADDRESS BaseEnv hpx::execution::experimental::exec_envs::env::base_env_ = {}

Friends

template<typename Tag2, typename ...Args, typename = std::enable_if_t<functional::is_tag_invocable_v<Tag2, BaseEnv const&, Args...>>>
friend constexpr auto tag_invoke(Tag2 tag, env const &self, Args&&... args)
template<typename ...Args>
friend constexpr auto tag_invoke(Tag, env const &self, Args&&...)
template<typename Tag>
struct make_env_t

Public Functions

template<typename Value>
constexpr auto operator()(Value &&value) const
template<typename Value, typename BaseEnv>
constexpr auto operator()(Value &&value, BaseEnv &&base_env) const
struct no_env

Friends

template<typename Tag, typename Env>
std::enable_if_t<std::is_same_v<no_env, std::decay_t<Env>>> tag_invoke(Tag, Env)
namespace hpx
namespace execution
namespace experimental

Functions

template<typename O>
void start(O &&o)

start is a customization point object. The expression hpx::execution::experimental::start(r) is equivalent to:

  • r.start(), if that expression is valid. If the function selected does not signal the receiver r’s done channel, the program is ill-formed (no diagnostic required).

  • Otherwise, `start(r), if that expression is valid, with overload resolution performed in a context that include the declaration void start();

  • Otherwise, the expression is ill-formed.

The customization is implemented in terms of hpx::functional::tag_invoke.

Variables

hpx::execution::experimental::start_t start
template<typename O>
constexpr bool is_operation_state_v = meta::value<is_operation_state<O>>
template<typename O>
struct is_operation_state
#include <operation_state.hpp>

An operation_state is an object representing the asynchronous operation that has been returned from calling hpx::execution::experimental::connect with a sender and a receiver. The only operation on an operation_state is:

  • hpx::execution::experimental::start

hpx::execution::experimental::start can be called exactly once. Once it has been invoked, the caller needs to ensure that the receiver’s completion signaling operations strongly happen before the destructor of the state is called. The call to hpx::execution::experimental::start needs to happen strongly before the completion signaling operations.

namespace hpx
namespace execution
namespace experimental

Functions

template<typename R, typename ...As>
void set_value(R &&r, As&&... as)

set_value is a customization point object. The expression hpx::execution::set_value(r, as...) is equivalent to:

  • r.set_value(as...), if that expression is valid. If the function selected does not send the value(s) as... to the Receiver r’s value channel, the program is ill-formed (no diagnostic required).

  • Otherwise, `set_value(r, as…), if that expression is valid, with overload resolution performed in a context that include the declaration void set_value();

  • Otherwise, the expression is ill-formed.

The customization is implemented in terms of hpx::functional::tag_invoke.

template<typename R>
void set_stopped(R &&r)

set_stopped is a customization point object. The expression hpx::execution::set_stopped(r) is equivalent to:

  • r.set_stopped(), if that expression is valid. If the function selected does not signal the Receiver r’s done channel, the program is ill-formed (no diagnostic required).

  • Otherwise, `set_stopped(r), if that expression is valid, with overload resolution performed in a context that include the declaration void set_stopped();

  • Otherwise, the expression is ill-formed.

The customization is implemented in terms of hpx::functional::tag_invoke.

template<typename R, typename E>
void set_error(R &&r, E &&e)

set_error is a customization point object. The expression hpx::execution::set_error(r, e) is equivalent to:

  • r.set_stopped(e), if that expression is valid. If the function selected does not send the error e the Receiver r’s error channel, the program is ill-formed (no diagnostic required).

  • Otherwise, `set_error(r, e), if that expression is valid, with overload resolution performed in a context that include the declaration void set_error();

  • Otherwise, the expression is ill-formed.

The customization is implemented in terms of hpx::functional::tag_invoke.

Variables

hpx::execution::experimental::set_value_t set_value
hpx::execution::experimental::set_error_t set_error
hpx::execution::experimental::set_stopped_t set_stopped
template<typename T, typename E = std::exception_ptr>
constexpr bool is_receiver_v = is_receiver<T, E>::value
template<typename T, typename ...As>
constexpr bool is_receiver_of_v = is_receiver_of<T, As...>::value
template<typename T, typename ...As>
constexpr bool is_nothrow_receiver_of_v = is_nothrow_receiver_of<T, As...>::value
template<typename T, typename E>
struct is_receiver
#include <receiver.hpp>

Receiving values from asynchronous computations is handled by the Receiver concept. A Receiver needs to be able to receive an error or be marked as being canceled. As such, the Receiver concept is defined by having the following two customization points defined, which form the completion-signal operations:

  • hpx::execution::experimental::set_stopped

  • hpx::execution::experimental::set_error

Those two functions denote the completion-signal operations. The Receiver contract is as follows:

  • None of a Receiver’s completion-signal operation shall be invoked before hpx::execution::experimental::start has been called on the operation state object that was returned by connecting a Receiver to a sender hpx::execution::experimental::connect.

  • Once hpx::execution::start has been called on the operation state object, exactly one of the Receiver’s completion-signal operation shall complete without an exception before the Receiver is destroyed

Once one of the Receiver’s completion-signal operation has been completed without throwing an exception, the Receiver contract has been satisfied. In other words: The asynchronous operation has been completed.

See

hpx::execution::experimental::is_receiver_of

template<typename T, typename ...As>
struct is_receiver_of
#include <receiver.hpp>

The receiver_of concept is a refinement of the Receiver concept by requiring one additional completion-signal operation:

  • hpx::execution::set_value

This completion-signal operation adds the following to the Receiver’s contract:

  • If hpx::execution::set_value exits with an exception, it is still valid to call hpx::execution::set_error or hpx::execution::set_stopped

See

hpx::execution::traits::is_receiver

namespace hpx
namespace execution_base
struct resource_base
#include <resource_base.hpp>

TODO: implement, this is currently just a dummy.

Public Functions

virtual ~resource_base()
namespace hpx
namespace execution
namespace experimental

Typedefs

template<typename S, typename R>
using connect_result_t = hpx::util::invoke_result_t<connect_t, S, R>

Functions

template<typename S, typename R>
void connect(S &&s, R &&r)

connect is a customization point object. For some subexpression s and r, let S be the type such that decltype((s)) is S and let R be the type such that decltype((r)) is R. The result of the expression hpx::execution::experimental::connect(s, r) is then equivalent to:

  • s.connect(r), if that expression is valid and returns a type satisfying the operation_state (

    See

    hpx::execution::experimental::traits::is_operation_state) and if S satisfies the sender concept.

  • s.connect(r), if that expression is valid and returns a type satisfying the operation_state (

    See

    hpx::execution::experimental::traits::is_operation_state) and if S satisfies the sender concept. Overload resolution is performed in a context that include the declaration void connect();

  • Otherwise, the expression is ill-formed.

The customization is implemented in terms of hpx::functional::tag_invoke.

Variables

hpx::execution::experimental::connect_t connect
hpx::execution::experimental::schedule_t schedule
template<typename Scheduler>
constexpr bool is_scheduler_v = is_scheduler<Scheduler>::value
struct connect_t : public hpx::functional::tag<connect_t>
#include <sender.hpp>

The name schedule denotes a customization point object. For some subexpression s, let S be decltype((s)). The expression schedule(s) is expression-equivalent to:

* s.schedule(), if that expression is valid and its type models
  sender.
* Otherwise, schedule(s), if that expression is valid and its type
  models sender with overload resolution performed in a context that
  includes the declaration

      void schedule();

  and that does not include a declaration of schedule.

 * Otherwise, schedule(s) is ill-formed.

The customization is implemented in terms of hpx::functional::tag_invoke.

namespace hpx
namespace execution_base
namespace this_thread

Functions

hpx::execution_base::agent_ref agent()
void yield(char const *desc = "hpx::execution_base::this_thread::yield")
void yield_k(std::size_t k, char const *desc = "hpx::execution_base::this_thread::yield_k")
void suspend(char const *desc = "hpx::execution_base::this_thread::suspend")
template<typename Rep, typename Period>
void sleep_for(std::chrono::duration<Rep, Period> const &sleep_duration, char const *desc = "hpx::execution_base::this_thread::sleep_for")
template<class Clock, class Duration>
void sleep_until(std::chrono::time_point<Clock, Duration> const &sleep_time, char const *desc = "hpx::execution_base::this_thread::sleep_for")
struct reset_agent

Public Functions

reset_agent(detail::agent_storage*, agent_base &impl)
reset_agent(agent_base &impl)
~reset_agent()

Public Members

detail::agent_storage *storage_
agent_base *old_
namespace util

Functions

template<typename Predicate>
void yield_while(Predicate &&predicate, const char *thread_name = nullptr, bool allow_timed_suspension = true)
namespace hpx
namespace traits

Typedefs

template<typename T>
using is_one_way_executor_t = typename is_one_way_executor<T>::type
template<typename T>
using is_never_blocking_one_way_executor_t = typename is_never_blocking_one_way_executor<T>::type
template<typename T>
using is_bulk_one_way_executor_t = typename is_bulk_one_way_executor<T>::type
template<typename T>
using is_two_way_executor_t = typename is_two_way_executor<T>::type
template<typename T>
using is_bulk_two_way_executor_t = typename is_bulk_two_way_executor<T>::type
template<typename T>
using is_executor_any_t = typename is_executor_any<T>::type

Variables

template<typename T>
constexpr bool is_one_way_executor_v = is_one_way_executor<T>::value
template<typename T>
constexpr bool is_never_blocking_one_way_executor_v = is_never_blocking_one_way_executor<T>::value
template<typename T>
constexpr bool is_bulk_one_way_executor_v = is_bulk_one_way_executor<T>::value
template<typename T>
constexpr bool is_two_way_executor_v = is_two_way_executor<T>::value
template<typename T>
constexpr bool is_bulk_two_way_executor_v = is_bulk_two_way_executor<T>::value
template<typename T>
constexpr bool is_executor_any_v = is_executor_any<T>::value
template<typename Executor>
struct extract_executor_parameters<Executor, std::void_t<typename Executor::executor_parameters_type>>

Public Types

template<>
using type = typename Executor::executor_parameters_type
namespace hpx
namespace parallel
namespace execution

Typedefs

template<typename Executor>
using extract_executor_parameters_t = typename extract_executor_parameters<Executor>::type
template<typename T>
using is_executor_parameters_t = typename is_executor_parameters<T>::type

Variables

template<typename Parameters>
constexpr bool extract_has_variable_chunk_size_v = extract_has_variable_chunk_size<Parameters>::value
template<typename Parameters>
constexpr bool extract_invokes_testing_function_v = extract_invokes_testing_function<Parameters>::value
template<typename T>
constexpr bool is_executor_parameters_v = is_executor_parameters<T>::value
template<typename Executor, typename Enable = void>
struct extract_executor_parameters

Public Types

template<>
using type = sequential_executor_parameters
template<typename Executor>
struct extract_executor_parameters<Executor, std::void_t<typename Executor::executor_parameters_type>>

Public Types

template<>
using type = typename Executor::executor_parameters_type
namespace traits

Typedefs

template<typename T>
using is_executor_parameters_t = typename is_executor_parameters<T>::type

Variables

template<typename T>
constexpr bool is_executor_parameters_v = is_executor_parameters<T>::value

Functions

template<typename ExpectedValType, typename Env = hpx::execution::experimental::empty_env, typename Sender>
void check_value_types(Sender&&)
template<typename ExpectedErrorType, typename Env = hpx::execution::experimental::empty_env, typename Sender>
void check_error_types(Sender&&)
template<bool Expected, typename Env = hpx::execution::experimental::empty_env, typename Sender>
void check_sends_stopped(Sender&&)

Check that the sends_stopped of a sender matches the expected value.

struct void_sender

Friends

template<typename R>
operation_state<R> tag_invoke(hpx::execution::experimental::connect_t, void_sender, R &&r)
template<typename Env>
auto tag_invoke(hpx::execution::experimental::get_completion_signatures_t, void_sender const&, Env)
template<typename R>
struct operation_state

Public Members

std::decay_t<R> r

Friends

void tag_invoke(hpx::execution::experimental::start_t, operation_state &os)
template<typename ...Ts>
struct error_sender

Friends

template<typename R>
operation_state<R> tag_invoke(hpx::execution::experimental::connect_t, error_sender, R &&r)
template<typename Env>
auto tag_invoke(hpx::execution::experimental::get_completion_signatures_t, error_sender const&, Env)
template<typename R>
struct operation_state

Public Members

template<>
std::decay_t<R> r

Friends

void tag_invoke(hpx::execution::experimental::start_t, operation_state &os)
struct stopped_sender

Friends

template<typename R>
operation_state<R> tag_invoke(hpx::execution::experimental::connect_t, stopped_sender, R &&r)
template<typename Env>
auto tag_invoke(hpx::execution::experimental::get_completion_signatures_t, stopped_sender const&, Env)
template<typename R>
struct operation_state

Public Members

std::decay_t<R> r

Friends

void tag_invoke(hpx::execution::experimental::start_t, operation_state &os)
template<typename F>
struct callback_receiver

Public Members

std::decay_t<F> f
std::atomic<bool> &set_value_called

Friends

template<typename E>
void tag_invoke(hpx::execution::experimental::set_error_t, callback_receiver&&, E&&)
void tag_invoke(hpx::execution::experimental::set_stopped_t, callback_receiver&&)
template<typename ...Ts>
auto tag_invoke(hpx::execution::experimental::set_value_t, callback_receiver &&r, Ts&&... ts)
template<typename F>
struct error_callback_receiver

Public Members

std::decay_t<F> f
std::atomic<bool> &set_error_called
bool expect_set_value = false

Friends

template<typename E>
void tag_invoke(hpx::execution::experimental::set_error_t, error_callback_receiver &&r, E &&e)
void tag_invoke(hpx::execution::experimental::set_stopped_t, error_callback_receiver&&)
template<typename ...Ts>
void tag_invoke(hpx::execution::experimental::set_value_t, error_callback_receiver &&r, Ts&&...)
struct expect_stopped_receiver

Public Members

std::atomic<bool> &set_stopped_called

Friends

template<typename ...Ts>
void tag_invoke(hpx::execution::experimental::set_value_t, expect_stopped_receiver&&, Ts...)
void tag_invoke(hpx::execution::experimental::set_stopped_t, expect_stopped_receiver &&r)
void tag_invoke(hpx::execution::experimental::set_error_t, expect_stopped_receiver&&, std::exception_ptr)
template<typename F>
struct void_callback_helper

Public Functions

void operator()() const
template<typename T>
void operator()(T &&t)

Public Members

std::decay_t<F> f
template<typename T>
struct error_typed_sender

Friends

template<typename R>
auto tag_invoke(hpx::execution::experimental::connect_t, error_typed_sender&&, R &&r)
template<typename Env>
auto tag_invoke(hpx::execution::experimental::get_completion_signatures_t, error_typed_sender const&, Env)
template<typename R>
struct operation_state

Public Members

template<>
std::decay_t<R> r

Friends

void tag_invoke(hpx::execution::experimental::start_t, operation_state &os)
struct check_exception_ptr

Public Functions

void operator()(std::exception_ptr eptr) const
void operator()(std::runtime_error const &e) const
struct custom_sender_tag_invoke

Public Members

std::atomic<bool> &tag_invoke_overload_called

Friends

template<typename R>
operation_state<R> tag_invoke(hpx::execution::experimental::connect_t, custom_sender_tag_invoke&&, R &&r)
template<typename Env>
auto tag_invoke(hpx::execution::experimental::get_completion_signatures_t, custom_sender_tag_invoke const&, Env)
template<typename R>
struct operation_state

Public Functions

void start()

Public Members

std::decay_t<R> r
struct custom_sender

Subclassed by custom_sender2

Public Types

template<template<class...> class Tuple, template<class...> class Variant>
using value_types = Variant<Tuple<>>
template<template<class...> class Variant>
using error_types = Variant<std::exception_ptr>

Public Members

std::atomic<bool> &start_called
std::atomic<bool> &connect_called
std::atomic<bool> &tag_invoke_overload_called

Public Static Attributes

constexpr bool sends_stopped = false

Friends

template<typename R>
auto tag_invoke(hpx::execution::experimental::connect_t, custom_sender &&s, R &&r)
template<typename Env>
auto tag_invoke(hpx::execution::experimental::get_completion_signatures_t, custom_sender const&, Env)
template<typename R>
struct operation_state

Public Members

std::atomic<bool> &start_called
std::decay_t<R> r

Friends

void tag_invoke(hpx::execution::experimental::start_t, operation_state &os)
template<typename T>
struct custom_typed_sender

Public Members

std::decay_t<T> x
std::atomic<bool> &start_called
std::atomic<bool> &connect_called
std::atomic<bool> &tag_invoke_overload_called

Friends

template<typename R>
auto tag_invoke(hpx::execution::experimental::connect_t, custom_typed_sender &&s, R &&r)
template<typename Env>
auto tag_invoke(hpx::execution::experimental::get_completion_signatures_t, custom_typed_sender const&, Env)
template<typename R>
struct operation_state

Public Members

template<>
std::decay_t<T> x
template<>
std::atomic<bool> &start_called
template<>
std::decay_t<R> r

Friends

void tag_invoke(hpx::execution::experimental::start_t, operation_state &os)
struct custom_sender2 : public custom_sender

Public Functions

custom_sender2(custom_sender s)
template<typename T>
struct custom_type

Public Members

std::atomic<bool> &tag_invoke_overload_called
std::decay_t<T> x
struct custom_type_non_default_constructible

Public Functions

custom_type_non_default_constructible()
custom_type_non_default_constructible(int x)
custom_type_non_default_constructible(custom_type_non_default_constructible&&)
custom_type_non_default_constructible &operator=(custom_type_non_default_constructible&&)
custom_type_non_default_constructible(custom_type_non_default_constructible const&)
custom_type_non_default_constructible &operator=(custom_type_non_default_constructible const&)

Public Members

int x
struct custom_type_non_default_constructible_non_copyable

Public Functions

custom_type_non_default_constructible_non_copyable()
custom_type_non_default_constructible_non_copyable(int x)
custom_type_non_default_constructible_non_copyable(custom_type_non_default_constructible_non_copyable&&)
custom_type_non_default_constructible_non_copyable &operator=(custom_type_non_default_constructible_non_copyable&&)
custom_type_non_default_constructible_non_copyable(custom_type_non_default_constructible_non_copyable const&)
custom_type_non_default_constructible_non_copyable &operator=(custom_type_non_default_constructible_non_copyable const&)

Public Members

int x
struct scheduler

Subclassed by scheduler2

Public Functions

bool operator==(scheduler const&) const
bool operator!=(scheduler const&) const

Public Members

std::atomic<bool> &schedule_called
std::atomic<bool> &execute_called
std::atomic<bool> &tag_invoke_overload_called

Friends

template<typename F>
void tag_invoke(hpx::execution::experimental::execute_t, scheduler s, F &&f)
sender tag_invoke(hpx::execution::experimental::schedule_t, scheduler s)
struct sender

Friends

template<typename R>
auto tag_invoke(hpx::execution::experimental::connect_t, sender&&, R &&r)
template<typename Env>
auto tag_invoke(hpx::execution::experimental::get_completion_signatures_t, sender const&, Env)
template<typename R>
struct operation_state

Public Members

std::decay_t<R> r

Friends

void tag_invoke(hpx::execution::experimental::start_t, operation_state &os)
struct scheduler2 : public scheduler

Public Functions

scheduler2(scheduler s)