holoscan::FlowGraphImpl
holoscan::FlowGraphImpl
Template parameters
Inherits from: holoscan::FlowGraph< NodeT, EdgeDataElementT > (public)
Constructors
Destructor
~FlowGraphImpl
Methods
add_node
Add the node to the graph.
Parameters
The node to add.
add_flow
Overload 1
Add an edge to the graph
get_port_map
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.
is_root
Check if the node is a root node.
Returns: true if the node is a root node.
Parameters
A node in the graph.
is_user_defined_root
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.
is_leaf
Check if the node is a leaf node.
Returns: true if the node is a leaf node.
Parameters
A node in the graph.
has_cycle
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_root_nodes
Get all root nodes.
The nodes are returned in the order they were added to the graph.
Returns: A vector of all root nodes.
get_nodes
Get all nodes.
The nodes are returned in the order they were added to the graph.
Returns: A vector of all nodes.
get_next_nodes
Get all nodes immediately downstream of a given node.
The nodes are returned in the order in which they were added to the graph.
Returns: A vector of all next nodes.
get_previous_nodes
Get all nodes immediately upstream of a given node.
The nodes are returned in the order in which they were added to the graph.
Returns: A vector of all previous nodes.
Parameters
The node to get the upstream nodes of.
get_outdegree
Get the outdegree of a given node of a given port.
Returns: The outdegree of the given node of the given port.
Parameters
The node to get the outdegree of.
The name of the port in the given node.
get_indegree
Get the indegree of a given node of a given port.
Returns: The indegree of the given node of the given port.
Parameters
The node to get the indegree of.
The name of the port in the given node.
get_port_connectivity_maps
Get port connectivity maps for the graph.
Returns two maps that describe the connectivity between input and output ports:
- Input-to-Output map: Keys are input port unique IDs, values are vectors of output port unique IDs that connect to this input port.
- Output-to-Input map: Keys are output port unique IDs, values are vectors of input port unique IDs that this output port connects to.
For multi-receiver ports, each individual port (e.g., “in:0”, “in:1”, “in:2”) is listed as a separate key.
For OperatorFlowGraphImpl the unique ID has format: “<fragment_name>.<operator_name>.<port_name>” (or just <operator_name>.<port_name> if no fragment name was assigned).
For FragmentFlowGraphImpl the unique ID has format: “<fragment_name>.<port_name>”.
Returns: A pair containing (input_to_output_map, output_to_input_map)
port_map_description
Get a YAML formatted description of the port connectivity maps.
Returns a string containing the port connectivity information in YAML format. The output includes both input-to-output and output-to-input mappings.
Example output for the following computation graph
tx -> mx -— rx1 ___ rx2
(assume each operator has one input port named ‘in’ and one output port named ‘out’)
Returns: A YAML formatted string describing the port connectivity
Example
find_node
Const (with pred) (1)
Const (with node)
Const (with name)
Const (with pred) (2)
remove_node
Remove a node (and all its edges) from the graph.
Parameters
The node to remove.
is_empty
Check if the graph is empty.
Returns: true if the graph is empty. Otherwise, false.
context
Mutable
Const
Set the context.
Parameters
The context.