holoscan::FastDdsHoloscanEntityTypeSupport

Beta
View as Markdown

DDS TopicDataType implementation for HoloscanEntityData.

This class implements the FastDDS TopicDataType interface, enabling HoloscanEntityData to be used as a DDS topic type. It handles:

  • CDR serialization/deserialization using FastCDR
  • Memory management for data instances
  • Size calculation for DDS
#include <holoscan/fastdds_holoscan_entity_type_support.hpp>

Inherits from: eprosima::fastdds::dds::TopicDataType (public)


Constructors

FastDdsHoloscanEntityTypeSupport

Construct a new FastDdsHoloscanEntityTypeSupport.

Sets the type name to “holoscan::Entity” and configures for variable-size data.

Uses a 1MB initial max_serialized_type_size for payload pool allocation. With FastDDS’s default PREALLOCATED_WITH_REALLOC_MEMORY_MODE, larger messages (10-100+ MB tensors) will trigger automatic reallocation. The actual size per message is determined by calculate_serialized_size().

FastDDS 3.4.2 Bug: Documentation says to use 0 for unbounded types, but this causes a null pointer crash in TopicPayloadPoolProxy::reserve_history().

Destructor

~FastDdsHoloscanEntityTypeSupport

Destructor.


Assignment operators

operator=


Methods

serialize

bool holoscan::FastDdsHoloscanEntityTypeSupport::serialize(
const void *data,
eprosima::fastdds::rtps::SerializedPayload_t &payload,
eprosima::fastdds::dds::DataRepresentationId_t data_representation
) override

Serialize HoloscanEntityData to CDR format.

Returns: true on success, false on failure

Parameters

data
const void *

Pointer to HoloscanEntityData to serialize

payload
eprosima::fastdds::rtps::SerializedPayload_t &

Output serialized payload

data_representation
eprosima::fastdds::dds::DataRepresentationId_t

Data representation (CDR encoding)

deserialize

bool holoscan::FastDdsHoloscanEntityTypeSupport::deserialize(
eprosima::fastdds::rtps::SerializedPayload_t &payload,
void *data
) override

Deserialize CDR format to HoloscanEntityData.

Returns: true on success, false on failure

Parameters

payload
eprosima::fastdds::rtps::SerializedPayload_t &

Input serialized payload

data
void *

Pointer to HoloscanEntityData to populate

calculate_serialized_size

uint32_t holoscan::FastDdsHoloscanEntityTypeSupport::calculate_serialized_size(
const void *data,
eprosima::fastdds::dds::DataRepresentationId_t data_representation
) override

Get the serialized size of a HoloscanEntityData instance.

Returns: Size in bytes when serialized

Parameters

data
const void *
data_representation
eprosima::fastdds::dds::DataRepresentationId_t

Data representation (CDR encoding)

create_data

void * holoscan::FastDdsHoloscanEntityTypeSupport::create_data() override

Create a new HoloscanEntityData instance.

Returns: Pointer to newly allocated HoloscanEntityData

delete_data

void holoscan::FastDdsHoloscanEntityTypeSupport::delete_data(
void *data
) override

Delete a HoloscanEntityData instance.

Parameters

data
void *

Pointer to HoloscanEntityData to delete

compute_key

bool holoscan::FastDdsHoloscanEntityTypeSupport::compute_key(
eprosima::fastdds::rtps::SerializedPayload_t &payload,
eprosima::fastdds::rtps::InstanceHandle_t &handle,
bool force_md5
) override

Check if this type has a key.

HoloscanEntityData does not use keyed topics.

Returns: false (no key defined)

is_bounded

bool holoscan::FastDdsHoloscanEntityTypeSupport::is_bounded() const override

Check if this type is bounded.

Returns: false (variable-size type with serialized_data vector)

is_plain

bool holoscan::FastDdsHoloscanEntityTypeSupport::is_plain(
eprosima::fastdds::dds::DataRepresentationId_t
) const override

Check if this type is plain (all members have fixed size and no optional).

Returns: false (contains variable-size vector and string)