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

Method add_types

dds/DCPS/TypeSupportImpl.cpp:119–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void TypeSupportImpl::add_types(const XTypes::TypeLookupService_rch& tls) const
120{
121 using namespace XTypes;
122 if (preset_type_info()) {
123 // In the case where TypeInformation was pre-set, the participant's TypeLookupService
124 // already has the types and dependencies based on responses to RPC requests.
125 return;
126 }
127 const TypeMap& minTypeMap = getMinimalTypeMap();
128 tls->add(minTypeMap.begin(), minTypeMap.end());
129 const TypeMap& comTypeMap = getCompleteTypeMap();
130 tls->add(comTypeMap.begin(), comTypeMap.end());
131
132 if (TheServiceParticipant->type_object_encoding() != Service_Participant::Encoding_Normal) {
133 // In this mode we need to be able to recognize TypeIdentifiers received over the network
134 // by peers that may have encoded them incorrectly. Populate the TypeLookupService with
135 // additional entries that map the alternate (wrong) TypeIdentifiers to the same TypeObjects.
136 Encoding encoding = get_typeobject_encoding();
137 encoding.skip_sequence_dheader(true);
138 TypeMap altMinMap;
139 for (TypeMap::const_iterator iter = minTypeMap.begin(); iter != minTypeMap.end(); ++iter) {
140 const TypeObject& minTypeObject = iter->second;
141 const TypeIdentifier typeId = makeTypeIdentifier(minTypeObject, &encoding);
142 altMinMap[typeId] = minTypeObject;
143 }
144 tls->add(altMinMap.begin(), altMinMap.end());
145
146 TypeMap altComMap;
147 for (TypeMap::const_iterator iter = comTypeMap.begin(); iter != comTypeMap.end(); ++iter) {
148 const TypeObject& comTypeObject = iter->second;
149 const TypeIdentifier typeId = makeTypeIdentifier(comTypeObject, &encoding);
150 altComMap[typeId] = comTypeObject;
151 }
152 tls->add(altComMap.begin(), altComMap.end());
153 }
154 populate_dependencies_i(tls, XTypes::EK_MINIMAL);
155 populate_dependencies_i(tls, XTypes::EK_COMPLETE);
156}
157
158void TypeSupportImpl::populate_dependencies_i(const XTypes::TypeLookupService_rch& tls,
159 XTypes::EquivalenceKind ek) const

Callers 7

enableMethod · 0.45
enableMethod · 0.45
MoreSetupMethod · 0.45
add_typeMethod · 0.45
add_typeMethod · 0.45
add_typeFunction · 0.45
setup_typesupportFunction · 0.45

Calls 6

preset_type_infoFunction · 0.85
makeTypeIdentifierFunction · 0.85
type_object_encodingMethod · 0.80
addMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected