Class OperatorSpec

class OperatorSpec : public holoscan::ComponentSpec

Class to define the specification of an operator.

Public Functions

inline explicit OperatorSpec(Fragment *fragment = nullptr)

Construct a new OperatorSpec object.

Parameters

fragment – The pointer to the fragment that contains this operator.

inline std::unordered_map<std::string, std::unique_ptr<IOSpec>> &inputs()

Get input specifications of this operator.

Returns

The reference to the input specifications of this operator.

template<typename DataT>
inline IOSpec &input()

Define an input specification for this operator.

Template Parameters

DataT – The type of the input data.

Returns

The reference to the input specification.

template<typename DataT>
inline IOSpec &input(std::string name)

Define an input specification for this operator.

Template Parameters

DataT – The type of the input data.

Parameters

name – The name of the input specification.

Returns

The reference to the input specification.

inline std::unordered_map<std::string, std::unique_ptr<IOSpec>> &outputs()

Get output specifications of this operator.

Returns

The reference to the output specifications of this operator.

template<typename DataT>
inline IOSpec &output()

Define an output specification for this operator.

Template Parameters

DataT – The type of the output data.

Returns

The reference to the output specification.

template<typename DataT>
inline IOSpec &output(std::string name)

Define an output specification for this operator.

Template Parameters

DataT – The type of the output data.

Parameters

name – The name of the output specification.

Returns

The reference to the output specification.

inline void param(Parameter<holoscan::IOSpec*> &parameter, const char *key, const char *headline, const char *description)

Define an IOSpec* parameter for this operator.

Parameters
  • parameter – The parameter to define.

  • key – The key (name) of the parameter.

  • headline – The headline of the parameter.

  • description – The description of the parameter.

inline void param(Parameter<holoscan::IOSpec*> &parameter, const char *key, const char *headline, const char *description, holoscan::IOSpec *default_value)

Define an IOSpec* parameter with a default value for this operator.

Parameters
  • parameter – The parameter to define.

  • key – The key (name) of the parameter.

  • headline – The headline of the parameter.

  • description – The description of the parameter.

  • default_value – The default value of the parameter.

inline void param(Parameter<std::vector<holoscan::IOSpec*>> &parameter, const char *key, const char *headline, const char *description)

Define a IOSpec* vector parameter for this operator.

Parameters
  • parameter – The parameter to define.

  • key – The key (name) of the parameter.

  • headline – The headline of the parameter.

  • description – The description of the parameter.

inline void param(Parameter<std::vector<holoscan::IOSpec*>> &parameter, const char *key, const char *headline, const char *description, std::vector<holoscan::IOSpec*> default_value)

Define an IOSpec* parameter with a default value for this operator.

Parameters
  • parameter – The parameter to define.

  • key – The key (name) of the parameter.

  • headline – The headline of the parameter.

  • description – The description of the parameter.

  • default_value – The default value of the parameter.

template<typename ResourceT, typename StringT, typename ...ArgsT, typename = std::enable_if_t<std::is_constructible_v<std::string, StringT>>>
inline void resource(const StringT &name, ArgsT&&... args)

Define a resource that is required by this operator.

Template Parameters

ResourceT – The type of the resource.

Parameters
  • name – The name of the resource.

  • args – The arguments to construct the resource.

template<typename ...ArgsT>
inline void resource(ArgsT&&... args)

Define a resource that is required by this operator.

Parameters

args – The arguments to construct the resource.

template<typename ConditionT, typename StringT, typename ...ArgsT, typename = std::enable_if_t<std::is_constructible_v<std::string, StringT>>>
inline void condition(const StringT &name, ArgsT&&... args)

Define a condition that is required by this operator.

Template Parameters

ConditionT – The type of the condition.

Parameters
  • name – The name of the condition.

  • args – The arguments to construct the condition.

template<typename ConditionT, typename ...ArgsT>
inline void condition(ArgsT&&... args)

Define a condition that is required by this operator.

Parameters

args – The arguments to construct the condition.

template<typename typeT>
inline void param(Parameter<typeT> &parameter, const char *key)

Define a parameter for this component.

Template Parameters

typeT – The type of the parameter.

Parameters
  • parameter – The parameter to define.

  • key – The key (name) of the parameter.

template<typename typeT>
inline void param(Parameter<typeT> &parameter, const char *key, const char *headline)

Define a parameter for this component.

Template Parameters

typeT – The type of the parameter.

Parameters
  • parameter – The parameter to define.

  • key – The key (name) of the parameter.

  • headline – The headline of the parameter.

template<typename typeT>
void param(Parameter<typeT> &parameter, const char *key, const char *headline, const char *description)

Define a parameter for this component.

Template Parameters

typeT – The type of the parameter.

Parameters
  • parameter – The parameter to define.

  • key – The key (name) of the parameter.

  • headline – The headline of the parameter.

  • description – The description of the parameter.

template<typename typeT>
void param(Parameter<typeT> &parameter, const char *key, const char *headline, const char *description, typeT default_value)

Define a parameter that has a default value.

Template Parameters

typeT – The type of the parameter.

Parameters
  • parameter – The parameter to get.

  • key – The key (name) of the parameter.

  • headline – The headline of the parameter.

  • description – The description of the parameter.

  • default_value – The default value of the parameter.

Protected Attributes

std::unordered_map<std::string, std::unique_ptr<IOSpec>> inputs_

Input specs.

std::unordered_map<std::string, std::unique_ptr<IOSpec>> outputs_

Outputs specs.

std::unordered_map<std::string, std::shared_ptr<Condition>> conditions_

Conditions.

std::unordered_map<std::string, std::shared_ptr<Resource>> resources_

Resources.

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