For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Introduction
    • Overview
    • Relevant Technologies
    • Getting Started
  • Setup
    • SDK Installation
    • Additional Setup
    • Third Party Hardware Setup
  • Using the SDK
    • Holoscan Core
    • GPU Resident Execution
    • Holoscan by Example
    • Create an Application
    • Create a Distributed Application
    • Create an Operator
    • Create an Operator via Decorator
    • Create a Condition
    • Dynamic Flow Control
    • CUDA Stream Handling
    • Logging
    • Data Logging
    • Debugging
    • Python Operator Bindings
  • Operators
    • Operators and Extensions
    • Visualization
    • Inference
    • Testing
    • Video I/O Vendor Implementation Guide
  • Components
    • Schedulers
    • Conditions
    • Resources
    • Analytics
  • AI Skills
    • Ai Skills
  • API reference
          • Allocator
          • AnnotatedDoubleBufferReceiver
          • AnnotatedDoubleBufferTransmitter
          • AppDriver
          • Application
          • AppWorker
          • Arg
          • ArgList
          • ArgType
          • ArgumentSetter
          • AsyncBufferReceiver
          • AsyncBufferTransmitter
          • AsyncDataLoggerBackend
          • AsyncDataLoggerResource
          • AsynchronousCondition
          • BlockMemoryPool
          • BooleanCondition
          • CLIParser
          • Clock
          • ClockInterface
          • CodecRegistry
          • Component
          • ComponentBase
          • ComponentSpec
          • Condition
          • ConditionCombiner
          • Config
          • CountCondition
          • CPUResourceMonitor
          • CPUThread
          • CsvDataExporter
          • CudaAllocator
          • CudaBufferAvailableCondition
          • CudaContextScopedPush
          • CudaEventCondition
          • CudaFunctionLauncher
          • CudaGreenContext
          • CudaGreenContextPool
          • CudaObjectHandler
          • CudaStreamCondition
          • CudaStreamHandler
          • CudaStreamPool
          • DataExporter
          • DataFlowTracker
          • DataLogger
          • DataLoggerQueue
          • DataLoggerResource
          • DefaultFragmentService
          • DFFTCollector
          • DistributedAppService
          • DLManagedMemoryBufferVersioned
          • DoubleBufferReceiver
          • DoubleBufferTransmitter
          • DownstreamMessageAffordableCondition
          • Endpoint
          • EventBasedScheduler
          • ExecutionContext
          • Executor
          • ExpiringMessageAvailableCondition
          • ExtensionManager
          • FastDdsDiscovery
          • FastDdsEndpoint
          • FastDdsHoloscanEntityTypeSupport
          • FastDdsNativeBufferAdapter
          • FastDdsPubSubContext
          • FastDdsPubSubNetworkContext
          • FastDdsSerializer
          • FastDdsTransport
          • FileFIFOMutex
          • FirstFitAllocator
          • FirstFitAllocatorBase
          • FirstPixelOutCondition
          • FlowGraph
          • FlowGraphImpl
          • Fragment
          • FragmentAllocationStrategy
          • FragmentScheduler
          • FragmentService
          • FragmentServiceProvider
          • GPUDevice
          • GPUResidentDeck
          • GPUResidentExecutor
          • GPUResidentOperator
          • GPUResourceMonitor
          • GreedyFragmentAllocationStrategy
          • GreedyScheduler
          • GXFComponentResource
          • HoloEntitySerializerBase
          • HoloIpcCudaNativeBufferAdapterBase
          • HoloscanAsyncBufferReceiver
          • HoloscanAsyncBufferTransmitter
          • HoloscanLogger
          • HoloscanUcxReceiver
          • HoloscanUcxTransmitter
          • InMemoryPubSubNetworkContext
          • InMemoryPubSubSession
          • InputContext
          • IOSpec
          • LockFreeQueue
          • Logger
          • ManualClock
          • Map
          • MatXAllocator
          • MemoryAvailableCondition
          • Message
          • MessageAvailableCondition
          • MessageLabel
          • MetadataDictionary
          • MetaParameter
          • MultiMessageAvailableCondition
          • MultiMessageAvailableTimeoutCondition
          • MultiThreadScheduler
          • NativeBufferProtocolAdapter
          • NetworkContext
          • Nullable
          • Operator
          • OperatorSpec
          • OrConditionCombiner
          • OrderedQueue
          • OutputContext
          • ParameterWrapper
          • PathMetrics
          • PeriodicCondition
          • PoseTree
          • PoseTreeEdgeHistory
          • PoseTreeManager
          • PoseTreeUCXClient
          • PoseTreeUCXServer
          • PresentDoneCondition
          • PublisherAvailableCondition
          • PubSubContext
          • PubSubReceiver
          • PubSubTransmitter
          • RealtimeClock
          • Receiver
          • Resource
          • RMMAllocator
          • RuntimeError
          • Scheduler
          • ScopedFlock
          • ScopedWaitedFlock
          • SerializationBuffer
          • SessionDiscoveryFrontend
          • SessionTransportFrontend
          • SidecarDispatchQueue
          • SignalHandler
          • SO2
          • SO3
          • StdComponentSerializer
          • StdEntitySerializer
          • StdPubSubEntitySerializer
          • StreamOrderedAllocator
          • Subgraph
          • SubscriberAvailableCondition
          • SyntheticClock
          • SystemResourceManager
          • Tensor
          • TensorMap
          • ThreadPool
          • Timer
          • Topology
          • Transmitter
          • UcxComponentSerializer
          • UcxContext
          • UcxEntitySerializer
          • UcxHoloscanComponentSerializer
          • UcxReceiver
          • UcxSerializationBuffer
          • UcxTransmitter
          • UnboundedAllocator
  • Performance
    • Performance Considerations
    • Flow Tracking
    • GXF Job Statistics
    • Nsight Profiling
  • HoloHub
    • HoloHub Overview
  • FAQ
    • FAQ
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogoDocumentation
On this page
  • Constructors
  • FlowGraph
  • Destructor
  • ~FlowGraph
  • Assignment operators
  • operator=
  • Methods
  • add_node
  • add_flow
  • get_port_map
  • is_empty
  • is_root
  • is_user_defined_root
  • is_leaf
  • has_cycle
  • get_root_nodes
  • get_nodes
  • get_next_nodes
  • get_outdegree
  • get_indegree
  • find_node
  • get_previous_nodes
  • context
  • remove_node
  • get_port_connectivity_maps
  • port_map_description
  • Types
  • Typedefs
  • Member variables
API referenceC++ APIHoloscanClasses

holoscan::FlowGraph

Beta
||View as Markdown|
Previous

holoscan::FirstPixelOutCondition

Next

holoscan::FlowGraphImpl

template <typename NodeT, typename EdgeDataElementT>
class FlowGraph

Abstract base class for all flow graphs.

#include <holoscan/flow_graph.hpp>

Template parameters

NodeT
typename
EdgeDataElementT
typename

Constructors

FlowGraph

Default
Copy (deleted)
holoscan::FlowGraph<NodeT, EdgeDataElementT>::FlowGraph() = defaultholoscan::FlowGraph<NodeT, EdgeDataElementT>::FlowGraph() = default

Destructor

~FlowGraph

virtual holoscan::FlowGraph<NodeT, EdgeDataElementT>::~FlowGraph() = defaultvirtual holoscan::FlowGraph<NodeT, EdgeDataElementT>::~FlowGraph() = default

Assignment operators

operator=

FlowGraph & holoscan::FlowGraph<NodeT, EdgeDataElementT>::operator=(FlowGraph & holoscan::FlowGraph<NodeT, EdgeDataElementT>::operator=(
const FlowGraph &
) = delete

Methods

add_node

virtual void holoscan::FlowGraph<NodeT, EdgeDataElementT>::add_node(
const NodeT &node
)

Add the node to the graph.

Parameters

node
const NodeT &

The node to add.

add_flow

virtual void holoscan::FlowGraph<NodeT, EdgeDataElementT>::add_flow(
const NodeType &node_u,
const NodeType &node_v,
const EdgeDataType &port_map
)

Add an edge to the graph.

Parameters

node_u
const NodeType &

A source node.

node_v
const NodeType &

A destination node.

port_map
const EdgeDataType &

A map from the source node’s port name to the destination node’s port name(s).

get_port_map

virtual std::optional<EdgeDataType> holoscan::FlowGraph<NodeT, EdgeDataElementT>::get_port_map(
const NodeType &node_u,
const NodeType &node_v
) const

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

node_u
const NodeType &

A source node.

node_v
const NodeType &

A destination node.

is_empty

virtual bool holoscan::FlowGraph<NodeT, EdgeDataElementT>::is_empty() const

Check if the graph is empty.

Returns: true if the graph is empty. Otherwise, false.

is_root

virtual bool holoscan::FlowGraph<NodeT, EdgeDataElementT>::is_root(
const NodeType &node
) const

Check if the node is a root node.

Returns: true if the node is a root node.

Parameters

node
const NodeType &

A node in the graph.

is_user_defined_root

virtual bool holoscan::FlowGraph<NodeT, EdgeDataElementT>::is_user_defined_root(
const NodeType &node
) const

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

node
const NodeType &

A node in the graph.

is_leaf

virtual bool holoscan::FlowGraph<NodeT, EdgeDataElementT>::is_leaf(
const NodeType &node
) const

Check if the node is a leaf node.

Returns: true if the node is a leaf node.

Parameters

node
const NodeType &

A node in the graph.

has_cycle

virtual std::vector<NodeType> holoscan::FlowGraph<NodeT, EdgeDataElementT>::has_cycle() const

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

virtual std::vector<NodeType> holoscan::FlowGraph<NodeT, EdgeDataElementT>::get_root_nodes() const

Get all root nodes.

Returns: A vector of root nodes.

get_nodes

virtual std::vector<NodeType> holoscan::FlowGraph<NodeT, EdgeDataElementT>::get_nodes() const

Get all nodes.

The order of the nodes is not guaranteed.

Returns: A vector of all nodes.

get_next_nodes

virtual std::vector<NodeType> holoscan::FlowGraph<NodeT, EdgeDataElementT>::get_next_nodes(
const NodeType &node
) const

Get the next nodes of the given node.

Returns: A vector of next nodes.

Parameters

node
const NodeType &

A node in the graph.

get_outdegree

virtual size_t holoscan::FlowGraph<NodeT, EdgeDataElementT>::get_outdegree(
const NodeType &node,
const std::string &port_name
) const

Get the outdegree of a given node of a given port.

Returns: The outdegree of the given node of the given port.

Parameters

node
const NodeType &

A node in the graph.

port_name
const std::string &

The name of the port in the given node.

get_indegree

virtual size_t holoscan::FlowGraph<NodeT, EdgeDataElementT>::get_indegree(
const NodeType &node,
const std::string &port_name
) const

Get the indegree of a given node of a given port.

Returns: The indegree of the given node of the given port.

Parameters

node
const NodeType &

A node in the graph.

port_name
const std::string &

The name of the port in the given node.

find_node

Const (with pred)
Const (with node)
Const (with name)
virtual NodeType holoscan::FlowGraph<NodeT, EdgeDataElementT>::find_node(
const NodePredicate &pred
) const

Find a node in the graph that satisfies the given predicate.

Returns: The node if found, otherwise nullptr.

Parameters

pred
const NodePredicate &

A predicate.

get_previous_nodes

virtual std::vector<NodeType> holoscan::FlowGraph<NodeT, EdgeDataElementT>::get_previous_nodes(
const NodeType &node
) const

Get the previous nodes of the given node.

Returns: A vector of previous nodes.

Parameters

node
const NodeType &

A node in the graph.

context

Mutable
Const
virtual void holoscan::FlowGraph<NodeT, EdgeDataElementT>::context(
void *context
)

Set the context.

Parameters

context
void *

The context.

remove_node

virtual void holoscan::FlowGraph<NodeT, EdgeDataElementT>::remove_node(
const NodeType &node
)

Remove a node (and all its edges) from the graph.

Parameters

node
const NodeType &

The node to remove.

get_port_connectivity_maps

virtual std::pair<std::map<std::string, std::vector<std::string>>, std::map<std::string, std::vector<std::string>>> holoscan::FlowGraph<NodeT, EdgeDataElementT>::get_port_connectivity_maps() const

Get port connectivity maps for the graph.

Returns a pair of two maps:

  1. Input ports to connected output ports mapping
  2. Output ports to connected input ports mapping

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

port_map_description

virtual std::string holoscan::FlowGraph<NodeT, EdgeDataElementT>::port_map_description() const

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


Types

Typedefs

NameDefinition
NodeTypeNodeT
NodePredicatestd::function< bool(const NodeT &)>
EdgeDataElementTypeEdgeDataElementT
EdgeDataTypestd::shared_ptr< EdgeDataElementT >

Member variables

NameTypeDescription
context_void *The context.