MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / vwrite_sequence

Function vwrite_sequence

dds/DCPS/XTypes/DynamicVwrite.cpp:1391–1416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1389}
1390
1391bool vwrite_sequence(ValueWriter& vw, DDS::DynamicData_ptr value, const DDS::DynamicType_var& dt)
1392{
1393 DDS::TypeDescriptor_var td;
1394 DDS::ReturnCode_t rc = dt->get_descriptor(td);
1395 if (rc != DDS::RETCODE_OK) {
1396 if (log_level >= LogLevel::Notice) {
1397 ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: vwrite_sequence: get_descriptor failed (%C)\n",
1398 retcode_to_string(rc)));
1399 }
1400 return false;
1401 }
1402 DDS::DynamicType_var elem_type = XTypes::get_base_type(td->element_type());
1403 const CORBA::ULong length = value->get_item_count();
1404
1405 if (!vw.begin_sequence(elem_type->get_kind(), length)) {
1406 return false;
1407 }
1408 for (CORBA::ULong i = 0; i < length; ++i) {
1409 if (!vw.begin_element(i) ||
1410 !vwrite_element(vw, value, elem_type, i) ||
1411 !vw.end_element()) {
1412 return false;
1413 }
1414 }
1415 return vw.end_sequence();
1416}
1417
1418}
1419

Callers 1

vwriteFunction · 0.85

Calls 11

retcode_to_stringFunction · 0.85
get_base_typeFunction · 0.85
vwrite_elementFunction · 0.85
element_typeMethod · 0.80
get_kindMethod · 0.80
get_descriptorMethod · 0.45
get_item_countMethod · 0.45
begin_sequenceMethod · 0.45
begin_elementMethod · 0.45
end_elementMethod · 0.45
end_sequenceMethod · 0.45

Tested by

no test coverage detected