Dynamic Data: Nested Structures

Concept

Dynamic data API allows to create topic samples in a programmatically manner without defining an IDL in compile time. Analogously to the IDL based approach, the DynamicData API provide methods to get/set complex members in dynamic data samples.

Example Description

In this example, we use the two Dynamic Data APIs provided by RTI Connext DDS to access to sample members that are not one of the primitive types.

The first API, the bind/unbind API, allows to reference of a complex member using a new Dynamic Data object. This binding is a reference to the original nested member, so any modification on this object will affect the original member.

The second API the get/set API, copies the value of a Dynamic Data complex member into a new Dynamic Dat a objet. As a consequence, any modification on the newly created object will not affect the original member.

The datatypes used for our examples are the following ones:

struct InnerStruct {
   double x;
   double y;
}; 

struct OuterStruct {
   InnerStruct inner;
}; 

Download Example

Browse Example

Languages: