Deserializing DATA(W) Message Using DynamicData and XML

1 post / 0 new
LiveDDS's picture
Offline
Last seen: 4 months 3 weeks ago
Joined: 11/20/2023
Posts: 3
Deserializing DATA(W) Message Using DynamicData and XML

We have a question about deserializing the serializedData (specifically the publicationBuiltinTopicData) in a DATA(W).
Our goal is to use the DynamicData API along with an XML description to achieve this.

Here's what we are considering:

1. Convert the IDL of publicationBuiltinTopicData to XML.
2. Use the following code snippet to create the DynamicData:

dds::core::QosProvider qos_provider("path/to/publicationBuiltinTopicData.xml");

const xtypes::DynamicType& d_type = qos_provider.extensions().type(type_name);

3. Then, call rti::topic::from_cdr_buffer_no_alloc(d_type, serializedData); to deserialize.

My question is, will this approach work as intended?
Are there any potential pitfalls or considerations I should be aware of when using
DynamicData with XML description of publicationBuiltinTopicData in this context?

 
Organization: