Class ComponentBase

Holoscan v2.1.0

Derived Types

class ComponentBase

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::Component, holoscan::Operator

Public Functions

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

Construct a new Component object.

virtual ~ComponentBase() = default
inline int64_t id() const

Get the identifier of the component.

By default, the identifier is set to -1. It is set to a valid value when the component is initialized.

With the default executor (GXFExecutor), the identifier is set to the GXF component ID.

inline const std::string &name() const

Get the name of the component.

inline Fragment *fragment()

Get a pointer to Fragment object.

inline void add_arg(const Arg &arg)

Add an argument to the component.

inline void add_arg(Arg &&arg)

Add an argument to the component.

inline void add_arg(const ArgList &arg)

Add a list of arguments to the component.

inline void add_arg(ArgList &&arg)

Add a list of arguments to the component.

inline std::vector<Arg> &args()

Get the list of arguments.

inline virtual void initialize()
virtual YAML::Node to_yaml_node() const

Get a YAML representation of the component.

std::string description() const

Get a description of the component.


Protected Functions

void update_params_from_args(std::unordered_map<std::string, ParameterWrapper> &params)
virtual void reset_graph_entities()

Protected Attributes

int64_t id_ = -1
std::string name_ = ""
Fragment *fragment_ = nullptr
std::vector<Arg> args_


friend class holoscan::Executor
friend class holoscan::gxf::GXFExecutor
friend class holoscan::Fragment

Previous Class Component
Next Class ComponentSpec
© Copyright 2022-2024, NVIDIA. Last updated on Jun 17, 2024.