| 117 | } |
| 118 | |
| 119 | void 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 | |
| 158 | void TypeSupportImpl::populate_dependencies_i(const XTypes::TypeLookupService_rch& tls, |
| 159 | XTypes::EquivalenceKind ek) const |
no test coverage detected