holoscan::FlowGraph
holoscan::FlowGraph
holoscan::FlowGraph
Abstract base class for all flow graphs.
Template parameters
Add the node to the graph.
Parameters
The node to add.
Add an edge to the graph.
Parameters
A source node.
A destination node.
A map from the source node’s port name to the destination node’s port name(s).
Get a mapping from the source node’s port name to the destination node’s port name(s).
Returns: A map from the source node’s port name to the destination node’s port name(s).
Parameters
A source node.
A destination node.
Check if the graph is empty.
Returns: true if the graph is empty. Otherwise, false.
Check if the node is a root node.
Returns: true if the node is a root node.
Parameters
A node in the graph.
Check if the node is a user-defined root node.
A user-defined root is the first node that is added to the graph.
Returns: true if the node is a user-defined root node.
Parameters
A node in the graph.
Check if the node is a leaf node.
Returns: true if the node is a leaf node.
Parameters
A node in the graph.
Returns a vector of root nodes of the cycles if the graph has cycle(s).
Otherwise, an empty vector is returned.
Returns: Returns a vector of root nodes of cycles.
Get all root nodes.
Returns: A vector of root nodes.
Get all nodes.
The order of the nodes is not guaranteed.
Returns: A vector of all nodes.
Get the next nodes of the given node.
Returns: A vector of next nodes.
Parameters
A node in the graph.
Get the outdegree of a given node of a given port.
Returns: The outdegree of the given node of the given port.
Parameters
A node in the graph.
The name of the port in the given node.
Get the indegree of a given node of a given port.
Returns: The indegree of the given node of the given port.
Parameters
A node in the graph.
The name of the port in the given node.
Find a node in the graph that satisfies the given predicate.
Returns: The node if found, otherwise nullptr.
Parameters
A predicate.
Get the previous nodes of the given node.
Returns: A vector of previous nodes.
Parameters
A node in the graph.
Set the context.
Parameters
The context.
Remove a node (and all its edges) from the graph.
Parameters
The node to remove.
Get port connectivity maps for the graph.
Returns a pair of two maps:
Each port is identified by a unique string.
Returns: A pair containing (input_to_output_map, output_to_input_map) where:input_to_output_map: Maps input port IDs to lists of connected output port IDs output_to_input_map: Maps output port IDs to lists of connected input port IDs
Get a YAML-formatted description of the port connectivity maps.
Returns a human-readable YAML string that describes the port connectivity of the graph.
Returns: A YAML-formatted string describing the port connectivity maps