Retrieve integer enumeration value

2 posts / 0 new
Last post
Offline
Last seen: 2 years 3 weeks ago
Joined: 12/01/2022
Posts: 1
Retrieve integer enumeration value

Hello!

I'm reading a dds log file using sqlite and having troubles to retrieve the original integer values that were specified for enumerations in my *.idl file.

For example:

enum tTest
{
  Value0,
  Value1, 
  Value2
}

struct tMyData
{
  tTest testData;
}; 

When I read testData, I want to get the integer values 0,1 or 2. But instead the json string contains "Value0", "Value1" or "Value2". Is there some setting that I miss during the recording?

Any help is highly appreciated!

/David

 
Organization:
Howard's picture
Offline
Last seen: 6 days 45 min ago
Joined: 11/29/2012
Posts: 618

Sorry, what you do mean by DDS log file?  Are you referring to the RTI Recording Service?  If so, you can record the data in serialized binary format.

Then you can load the serialized blobfor the data sample and use FooTypeSupport::deserialize_data_from_cdr_buffer to convert from the serialized format into the data structure.