Hello,
How do you use the Dynamic Data C API to create and register a type defined with IDL inheritance? For example, given the following IDL, how is the type Square created and registered so that DDS knows that it is derived from type Shape?
struct Shape
{
float area;
}
struct Square: Shape {
float side_length;
}
Hello,
in order to do that you have to use DDS_TypeCodeFactory_create_value_tc that gets the base class as a parameter.
First thing to do is to create the type code for the type:
To verify that the type is what you want you can call the print_IDL function:
You shold get:
Now you can proceed as usual registering the type and creating the topic
Let me know if this answers your question.
Best,
Gianpiero