8#include "../../result.hpp"
38template <std::
size_t I,
typename Plan,
typename Slots>
49template <std::
size_t I,
typename Plan,
typename Slots,
typename Ctx>
65template <std::
size_t I,
typename Slots>
70template <std::
size_t I,
typename Plan,
typename Slots>
75template <std::
size_t I,
typename Plan>
96template <
typename Plan,
typename Slots, std::size_t...
I>
99 return std::array<
fn_t,
sizeof...(I)> {
108template <
typename Plan,
typename Slots,
typename Ctx, std::size_t...
I>
111 return std::array<
fn_t,
sizeof...(I)> {
124template <
typename Plan,
typename Slots, std::size_t...
I>
127 return std::array<
fn_t,
sizeof...(I)> {
132template <
typename Plan,
typename Slots, std::size_t...
I>
135 return std::array<
fn_t,
sizeof...(I)> {
140template <
typename Plan,
typename Slots, std::size_t...
I>
143 return std::array<
fn_t,
sizeof...(I)> {
148template <
typename Plan, std::size_t...
I>
150 return std::array<
bool,
sizeof...(I)> {
165template <
typename Plan,
typename EnterInvoker,
typename DestroyInvoker,
typename PrepareFanoutInvoker,
typename DestroyFanoutInvoker>
172 std::vector<dfs_stack_frame>
frames;
173 frames.reserve(Plan::max_level + 1);
193 if (!
frame.entered) {
195 frame.entered =
true;
196 frame.payload_live = entered.payload_live;
201 if (!entered.step.ok()) {
208 if (
frame.requires_fanout_staging && !
frame.fanout_prepared) {
210 frame.fanout_prepared =
true;
215 if (
frame.next_child_ordinal == Plan::child_counts[
frame.node_index]) {
225 const auto child_index = Plan::child_indices[
226 Plan::child_offsets[
frame.node_index] +
frame.next_child_ordinal];
258 ++
parent.next_child_ordinal;
260 if (
parent.next_child_ordinal == Plan::child_counts[
parent.node_index]) {
283template <
typename Plan,
typename Slots>
287 std::make_index_sequence<Plan::node_count> {});
290 std::make_index_sequence<Plan::node_count> {});
293 std::make_index_sequence<Plan::node_count> {});
296 std::make_index_sequence<Plan::node_count> {});
299 std::make_index_sequence<Plan::node_count> {});
302template <
typename Plan,
typename Slots,
typename Ctx>
306 std::make_index_sequence<Plan::node_count> {});
309 std::make_index_sequence<Plan::node_count> {});
312 std::make_index_sequence<Plan::node_count> {});
315 std::make_index_sequence<Plan::node_count> {});
318 std::make_index_sequence<Plan::node_count> {});
321template <
typename Plan,
typename Slots>
331 [&](std::size_t node_index)
constexpr {
334 [&](std::size_t node_index)
constexpr {
337 [&](std::size_t node_index)
constexpr {
342template <
typename Plan,
typename Slots,
typename Ctx>
357 [&](std::size_t node_index)
constexpr {
360 [&](std::size_t node_index)
constexpr {
365 [&](std::size_t node_index)
constexpr {
consteval auto make_destroy_fanout_dispatch_table(std::index_sequence< I... >)
constexpr void destroy_node_payload_runtime(Slots &slots) noexcept
Per-node runtime thunk for destroying node I's payload slot.
constexpr step_result run_explicit_heap_stack(Plan &plan, Slots &slots, plan_fanout_state< Plan > &fanout)
constexpr node_enter_result enter_node_runtime(Plan &plan, Slots &slots, plan_fanout_state< Plan > &fanout)
Per-node runtime thunk for entering node I.
consteval auto make_requires_fanout_staging_table(std::index_sequence< I... >)
consteval auto make_prepare_fanout_dispatch_table(std::index_sequence< I... >)
constexpr void prepare_fanout_runtime(Slots &slots, plan_fanout_state< Plan > &fanout)
constexpr step_result run_explicit_heap_stack_loop(const auto &requires_fanout_staging_by_index, EnterInvoker enter_node_by_index, DestroyInvoker destroy_node_payload_by_index, PrepareFanoutInvoker prepare_fanout_by_index, DestroyFanoutInvoker destroy_fanout_by_index)
Executes serial DFS using a heap-backed explicit stack.
constexpr void destroy_fanout_runtime(plan_fanout_state< Plan > &fanout) noexcept
consteval auto make_enter_node_dispatch_table(std::index_sequence< I... >)
Builds the runtime dispatch table for node entry without external context.
consteval auto make_destroy_node_dispatch_table(std::index_sequence< I... >)
Builds the runtime dispatch table for payload destruction.
constexpr bool is_adapter_descriptor_v
Runtime frame used by the explicit-heap-stack DFS executor.
bool requires_fanout_staging
std::size_t next_child_ordinal
static constexpr auto requires_fanout_staging
static constexpr auto prepare_fanout
static constexpr auto enter
static constexpr auto destroy_fanout
static constexpr auto destroy
static constexpr auto enter
static constexpr auto requires_fanout_staging
static constexpr auto destroy_fanout
static constexpr auto destroy
static constexpr auto prepare_fanout
Represents the basic outcome of a task step.
static constexpr step_result success() noexcept
Creates a successful result.