graph_proxy

template<typename T>
class graph_proxy

Proxy for registering algorithm nodes in a processing graph.

Passed to user plugin entry points by the framework. Use the registration methods to attach user algorithms to the graph. Users never construct this type directly.

Subclassed by phlex::detail::module_graph_proxy< T >, phlex::detail::providers_graph_proxy< T >, phlex::detail::source_graph_proxy< T >

Public Functions

template<typename U, typename ...Args>
graph_proxy<U> make(Args&&... args) const

Binds a user algorithm object of type U to this proxy.

Constructs an instance of U forwarding args to its constructor. Returns a new proxy through which member functions of that object may be registered as algorithm nodes.

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 predicate(std::string_view name, is_predicate_like auto f, concurrency c = concurrency::serial) const

Registers a predicate node.

auto provide(std::string_view name, is_provider_like auto f, concurrency c = concurrency::serial) const

Registers a provider 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.

template<std::derived_from<source> Source, typename ...Args>
void add_source(std::string_view name, Args&&... args) const

Registers a source (used by the framework to create provider nodes).

auto output(std::string_view name, is_output_like auto f, concurrency c = concurrency::serial) const

Registers an output node.