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_ALGORITHMS plugin 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 Unfolder is constructed from the products selected by input_family(...), in the order of its constructor parameters. Starting from Unfolder::initial_value(), the node then repeatedly calls pred with the current value and, while it returns true, calls the generator unf, which returns a std::pair of the next value and the product for a new child data cell. Each call of pred and unf may take the Unfolder as its first argument (for example, member-function pointers). unf may also take the child’s data_cell_index after 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.