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

Method cross_join

dds/DCPS/MultiTopicDataReader_T.cpp:303–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301
302template<typename Sample, typename TypedDataReader>
303DDS::ReturnCode_t
304MultiTopicDataReader_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
336template<typename Sample, typename TypedDataReader>
337void

Callers

nothing calls this directly

Calls 5

beginMethod · 0.45
endMethod · 0.45
swapMethod · 0.45
insertMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected