Dynamic Data getters/setters for strings

2 posts / 0 new
Last post
Offline
Last seen: 2 years 7 months ago
Joined: 04/28/2013
Posts: 38
Dynamic Data getters/setters for strings

Hi,

I'm trying to implement a module that would iterate over the members of a dynamic data object, calling get or set method based on the member's typecode.

I was wondering whether I should treat TK_WSTRING as a primitive type? TK_STRING is primitive, and get_string/set_string are used, but I see no such methods in the api for wstring. Calling get_string on a TK_WSTRING member throws an exception.

Interestingly enough, I did find get_wstring/set_wstring in the c++ api. Is there a reason it is missing in java api?

Thanks,

Michael

Fernando Garcia's picture
Offline
Last seen: 3 months 2 weeks ago
Joined: 05/18/2011
Posts: 198

Hi Michael,

I think the reason why there are getters and setters for DDS_TK_WSTRING in C and C++ is the DDS_Wchar data type is internally mapped to RTI_UINT32, instead of just a char like DDS_Char does. However, in the Java implementation all strings are mapped to the native String class.

Best regards,
Fernando.