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

Function vwrite_struct

dds/DCPS/XTypes/DynamicVwrite.cpp:1019–1059  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1017}
1018
1019bool vwrite_struct(ValueWriter& vw, DDS::DynamicData_ptr value, const DDS::DynamicType_var& dt)
1020{
1021 DDS::TypeDescriptor_var type_desc;
1022 DDS::ReturnCode_t rc = dt->get_descriptor(type_desc);
1023 if (rc != DDS::RETCODE_OK) {
1024 if (log_level >= LogLevel::Notice) {
1025 ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: vwrite_struct: get_descriptor failed (%C)\n",
1026 retcode_to_string(rc)));
1027 }
1028 return false;
1029 }
1030
1031 const Extensibility extensibility = XTypes::dds_to_opendds_ext(type_desc->extensibility_kind());
1032 if (!vw.begin_struct(extensibility)) {
1033 return false;
1034 }
1035 for (CORBA::ULong i = 0; i < dt->get_member_count(); ++i) {
1036 DDS::DynamicTypeMember_var dtm;
1037 rc = dt->get_member_by_index(dtm, i);
1038 if (rc != DDS::RETCODE_OK) {
1039 if (log_level >= LogLevel::Notice) {
1040 ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: vwrite_struct: get_member_by_index %u failed (%C)\n",
1041 i, retcode_to_string(rc)));
1042 }
1043 return false;
1044 }
1045 DDS::MemberDescriptor_var md;
1046 rc = dtm->get_descriptor(md);
1047 if (rc != DDS::RETCODE_OK) {
1048 if (log_level >= LogLevel::Notice) {
1049 ACE_ERROR((LM_NOTICE, "(%P|%t) NOTICE: vwrite_struct:"
1050 " get_descriptor for member at index %u failed (%C)\n", i, retcode_to_string(rc)));
1051 }
1052 return false;
1053 }
1054 if (!vwrite_member(vw, value, md, XTypes::TK_STRUCTURE)) {
1055 return false;
1056 }
1057 }
1058 return vw.end_struct();
1059}
1060
1061bool vwrite_discriminator(ValueWriter& vw, DDS::DynamicData_ptr value,
1062 const DDS::MemberDescriptor_var& md, CORBA::Long& disc_val)

Callers 1

vwriteFunction · 0.85

Calls 8

retcode_to_stringFunction · 0.85
dds_to_opendds_extFunction · 0.85
vwrite_memberFunction · 0.85
get_member_countMethod · 0.80
get_member_by_indexMethod · 0.80
get_descriptorMethod · 0.45
begin_structMethod · 0.45
end_structMethod · 0.45

Tested by

no test coverage detected