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

Method skip_all

dds/DCPS/XTypes/DynamicDataXcdrReadImpl.cpp:2748–2828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2746}
2747
2748bool DynamicDataXcdrReadImpl::skip_all()
2749{
2750 const TypeKind tk = type_->get_kind();
2751 if (tk != TK_STRUCTURE && tk != TK_UNION) {
2752 return false;
2753 }
2754
2755 const DDS::ExtensibilityKind extensibility = type_desc_->extensibility_kind();
2756 if (strm_.encoding().kind() == DCPS::Encoding::KIND_XCDR2 && (extensibility == DDS::APPENDABLE || extensibility == DDS::MUTABLE)) {
2757 size_t dheader;
2758 if (!strm_.read_delimiter(dheader)) {
2759 if (DCPS::DCPS_debug_level >= 1) {
2760 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) DynamicDataXcdrReadImpl::skip_all - Failed to read")
2761 ACE_TEXT(" DHEADER of the DynamicData object\n")));
2762 }
2763 return false;
2764 }
2765 return skip("skip_all", "Failed to skip the whole DynamicData object\n", dheader);
2766 } else {
2767 if (tk == TK_STRUCTURE) {
2768 const ACE_CDR::ULong member_count = type_->get_member_count();
2769 bool good = true;
2770 for (ACE_CDR::ULong i = 0; i < member_count; ++i) {
2771 ACE_CDR::ULong num_skipped;
2772 if (!skip_struct_member_at_index(i, num_skipped)) {
2773 good = false;
2774 break;
2775 }
2776 }
2777 return good;
2778 } else { // Union
2779 const DDS::DynamicType_var disc_type = get_base_type(type_desc_->discriminator_type());
2780 ACE_CDR::Long label;
2781 if (!read_discriminator(disc_type, extensibility, label)) {
2782 return false;
2783 }
2784
2785#if OPENDDS_CONFIG_IDL_MAP
2786 DDS::DynamicTypeMembersById members;
2787 if (type_->get_all_members(members) != DDS::RETCODE_OK) {
2788 return false;
2789 }
2790
2791 bool has_default = false;
2792 DDS::MemberDescriptor_var default_member;
2793 for (DDS::DynamicTypeMembersById::const_iterator it = members.begin(); it != members.end(); ++it) {
2794 DDS::MemberDescriptor_var md;
2795 if (it->second->get_descriptor(md) != DDS::RETCODE_OK) {
2796 return false;
2797 }
2798 const DDS::UnionCaseLabelSeq& labels = md->label();
2799 for (ACE_CDR::ULong i = 0; i < labels.length(); ++i) {
2800 if (label == labels[i]) {
2801 const DDS::DynamicType_ptr selected_member = md->type();
2802 bool good = selected_member && skip_member(selected_member);
2803 return good;
2804 }
2805 }

Callers 1

Calls 10

skipFunction · 0.85
get_base_typeFunction · 0.85
get_kindMethod · 0.80
get_member_countMethod · 0.80
get_all_membersMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
get_descriptorMethod · 0.45
lengthMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected