holoscan::ArgumentSetter

Beta
View as Markdown

Class to set arguments for components.

This class is used to set arguments for components (including Operator, Condition, and Resource) from Arg or ArgList.

#include <holoscan/argument_setter.hpp>

Constructors

ArgumentSetter


Methods

get_argument_setter

SetterFunc & holoscan::ArgumentSetter::get_argument_setter(
std::type_index index
)

Get the argument setter function object.

Returns: The reference to the SetterFunc object.

Parameters

index
std::type_index

The type index of the parameter.

add_argument_setter

inline
template <typename typeT>
void holoscan::ArgumentSetter::add_argument_setter(
SetterFunc func
)

Add the SetterFunc for the type.

Template parameters

typeT
typename

TypeT The type of the parameter.

Parameters

func
SetterFunc

The SetterFunc object.


Static methods

get_instance

static ArgumentSetter & holoscan::ArgumentSetter::get_instance()

Get the instance object.

Returns: The reference to the ArgumentSetter instance.

set_param

static void holoscan::ArgumentSetter::set_param(
ParameterWrapper &param_wrap,
Arg &arg
)

Set the param object.

Throws: std::runtime_error if the parameter could not be set.

Parameters

param_wrap
ParameterWrapper &

The ParameterWrapper object.

arg
Arg &

The Arg object to set.

ensure_type

template <typename typeT>
static void holoscan::ArgumentSetter::ensure_type()

Register the SetterFunc for the type.

Template parameters

typeT
typename

The type of the parameter.


Types

Typedefs

NameDefinitionDescription
SetterFuncstd::function< bool(ParameterWrapper &, Arg &)>Function type for setting an argument to the parameter.

Member variables

NameTypeDescription
none_argument_setter staticSetterFuncDefault SetterFunc for Arg.
function_map_std::unordered_map< std::type_index, SetterFunc >Map of type index to setter function.