| 1389 | } |
| 1390 | |
| 1391 | bool 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 |
no test coverage detected