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
          • AppWorkerTerminationStatus
          • Array Type
          • AvailableSystemResource
          • Base Type
          • Base Type T Typename Stdenable If T Stdis Base Of V Condition Stddecay T T
          • Base Type T Typename Stdenable If T Stdis Base Of V Resource Stddecay T T
          • CLIOptions
          • CloudPickleSerializedObject
          • Codec
          • Codec CloudPickleSerializedObject
          • Codec OpsHolovizOpInputSpec
          • Codec OpsHolovizOpInputSpecView
          • Codec OpsInferenceOpActivationSpec
          • Codec Stdarray TypeT N
          • Codec Stdshared Ptr TypeT
          • Codec Stdstring
          • Codec Stdunordered Map KeyType ValueType
          • Codec Stdvector Bool
          • Codec Stdvector OpsHolovizOpInputSpec
          • Codec Stdvector OpsHolovizOpInputSpecView
          • Codec Stdvector OpsInferenceOpActivationSpec
          • Codec Stdvector Stdstring
          • Codec Stdvector Stdvector TypeT
          • Codec Stdvector TypeT
          • Condition Default Name
          • Condition Default Name AsynchronousCondition
          • Condition Default Name BooleanCondition
          • Condition Default Name CountCondition
          • Condition Default Name CudaBufferAvailableCondition
          • Condition Default Name CudaEventCondition
          • Condition Default Name CudaStreamCondition
          • Condition Default Name DownstreamMessageAffordableCondition
          • Condition Default Name ExpiringMessageAvailableCondition
          • Condition Default Name MemoryAvailableCondition
          • Condition Default Name MessageAvailableCondition
          • Condition Default Name MultiMessageAvailableCondition
          • Condition Default Name MultiMessageAvailableTimeoutCondition
          • Condition Default Name PeriodicCondition
          • Condition Default Name PublisherAvailableCondition
          • Condition Default Name SubscriberAvailableCondition
          • ConnectionItem
          • ContiguousDataHeader
          • CPUInfo
          • DataEntry
          • Deleter
          • DeltaMessage
          • DistributedConfig
          • EdgeData
          • EncodedMessagePayload
          • FrameData
          • FrameInfo
          • GpuDeviceInfo
          • GPUInfo
          • HoloscanEntityData
          • ImportedNativeTensor
          • InMemorySessionParticipant
          • InterfacePort
          • Is Array
          • Is Scalar
          • Is Shared Ptr
          • Is Shared Ptr Stdshared Ptr T
          • Is Vector
          • Is Yaml Convertable
          • MultiMessageConditionInfo
          • NativeTensorMetadata
          • Network Context Default Name
          • Network Context Default Name FastDdsPubSubNetworkContext
          • Network Context Default Name InMemoryPubSubNetworkContext
          • Network Context Default Name PubSubContext
          • Network Context Default Name UcxContext
          • NoAccessibleMessageType
          • NoMessageType
          • Operator Default Name
          • Operator Default Name OpsAsyncPingRxOp
          • Operator Default Name OpsAsyncPingTxOp
          • Operator Default Name OpsBayerDemosaicOp
          • Operator Default Name OpsDataTypeRxTestOp
          • Operator Default Name OpsDataTypeTxTestOp
          • Operator Default Name OpsFormatConverterOp
          • Operator Default Name OpsGXFCodeletOp
          • Operator Default Name OpsHolovizOp
          • Operator Default Name OpsInferenceOp
          • Operator Default Name OpsInferenceProcessorOp
          • Operator Default Name OpsPingRxOp
          • Operator Default Name OpsPingTensorRxOp
          • Operator Default Name OpsPingTensorTxOp
          • Operator Default Name OpsPingTxOp
          • Operator Default Name OpsRawImageProcessorOp
          • Operator Default Name OpsSegmentationPostprocessorOp
          • Operator Default Name OpsV4L2VideoCaptureOp
          • Operator Default Name OpsVideoStreamRecorderOp
          • Operator Default Name OpsVideoStreamReplayerOp
          • OperatorTimestampLabel
          • Pose2
          • Pose3
          • PoseTreeUCXClientConfig
          • PoseTreeUCXServerConfig
          • Remove Pointer
          • Remove Pointer Stdshared Ptr T
          • Resource Default Name
          • Resource Default Name AsyncBufferReceiver
          • Resource Default Name AsyncBufferTransmitter
          • Resource Default Name BlockMemoryPool
          • Resource Default Name CPUThread
          • Resource Default Name CudaGreenContext
          • Resource Default Name CudaGreenContextPool
          • Resource Default Name CudaStreamPool
          • Resource Default Name Data LoggersAsyncConsoleLogger
          • Resource Default Name Data LoggersBasicConsoleLogger
          • Resource Default Name Data LoggersGXFConsoleLogger
          • Resource Default Name Data LoggersSimpleTextSerializer
          • Resource Default Name DoubleBufferReceiver
          • Resource Default Name DoubleBufferTransmitter
          • Resource Default Name GPUDevice
          • Resource Default Name ManualClock
          • Resource Default Name OrConditionCombiner
          • Resource Default Name PubSubReceiver
          • Resource Default Name PubSubTransmitter
          • Resource Default Name RealtimeClock
          • Resource Default Name RMMAllocator
          • Resource Default Name SerializationBuffer
          • Resource Default Name StdComponentSerializer
          • Resource Default Name StdEntitySerializer
          • Resource Default Name StreamOrderedAllocator
          • Resource Default Name SyntheticClock
          • Resource Default Name ThreadPool
          • Resource Default Name UcxComponentSerializer
          • Resource Default Name UcxEntitySerializer
          • Resource Default Name UcxHoloscanComponentSerializer
          • Resource Default Name UcxReceiver
          • Resource Default Name UcxSerializationBuffer
          • Resource Default Name UcxTransmitter
          • Resource Default Name UnboundedAllocator
          • Scalar Type
          • Scheduler Default Name
          • Scheduler Default Name EventBasedScheduler
          • Scheduler Default Name GreedyScheduler
          • Scheduler Default Name MultiThreadScheduler
          • ServiceKey
          • ServiceKeyHash
          • SnapshotAckMessage
          • SubscribeMessage
          • SystemResourceRequirement
          • Vector Type
          • YAMLNodeParser
          • YAMLNodeParser Int8 T
          • YAMLNodeParser IOSpec Ptr
          • YAMLNodeParser Stdarray TypeT N
          • YAMLNodeParser Stdcomplex TypeT
          • YAMLNodeParser Stdshared Ptr TypeT
          • YAMLNodeParser Stdvector IOSpec Ptr
          • YAMLNodeParser Stdvector TypeT
          • YAMLNodeParser TypeT
          • YAMLNodeParser Uint8 T
  • 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
  • Methods
  • print
  • Static methods
  • resolve_hostname
  • parse_port
  • parse_address
  • Member variables
API referenceC++ APIHoloscanStructs

holoscan::CLIOptions

Beta
||View as Markdown|
Previous

holoscan::base_type< T, typename std::enable_if_t< std::is_base_of_v< Resource, std::decay_t< T > > > >

Next

holoscan::CloudPickleSerializedObject

CLI Options struct.

This struct is used to store the parsed command line arguments.

#include <holoscan/cli_options.hpp>

Methods

print

void holoscan::CLIOptions::print() const

Print the CLI Options.


Static methods

resolve_hostname

static std::string holoscan::CLIOptions::resolve_hostname(
const std::string &hostname
)

Resolve the specified hostname to an IP address, prioritizing IPv4.

This function attempts to resolve the given hostname to an IP address using the system’s domain name service (DNS) resolver. It supports both IPv4 and IPv6 addresses and prioritizes IPv4 addresses. If the hostname can be resolved to multiple IP addresses and both IPv4 and IPv6 addresses are available, an IPv4 address will be returned in preference to an IPv6 address.

This function logs an error message using HOLOSCAN_LOG_ERROR if getaddrinfo fails to resolve the hostname. It also logs the resolved IP address using HOLOSCAN_LOG_DEBUG upon successful resolution.

Returns: A string containing the resolved IP address. If the hostname is resolved to an IPv4 address, the returned value will be in the IPv4 format (e.g., “192.0.2.1”). If no IPv4 address is available and it is an IPv6 address, it will be returned in the IPv6 format (e.g., “2001:db8::1”). If the hostname cannot be resolved or an error occurs, an empty string is returned.

Parameters

hostname
const std::string &

The hostname to be resolved. This is a domain name, such as “example.com”.

parse_port

static std::string holoscan::CLIOptions::parse_port(
const std::string &address,
const std::string &default_port = ""
)

Extract the port number from the given address.

This method supports both IPv4 and IPv6 addresses and can handle addresses with or without square brackets.

The method first checks for the presence of square brackets to determine if the address is an IPv6 address containing a port. If the address does not contain square brackets, it is treated as either an IPv4 address or a hostname, with the port separated by a colon. If multiple colons are present without brackets, the method assumes an IPv6 address without a specified port and will return the default port.

Returns: A string representing the extracted port number. If no port can be extracted and a default port is provided, the default port is returned. If no default port is provided and no port can be extracted, an empty string is returned.

Parameters

address
const std::string &

The address string from which to extract the port. This can be an IPv4 address, an IPv6 address (with or without square brackets), or a hostname.

default_port
const std::string &Defaults to ""

The default port to return if the address does not explicitly contain a port number. If this parameter is empty, and no port is found in the address, the method will return an empty string.

parse_address

static std::pair<std::string, std::string> holoscan::CLIOptions::parse_address(
const std::string &address,
const std::string &default_ip,
const std::string &default_port,
bool enclose_ipv6 = false,
bool resolve_hostname = true
)

Parse the provided address string and extract the IP address and port.

This function supports both IPv4 and IPv6 address formats. When a port is specified, IPv6 addresses are expected to be enclosed in square brackets. If the address string is empty or does not specify an IP address or port, the default values are returned, determined by the deduced IP version from the address format. IPv6 addresses will be enclosed in square brackets if a port is specified and if the enclose_ipv6 parameter is set to true.

If the IP address is identified as a hostname and the resolve_hostname parameter is set to true, the function will resolve the hostname to an IP address.

Returns: A pair containing the extracted IP address and port. The IP address is returned in the first element of the pair, and the port in the second. If the input does not specify an IP address or port, the provided defaults are returned. If the IP address is IPv6, a port is specified, and enclose_ipv6 is true, the IP address will be enclosed in square brackets.

Parameters

address
const std::string &

The address string to parse, which can contain an IPv4 address, an IPv6 address, or a hostname with an optional port. IPv6 addresses with a port must be enclosed in square brackets (e.g., ”[::1]:80”). If the first segment is a colon, it indicates that no IP address is provided before the port, and thus the default IP address is used.

default_ip
const std::string &

The default IP address to return if the address string is empty, does not contain an IP address, or when an IP address cannot be deduced from the address string. This default value is used for both IPv4 and IPv6 addresses when they are not specified in the address string.

default_port
const std::string &

The default port to return if the address string does not specify a port. This should be a string representing a valid port number.

enclose_ipv6
boolDefaults to false

Determines whether to enclose the IPv6 address in square brackets when a port is specified. This parameter is effective only if the address is detected as an IPv6 address and the deduced port is not empty. It defaults to false, meaning that IPv6 addresses will not be enclosed in brackets.

resolve_hostname
boolDefaults to true

Determines whether to resolve the hostname to an IP address. If this parameter is true and the address string contains a hostname, the hostname will be resolved to an IP address. The default value is true.


Member variables

NameTypeDescription
run_driverboolThe flag to run the App Driver.
run_workerboolThe flag to run the App Worker.
driver_addressstd::stringThe address of the App Driver.
worker_addressstd::stringThe address of the App Worker.
worker_targetsstd::vector< std::string >The list of fragments for the App Worker.
config_pathstd::stringThe path to the configuration file.