8#include "../../context.hpp"
9#include "../../resolve.hpp"
10#include "../../slots.hpp"
11#include "../../task_adapters.hpp"
12#include "../../detail/bind/member_receiver.hpp"
13#include "../../detail/bind/traits.hpp"
27template <
typename F,
typename... Specs>
45 template <
typename Ctx,
typename Prev>
47 noexcept(
noexcept(call_impl_raw(ec, std::index_sequence_for<Specs...>{}))) {
48 return call_impl_raw(ec, std::index_sequence_for<Specs...>{});
52 template <
typename Ctx,
typename Prev, std::size_t... I>
53 constexpr decltype(
auto) call_impl_raw(exec_context<Ctx, Prev>& ec, std::index_sequence<I...>)
54 noexcept(
noexcept(std::invoke(
75template <
typename F,
typename T,
typename... Specs>
84 template <
typename Ctx,
typename Prev>
86 noexcept(
noexcept(call_impl_into(ec, out, std::index_sequence_for<Specs...> {}))) {
88 decltype(call_impl_into(ec, out, std::index_sequence_for<Specs...> {}));
90 if constexpr (std::is_void_v<call_result_t>) {
91 call_impl_into(ec, out, std::index_sequence_for<Specs...> {});
94 static_assert(std::is_same_v<std::remove_cvref_t<call_result_t>, step_result>,
95 "bind_into(...) callable must return void or yorch::step_result");
96 return call_impl_into(ec, out, std::index_sequence_for<Specs...> {});
101 template <
typename Ctx,
typename Prev, std::size_t... I>
102 constexpr decltype(
auto) call_impl_into(
103 exec_context<Ctx, Prev>& ec,
105 std::index_sequence<I...>)
106 noexcept(
noexcept(std::invoke(
117template <
typename F,
typename T,
typename... Specs>
126 template <
typename Ctx,
typename Prev>
128 noexcept(
noexcept(call_impl_raw(ec, std::index_sequence_for<Specs...> {}))) {
129 using call_result_t =
130 decltype(call_impl_raw(ec, std::index_sequence_for<Specs...> {}));
132 if constexpr (std::is_void_v<call_result_t>) {
133 call_impl_raw(ec, std::index_sequence_for<Specs...> {});
136 static_assert(std::is_same_v<std::remove_cvref_t<call_result_t>, step_result>,
137 "bind_forward_prev(...) callable must return void or yorch::step_result");
138 return call_impl_raw(ec, std::index_sequence_for<Specs...> {});
143 template <
typename Ctx,
typename Prev, std::size_t... I>
144 constexpr decltype(
auto) call_impl_raw(
145 exec_context<Ctx, Prev>& ec,
146 std::index_sequence<I...>)
147 noexcept(
noexcept(std::invoke(
156template <
typename F,
typename ReceiverSpec,
typename T,
typename... Specs>
166 template <
typename Ctx,
typename Prev>
168 noexcept(
noexcept(call_impl_raw(ec, std::index_sequence_for<Specs...> {}))) {
169 using call_result_t =
170 decltype(call_impl_raw(ec, std::index_sequence_for<Specs...> {}));
172 if constexpr (std::is_void_v<call_result_t>) {
173 call_impl_raw(ec, std::index_sequence_for<Specs...> {});
176 static_assert(std::is_same_v<std::remove_cvref_t<call_result_t>, step_result>,
177 "bind_forward_prev_member(...) callable must return void or yorch::step_result");
178 return call_impl_raw(ec, std::index_sequence_for<Specs...> {});
183 template <
typename Ctx,
typename Prev, std::size_t... I>
184 constexpr decltype(
auto) call_impl_raw(
185 exec_context<Ctx, Prev>& ec,
186 std::index_sequence<I...>)
212template <
typename F,
typename ReceiverSpec,
typename... Specs>
220 template <
typename Ctx,
typename Prev>
222 noexcept(
noexcept(call_impl_raw(ec, std::index_sequence_for<Specs...>{}))) {
223 return call_impl_raw(ec, std::index_sequence_for<Specs...>{});
227 template <
typename Ctx,
typename Prev, std::size_t... I>
228 constexpr decltype(
auto) call_impl_raw(exec_context<Ctx, Prev>& ec, std::index_sequence<I...>)
254template <
typename F,
typename ReceiverSpec,
typename T,
typename... Specs>
264 template <
typename Ctx,
typename Prev>
266 noexcept(
noexcept(call_impl_into(ec, out, std::index_sequence_for<Specs...> {}))) {
267 using call_result_t =
268 decltype(call_impl_into(ec, out, std::index_sequence_for<Specs...> {}));
270 if constexpr (std::is_void_v<call_result_t>) {
271 call_impl_into(ec, out, std::index_sequence_for<Specs...> {});
274 static_assert(std::is_same_v<std::remove_cvref_t<call_result_t>, step_result>,
275 "bind_into_member(...) callable must return void or yorch::step_result");
276 return call_impl_into(ec, out, std::index_sequence_for<Specs...> {});
281 template <
typename Ctx,
typename Prev, std::size_t... I>
282 constexpr decltype(
auto) call_impl_into(
283 exec_context<Ctx, Prev>& ec,
285 std::index_sequence<I...>)
typename member_function_traits< std::remove_cvref_t< F > >::result_type member_result_t
typename function_traits< std::remove_cvref_t< F > >::result_type result_t
constexpr bool is_adapter_descriptor_v
constexpr decltype(auto) invoke_member_with_receiver(F &&func, Receiver &&receiver, Args &&... args) noexcept(noexcept(std::invoke(std::forward< F >(func), forward_member_receiver(std::forward< Receiver >(receiver)), std::forward< Args >(args)...)))
constexpr decltype(auto) resolve_as(from_ctx_t< T >, exec_context< Ctx, Prev > &ec) noexcept(detail::resolve_from_ctx_nothrow_v< Arg, T, Ctx >)
Resolves a from_ctx(...) spec by fetching the requested object from the execution context and binding...
std::tuple< Specs... > specs
constexpr step_result invoke_raw(exec_context< Ctx, Prev > &ec) noexcept(noexcept(call_impl_raw(ec, std::index_sequence_for< Specs... > {})))
ReceiverSpec receiver_spec
std::tuple< Specs... > specs
constexpr step_result invoke_raw(exec_context< Ctx, Prev > &ec) noexcept(noexcept(call_impl_raw(ec, std::index_sequence_for< Specs... > {})))
Bound direct-output task composed of a member function, receiver spec, and non-output parameter specs...
constexpr step_result invoke_into(exec_context< Ctx, Prev > &ec, direct_out< T > out) noexcept(noexcept(call_impl_into(ec, out, std::index_sequence_for< Specs... > {})))
ReceiverSpec receiver_spec
std::tuple< Specs... > specs
Bound executable task composed of a member function, receiver spec, and per-parameter specs.
detail::member_result_t< F > raw_result_type
ReceiverSpec receiver_spec
std::tuple< Specs... > specs
constexpr decltype(auto) invoke_raw(exec_context< Ctx, Prev > &ec) noexcept(noexcept(call_impl_raw(ec, std::index_sequence_for< Specs... >{})))
Bound direct-output task that writes its payload into a provided slot.
constexpr step_result invoke_into(exec_context< Ctx, Prev > &ec, direct_out< T > out) noexcept(noexcept(call_impl_into(ec, out, std::index_sequence_for< Specs... > {})))
std::tuple< Specs... > specs
Bound executable task composed of a callable and per-parameter specs.
F func
Stored callable to execute.
constexpr decltype(auto) invoke_raw(exec_context< Ctx, Prev > &ec) noexcept(noexcept(call_impl_raw(ec, std::index_sequence_for< Specs... >{})))
Resolves all specs and executes the bound callable.
detail::result_t< F > raw_result_type
Raw return type declared by the stored callable.
std::tuple< Specs... > specs
Stored argument binding specs in parameter order.
Output sink passed to direct-output tasks.
Lightweight borrowed view used during execution.
Represents the basic outcome of a task step.
static constexpr step_result success() noexcept
Creates a successful result.