holoscan::get_well_formed_name

Beta
View as Markdown
static std::string holoscan::get_well_formed_name(
const char *name,
const std::unordered_map<std::string, std::shared_ptr<IOSpec>> &io_list
)

Get a well-formed port name from a given name and IO specification list.

When the input name is null or empty, this method attempts to determine an appropriate port name based on the following rules:

  • If there is exactly one port, use its name
  • Otherwise return an empty string

Returns: A well-formed port name or empty string if no appropriate name can be determined.

Parameters

name
const char *

The input port name (can be null or empty).

io_list
const std::unordered_map<std::string, std::shared_ptr<IOSpec>> &

Map of IO specifications containing port names and their specs.