20.9.3 Serializing and Deserializing Data Samples
There are two TypePlugin operations to serialize a sample into a buffer and deserialize a sample from a buffer. The sample serialization/deserialization uses CDR representation.
The feature is supported in the following languages: C, Modern and Traditional C++, Java, and .NET.

#include "FooSupport.h" FooTypeSupport_serialize_data_to_cdr_buffer(...) FooTypeSupport_deserialize_data_from_cdr_buffer(...)

#include "FooSupport.h" FooTypeSupport::serialize_data_to_cdr_buffer(...) FooTypeSupport::deserialize_data_from_cdr_buffer(...)

#include "Foo.hpp" dds::topic::topic_type_support<Foo>::to_cdr_buffer(...) dds::topic::topic_type_support<Foo>::from_cdr_buffer(...)

FooTypeSupport.get_instance().serialize_to_cdr_buffer(...) FooTypeSupport.get_instance().deserialize_from_cdr_buffer(...)

ISerializer<MyType> serializer = MyTypeSupport.Instance.CreateSerializer(); var sampleBuffer = serializer.Serialize(sample); MyType deserializedSample = serializer.Deserialize(sampleBuffer);