MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ operator>>()

MAYAFLUX_API std::shared_ptr< Nodes::Node > MayaFlux::operator>> ( const std::shared_ptr< Nodes::Node > &  lhs,
const std::shared_ptr< Nodes::Node > &  rhs 
)

Connects two nodes in series (pipeline operator)

Parameters
lhsSource node (may already be a ChainNode)
rhsTarget node (may already be a ChainNode)
Returns
A ChainNode containing the flattened sequence

If lhs is already a ChainNode, rhs is appended to its sequence rather than creating a nested chain.

Uses the default engine's NodeGraphManager for registration. For manual construction without registration, create ChainNode directly with no manager argument.

auto chain = generator >> transformer >> output;
BufferProcessingChain * chain

Definition at line 370 of file Graph.cpp.

371{
372 auto manager = get_node_graph_manager();
373
374 auto lhs_chain = std::dynamic_pointer_cast<Nodes::ChainNode>(lhs);
375 auto rhs_chain = std::dynamic_pointer_cast<Nodes::ChainNode>(rhs);
376
377 if (lhs_chain) {
378 if (rhs_chain) {
379 lhs_chain->append_chain(rhs_chain);
380 } else {
381 lhs_chain->append(rhs);
382 }
383 lhs_chain->initialize();
384 return lhs_chain;
385 }
386
387 std::shared_ptr<Nodes::ChainNode> chain;
388 if (rhs_chain) {
389 std::vector<std::shared_ptr<Nodes::Node>> nodes;
390 nodes.reserve(1 + rhs_chain->size());
391 nodes.push_back(lhs);
392 for (auto& node : rhs_chain->nodes()) {
393 nodes.push_back(node);
394 }
395 chain = std::make_shared<Nodes::ChainNode>(std::move(nodes), *manager);
396 } else {
397 chain = std::make_shared<Nodes::ChainNode>(lhs, rhs, *manager);
398 }
399
400 chain->initialize();
401 return chain;
402}
std::shared_ptr< Nodes::NodeGraphManager > get_node_graph_manager()
Gets the node graph manager from the default engine.
Definition Graph.cpp:51

References chain, and get_node_graph_manager().

+ Here is the call graph for this function: