NVIDIA Holoscan SDK v0.4.0
Clara Holoscan v0.4.0

Class IOSpec

class IOSpec

Class to define the specification of an input/output port of an Operator.

An interaction point between two operators. Operators ingest data at Input ports and publish data at Output ports. Receiver, Transmitter, and MessageRouter in GXF would be replaced with the concept of Input/Output Port of the Operator and the Flow (Edge) of the Application Workflow (DAG) in the Framework.

Public Types

enum class IOType

Input/Output type.

Values:

enumerator kInput

enumerator kOutput

Public Functions

inline IOSpec(OperatorSpec *op_spec, const std::string &name, IOType io_type)

Construct a new IOSpec object.

Parameters
  • op_spec – The pointer to the operator specification that contains this input/output.

  • name – The name of this input/output.

  • io_type – The type of this input/output.

inline IOSpec(OperatorSpec *op_spec, const std::string &name, IOType io_type, const std::type_info *typeinfo)

Construct a new IOSpec object.

Parameters
  • op_spec – The pointer to the operator specification that contains this input/output.

  • name – The name of this input/output.

  • io_type – The type of this input/output.

  • typeinfo – The type info of the data of this input/output.

inline OperatorSpec *op_spec() const

Get the operator specification that contains this input/output.

Returns

The pointer to the operator specification that contains this input/output.

inline const std::string &name() const

Get the name of this input/output.

Returns

The name of this input/output.

inline IOType io_type() const

Get the input/output type.

Returns

The input/output type.

inline const std::type_info *typeinfo() const

Get the type info of the data of this input/output.

Returns

The type info of the data of this input/output.

inline std::shared_ptr<Resource> resource() const

Get the resource of this input/output.

Returns

The resource of this input/output.

inline void resource(std::shared_ptr<Resource> resource)

Set the resource of this input/output.

Parameters

resource – The resource of this input/output.

inline std::vector<std::pair<ConditionType, std::shared_ptr<Condition>>> &conditions()

Get the conditions of this input/output.

Returns

The reference to the conditions of this input/output.

template<typename ...ArgsT>
inline IOSpec &condition(ConditionType type, ArgsT&&... args)

Add a condition to this input/output.

The following ConditionTypes are supported:

  • ConditionType::kMessageAvailable

  • ConditionType::kDownstreamAffordable

  • ConditionType::kCount

  • ConditionType::kBoolean

  • ConditionType::kNone

Parameters
  • type – The type of the condition.

  • args – The arguments of the condition.

Returns

The reference to this IOSpec.

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