| 301 | |
| 302 | template<typename Sample, typename TypedDataReader> |
| 303 | DDS::ReturnCode_t |
| 304 | MultiTopicDataReader_T<Sample, TypedDataReader>::cross_join( |
| 305 | std::map<TopicSet, SampleVec>& partial_results, const TopicSet& seen, |
| 306 | const QueryPlan& qp) |
| 307 | { |
| 308 | using namespace std; |
| 309 | const MetaStruct& other_meta = metaStructFor(qp.data_reader_); |
| 310 | vector<OPENDDS_STRING> no_keys; |
| 311 | for (typename std::map<TopicSet, SampleVec>::iterator it_pr = partial_results.begin(); |
| 312 | it_pr != partial_results.end(); ++it_pr) { |
| 313 | SampleVec resulting; |
| 314 | for (typename SampleVec::iterator i = it_pr->second.begin(); i != it_pr->second.end(); ++i) { |
| 315 | if (!join(resulting, *i, no_keys, 0, qp.data_reader_, other_meta)) { |
| 316 | return DDS::RETCODE_ERROR; |
| 317 | } |
| 318 | } |
| 319 | resulting.swap(it_pr->second); |
| 320 | } |
| 321 | |
| 322 | TopicSet with_join(seen); |
| 323 | with_join.insert(topicNameFor(qp.data_reader_)); |
| 324 | partial_results[with_join].swap(partial_results[seen]); |
| 325 | partial_results.erase(seen); |
| 326 | const DDS::ReturnCode_t ret = process_joins(partial_results, partial_results[with_join], |
| 327 | with_join, qp); |
| 328 | if (ret != DDS::RETCODE_OK) { |
| 329 | partial_results.erase(with_join); |
| 330 | return ret; |
| 331 | } |
| 332 | |
| 333 | return DDS::RETCODE_OK; |
| 334 | } |
| 335 | |
| 336 | template<typename Sample, typename TypedDataReader> |
| 337 | void |