Using String Sequences with DDS_DynamicData

1 post / 0 new
Joined: 03/03/2015
Posts: 16
Using String Sequences with DDS_DynamicData



I'm currently using DDS_DynamicData to map my application's type to DDS_DynamicData. However, my application also uses Arrays of strings, which I've mapped over Sequences of Strings in DDS_DynamicData. I've just stumbled upon the problem that I cannot call "DDS_DynamicData::set_string_seq" on a DDS_DynamicData object.

I already know that I can bind to the sequence and set each sequence member sepparately, but I cannot do this in my application because the data that needs to be mapped to DDS_DynamicData comes as a contiguous buffer. 

For example, I'm using a sequence of DDS_TK_CHAR in order to map strings, and then I'm doing the following on it:

DDS_CharSeq charSeq;
charSeq.ensure_length(stringLength, stringLength);
std::memcpy(charSeq.get_contiguous_buffer(), stringData, stringLength);
retCode = sendData->set_char_seq(memberName, DDS_DYNAMIC_DATA_MEMBER_ID_UNSPECIFIED, charSeq);

This is something I want to do for strings as well:

DDS_StringSeq stringSeq;

stringSeq.ensureLength(stringArrayLength, stringArrayLength);

std::memcpy(stringSeq.get_contiguous_buffer(), stringArrayData, stringArrayLength);

retcode = sendData->set_string_Seq(memberName, DDS_DYNAMIC_DATA_MEMBER_ID_UNSPECIFIED, stringSeq);


Can someone tell me if there's a way to set a sequence of strings this way?

Thank you.