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
Uto this proxy.Constructs an instance of
Uforwardingargsto 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
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<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.
-
template<typename U, typename ...Args>