| 7160 | } |
| 7161 | |
| 7162 | void Sedp::match(const GUID_t& writer, const GUID_t& reader) |
| 7163 | { |
| 7164 | if (DCPS_debug_level >= 4) { |
| 7165 | ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::match: w: %C r: %C\n", |
| 7166 | LogGuid(writer).c_str(), LogGuid(reader).c_str())); |
| 7167 | } |
| 7168 | |
| 7169 | // 1. collect type info about the writer, which may be local or discovered |
| 7170 | const XTypes::TypeInformation* writer_type_info = 0; |
| 7171 | const LocalPublicationIter lpi = local_publications_.find(writer); |
| 7172 | DiscoveredPublicationIter dpi; |
| 7173 | bool writer_local = false; |
| 7174 | if (lpi != local_publications_.end()) { |
| 7175 | writer_local = true; |
| 7176 | bool used_flexible_types = false; |
| 7177 | writer_type_info = lpi->second.typeInfoFor(reader, &used_flexible_types); |
| 7178 | if (!used_flexible_types && (lpi->second.type_info_.flags_ & DCPS::TypeInformation::Flags_FlexibleTypeSupport)) { |
| 7179 | if (DCPS_debug_level >= 4) { |
| 7180 | ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::match: Local writer with Flexible TS and no type\n")); |
| 7181 | } |
| 7182 | const DCPS::DataWriterCallbacks_rch callbacks = lpi->second.publication_.lock(); |
| 7183 | if (callbacks) { |
| 7184 | const DCPS::String typeKey = spdp_.find_flexible_types_key_i(reader); |
| 7185 | if (typeKey != "") { |
| 7186 | writer_type_info = lpi->second.getFlexibleTypes(callbacks, reader, typeKey.c_str()); |
| 7187 | } |
| 7188 | } |
| 7189 | } |
| 7190 | } else if ((dpi = discovered_publications_.find(writer)) |
| 7191 | != discovered_publications_.end()) { |
| 7192 | writer_type_info = &dpi->second.type_info_; |
| 7193 | } else { |
| 7194 | if (DCPS_debug_level >= 4) { |
| 7195 | ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::match: Undiscovered Writer\n")); |
| 7196 | } |
| 7197 | return; // Possible and ok, since lock is released |
| 7198 | } |
| 7199 | |
| 7200 | // 2. collect type info about the reader, which may be local or discovered |
| 7201 | const XTypes::TypeInformation* reader_type_info = 0; |
| 7202 | const LocalSubscriptionIter lsi = local_subscriptions_.find(reader); |
| 7203 | DiscoveredSubscriptionIter dsi; |
| 7204 | bool reader_local = false; |
| 7205 | if (lsi != local_subscriptions_.end()) { |
| 7206 | reader_local = true; |
| 7207 | bool used_flexible_types = false; |
| 7208 | reader_type_info = lsi->second.typeInfoFor(writer, &used_flexible_types); |
| 7209 | if (!used_flexible_types && (lsi->second.type_info_.flags_ & DCPS::TypeInformation::Flags_FlexibleTypeSupport)) { |
| 7210 | if (DCPS_debug_level >= 4) { |
| 7211 | ACE_DEBUG((LM_DEBUG, "(%P|%t) Sedp::match: Local reader with Flexible TS and no type\n")); |
| 7212 | } |
| 7213 | const DCPS::DataReaderCallbacks_rch callbacks = lsi->second.subscription_.lock(); |
| 7214 | if (callbacks) { |
| 7215 | const DCPS::String typeKey = spdp_.find_flexible_types_key_i(writer); |
| 7216 | if (typeKey != "") { |
| 7217 | reader_type_info = lsi->second.getFlexibleTypes(callbacks, writer, typeKey.c_str()); |
| 7218 | } |
| 7219 | } |
no test coverage detected