Class Component

Derived Types

class Component

Base class for all components.

This class is the base class for all components including holoscan::Operator, holoscan::Condition, and holoscan::Resource. It is used to define the common interface for all components.

Subclassed by holoscan::Condition, holoscan::Operator, holoscan::Resource

Public Functions

Component() = default

template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<Component, std::decay_t<ArgT>> && (std::is_same_v<Arg, std::decay_t<ArgT>> || std::is_same_v<ArgList, std::decay_t<ArgT>>)>>
inline Component(ArgT &&arg, ArgsT&&... args)

Construct a new Component object.

Parameters:

args – The arguments to be passed to the component.

virtual ~Component() = default

inline const std::string &name() const

Get the name of the component.

Returns:

The name of the component.

inline Fragment *fragment()

Get a pointer to Fragment object.

Returns:

The Pointer to Fragment object.

inline void add_arg(const Arg &arg)

Add an argument to the component.

Parameters:

arg – The argument to add.

inline void add_arg(Arg &&arg)

Add an argument to the component.

Parameters:

arg – The argument to add.

inline void add_arg(const ArgList &arg)

Add a list of arguments to the component.

Parameters:

arg – The list of arguments to add.

inline void add_arg(ArgList &&arg)

Add a list of arguments to the component.

Parameters:

arg – The list of arguments to add.

inline virtual void initialize()

Initialize the component.

This method is called only once when the codelet is created for the first time, and use of light-weight initialization.

Protected Attributes

std::string name_

Name of the component.

Fragment *fragment_ = nullptr

Pointer to the fragment that owns this component.

std::vector<Arg> args_

List of arguments.

© Copyright 2022, NVIDIA. Last updated on Jun 28, 2023.