module_graph_proxy¶
-
template<typename T>
class module_graph_proxy : private phlex::detail::graph_proxy<T>¶ Proxy for registering module algorithm nodes.
Passed to
PHLEX_REGISTER_ALGORITHMSplugin entry points. Provides access to fold, observe, output, predicate, transform, and unfold registration. Users never construct this type directly.Public Functions
-
template<typename ...InitArgs>
auto fold(std::string_view name, is_fold_like auto f, concurrency c = concurrency::serial, std::string partition = "job", InitArgs&&... init_args) const¶ Registers a fold algorithm node.
-
auto observe(std::string_view name, is_observer_like auto f, concurrency c = concurrency::serial) const¶
Registers an observer node.
-
auto output(std::string_view name, is_output_like auto f, concurrency c = concurrency::serial) const¶
Registers an output node.
-
auto predicate(std::string_view name, is_predicate_like auto f, concurrency c = concurrency::serial) const¶
Registers a predicate node.
-
auto transform(std::string_view name, is_transform_like auto f, concurrency c = concurrency::serial) const¶
Registers a transform node.
-
template<typename Unfolder>
auto unfold(std::string_view name, is_predicate_like auto pred, auto unf, std::string destination_data_layer, concurrency c = concurrency::serial) const¶ Registers an unfold node, which creates child data cells from one parent.
For each parent data cell, an
Unfolderis constructed from the products selected byinput_family(...), in the order of its constructor parameters. Starting fromUnfolder::initial_value(), the node then repeatedly callspredwith the current value and, while it returnstrue, calls the generatorunf, which returns astd::pairof the next value and the product for a new child data cell. Each call ofpredandunfmay take theUnfolderas its first argument (for example, member-function pointers).unfmay also take the child’sdata_cell_indexafter the value.Children are numbered from 0 for each parent and placed in
destination_data_layer. A parent may have no children. All input selectors must name the same data layer.- Parameters:
name – Algorithm name.
pred – Predicate: returns whether to create another child.
unf – Generator: creates the next child’s product.
destination_data_layer – Name of the child data layer.
c – Maximum number of parents unfolded at the same time.
-
template<typename ...InitArgs>