NVIDIA Holoscan SDK v0.5.1
Holoscan v0.5.1

Class Message

class Message

Class to define a message.

A message is a data structure that is used to pass data between operators. It wraps a std::any object and provides a type-safe interface to access the data.

This class is used by the holoscan::gxf::GXFWrapper to support the Holoscan native operator. The holoscan::gxf::GXFWrapper will hold the object of this class and delegate the message to the Holoscan native operator.

Public Functions

Message() = default

Construct a new Message object.

inline explicit Message(std::any value)

Construct a new Message object.

Parameters

value – The value to be wrapped by the message.

template<typename ValueT>
inline void set_value(ValueT value)

Set the value object.

Template Parameters

ValueT – The type of the value.

Parameters

value – The value to be wrapped by the message.

inline std::any value() const

Get the value object.

Returns

The value wrapped by the message.

template<typename ValueT>
inline std::shared_ptr<ValueT> as() const

Get the value object as a specific type.

Template Parameters

ValueT – The type of the value to be returned.

Returns

The value wrapped by the message.

© Copyright 2022-2023, NVIDIA. Last updated on Jul 28, 2023.