holoscan::ArgList

Beta
View as Markdown

Vector-like container for holding the arguments.

#include <holoscan/arg.hpp>

Constructors

ArgList

holoscan::ArgList::ArgList() = defaultholoscan::ArgList::ArgList() = default

Destructor

~ArgList

holoscan::ArgList::~ArgList() = defaultholoscan::ArgList::~ArgList() = default

Methods

size

size_t holoscan::ArgList::size() const

Get the number of arguments.

Returns: The number of arguments.

begin

std::vector<Arg>::iterator holoscan::ArgList::begin()std::vector<Arg>::iterator holoscan::ArgList::begin()

Return an iterator to the beginning.

Returns: The iterator to the first element.

end

std::vector<Arg>::iterator holoscan::ArgList::end()std::vector<Arg>::iterator holoscan::ArgList::end()

Return an iterator to the end.

Returns: The iterator to the element following the last element.

clear

void holoscan::ArgList::clear()

Erase all elements from the container.

args

std::vector<Arg> & holoscan::ArgList::args()std::vector<Arg> & holoscan::ArgList::args()

Get the vector of arguments.

Returns: The reference to the vector of arguments.

as

template <typename typeT>
typeT holoscan::ArgList::as()

Get the value of the argument as a specific type.

This method takes a type as a template parameter and returns the value of the argument as that type. Only the first item in the argument list is taken into account.

If the cast fails, an error message is logged and a default value for the type is returned.

Example:

Returns: The value of the argument as the specified type.

Template parameters

typeT
typename

The type to cast the argument to.

Example

auto is_rdma = from_config("obj.rdma").as<bool>();

add

void holoscan::ArgList::add(
const Arg &arg
)

Add an argument to the list.

Parameters

arg
const Arg &

The argument to add.

name

const std::string & holoscan::ArgList::name() const

Get the name of the argument list.

Returns: The name of the argument list.

to_yaml_node

YAML::Node holoscan::ArgList::to_yaml_node() const

Get a YAML representation of the argument list.

Returns: YAML node including the name, and arguments of the argument list.

description

std::string holoscan::ArgList::description() const

Get a description of the argument list.

Returns: YAML string.

See also: to_yaml_node()


Member variables

NameTypeDescription
name_std::stringThe name of the argument list.
args_std::vector< Arg >The vector of arguments.