PRESWriterHistoryDriver_initializeSample:!serialize

4 posts / 0 new
Last post
Offline
Last seen: 1 month 1 week ago
Joined: 01/13/2016
Posts: 58
PRESWriterHistoryDriver_initializeSample:!serialize

Hi,everyone

I create dynamicdata sequence idl like this:

struct block {
double lon;
//@ID 1
//@Optional
char[10] name;
//@ID 2
//@Optional
}; //@Extensibility EXTENSIBLE_EXTENSIBILITY
struct POS {
double t;
//@ID 1
//@Optional
sequence<block,20> d;
//@ID 2
//@Optional
}; //@Extensibility EXTENSIBLE_EXTENSIBILITY

When I send variable length data at the third time, it cames error:

PRESWriterHistoryDriver_initializeSample:!serialize
WriterHistoryMemoryPlugin_addEntryToSessions:!initialize sample
WriterHistoryMemoryPlugin_getEntry:!add virtual sample to sessions
WriterHistoryMemoryPlugin_addSample:!get entry
PRESWriterHistoryDriver_addWrite:!add_sample
PRESPsWriter_writeInternal:!collator addWrite

what is the possible reason?

Offline
Last seen: 1 month 1 week ago
Joined: 01/13/2016
Posts: 58

parts of code liks this:

portSeqData = DDS_DynamicData_new((DDS_TypeCode*)portSeqTc, (const DDS_DynamicDataProperty_t*)&DDS_DYNAMIC_DATA_PROPERTY_DEFAULT);
portStrData = DDS_DynamicData_new((DDS_TypeCode*)portStrTc, (const DDS_DynamicDataProperty_t*)&DDS_DYNAMIC_DATA_PROPERTY_DEFAULT);

for (int n = 0; n < nSliceNumber; n++)
{
char *eledata = data + n*net.structList[index].len;
if (DDS_RETCODE_OK == DDS_DynamicData_bind_complex_member((DDS_DynamicData *)portSeqData, (DDS_DynamicData *)portStrData, NULL, 1 + n))
{
for (int i = 0; i < net.structList[index].memList.size(); i++)
{
int element = net.structList[index].memList[i].col;
char *ptr = eledata + net.structList[index].memList[i].offset;
if (1 == element)
{
switch (net.structList[index].memList[i].dt)
{
case eBoolean:
DDS_DynamicData_set_boolean((DDS_DynamicData *)portStrData, NULL, 1 + i, *(DDS_Boolean*)(ptr));
break;
case eInteger:
DDS_DynamicData_set_long((DDS_DynamicData *)portStrData, NULL, 1 + i, *(DDS_Long*)(ptr));
break;
case eReal:
DDS_DynamicData_set_double((DDS_DynamicData *)portStrData, NULL, 1 + i, *(DDS_Double*)(ptr));
break;
case eFloat:
DDS_DynamicData_set_float((DDS_DynamicData *)portStrData, NULL, 1 + i, *(DDS_Float*)(ptr));
break;
case eShort:
DDS_DynamicData_set_short((DDS_DynamicData *)portStrData, NULL, 1 + i, *(DDS_Short*)(ptr));
break;
case eByte:
DDS_DynamicData_set_octet((DDS_DynamicData *)portStrData, NULL, 1 + i, *(DDS_Octet*)(ptr));
break;
case eChar:
DDS_DynamicData_set_char((DDS_DynamicData *)portStrData, NULL, 1 + i, *(DDS_Char*)(ptr));
break;
case eLonglong:
DDS_DynamicData_set_longlong((DDS_DynamicData *)portStrData, NULL, 1 + i, *(DDS_LongLong*)(ptr));
break;
case eLongdouble:
DDS_DynamicData_set_longdouble((DDS_DynamicData *)portStrData, NULL, 1 + i, *(DDS_LongDouble*)ptr);
break;
} //switch
} //if
else
{
switch (net.structList[index].memList[i].dt)
{
case eBoolean:
DDS_DynamicData_set_boolean_array((DDS_DynamicData *)portStrData, NULL, 1 + i, element, (DDS_Boolean*)ptr);
break;
case eInteger:
DDS_DynamicData_set_long_array((DDS_DynamicData *)portStrData, NULL, 1 + i, element, (DDS_Long*)ptr);
break;
case eReal:
DDS_DynamicData_set_double_array((DDS_DynamicData *)portStrData, NULL, 1 + i, element, (DDS_Double*)ptr);
break;
case eFloat:
DDS_DynamicData_set_float_array((DDS_DynamicData *)portStrData, NULL, 1 + i, element, (DDS_Float*)ptr);
break;
case eShort:
DDS_DynamicData_set_short_array((DDS_DynamicData *)portStrData, NULL, 1 + i, element, (DDS_Short*)ptr);
break;
case eByte:
DDS_DynamicData_set_octet_array((DDS_DynamicData *)portStrData, NULL, 1 + i, element, (DDS_Octet*)ptr);
break;
case eChar:
DDS_DynamicData_set_char_array((DDS_DynamicData *)portStrData, NULL, 1 + i, element, (DDS_Char*)ptr);
break;
case eLonglong:
DDS_DynamicData_set_longlong_array((DDS_DynamicData *)portStrData, NULL, 1 + i, element, (DDS_LongLong*)ptr);
break;
case eLongdouble:
DDS_DynamicData_set_longdouble_array((DDS_DynamicData *)portStrData, NULL, 1 + i, element, (DDS_LongDouble*)ptr);
break;
} //switch
}//else
}//for int i

DDS_DynamicData_unbind_complex_member((DDS_DynamicData *)portSeqData, (DDS_DynamicData *)portStrData);
}//DDS_RETCODE_OK
}//for

DDS_DynamicData_set_complex_member((DDS_DynamicData *)portData, NULL, 2, (DDS_DynamicData *)portSeqData);

DDS_DynamicData_delete((DDS_DynamicData *)portSeqData);
DDS_DynamicData_delete((DDS_DynamicData *)portStrData);

Offline
Last seen: 1 month 1 week ago
Joined: 01/13/2016
Posts: 58

thanks  for any replys.

Howard's picture
Offline
Last seen: 1 hour 53 min ago
Joined: 11/29/2012
Posts: 612

Sorry pretty difficult to understand what the problem is.  At what line of code is the error message printed?  Also, if you could format your posting of code to make it more readable, it would help.