holoscan::ComponentSpec

Beta
View as Markdown

Class to define the specification of a component.

#include <holoscan/component_spec.hpp>

Constructors

ComponentSpec

holoscan::ComponentSpec::ComponentSpec(
Fragment *fragment = nullptr
)

Construct a new ComponentSpec object.

Parameters

fragment
Fragment *Defaults to nullptr

The pointer to the fragment that contains this component.

Destructor

~ComponentSpec

virtual holoscan::ComponentSpec::~ComponentSpec() = default

Methods

fragment

void holoscan::ComponentSpec::fragment(
Fragment *fragment
)

Set the pointer to the fragment that contains this component.

Parameters

fragment
Fragment *

The pointer to the fragment that contains this component.

param

inline
template <typename typeT>
void holoscan::ComponentSpec::param(
Parameter<typeT> &parameter,
const char *key,
ParameterFlag flag = ParameterFlag::kNone
)

Define a parameter for this component.

Template parameters

typeT
typename

The type of the parameter.

Parameters

parameter
Parameter<typeT> &

The parameter to define.

key
const char *

The key (name) of the parameter.

flag
ParameterFlagDefaults to ParameterFlag::kNone

The flag of the parameter (default: ParameterFlag::kNone).

params

std::unordered_map<std::string, ParameterWrapper> & holoscan::ComponentSpec::params()

Get the parameters of this component.

Returns: The reference to the parameters of this component.

to_yaml_node

virtual YAML::Node holoscan::ComponentSpec::to_yaml_node() const

Get a YAML representation of the component spec.

Returns: YAML node including the parameters of this component.

description

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

Get a description of the component spec.

Returns: YAML string.

See also: to_yaml_node()


Member variables

NameTypeDescription
fragment_Fragment *The pointer to the fragment that contains this component.
params_std::unordered_map< std::string, ParameterWrapper >The parameters of this component.