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

Method get_datareaders

dds/DCPS/SubscriberImpl.cpp:514–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

512}
513
514DDS::ReturnCode_t
515SubscriberImpl::get_datareaders(
516 DDS::DataReaderSeq & readers,
517 DDS::SampleStateMask sample_states,
518 DDS::ViewStateMask view_states,
519 DDS::InstanceStateMask instance_states)
520{
521 DataReaderSet localreaders;
522 {
523 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex,
524 guard,
525 this->dr_set_lock_,
526 DDS::RETCODE_ERROR);
527 localreaders = datareader_set_;
528 }
529
530#ifndef OPENDDS_NO_OBJECT_MODEL_PROFILE
531 // If access_scope is GROUP and ordered_access is true then return readers as
532 // list which may contain same readers multiple times. Otherwise return readers
533 // as set.
534 if (this->qos_.presentation.access_scope == ::DDS::GROUP_PRESENTATION_QOS) {
535 if (this->access_depth_ == 0 && this->qos_.presentation.coherent_access) {
536 return ::DDS::RETCODE_PRECONDITION_NOT_MET;
537 }
538 if (this->qos_.presentation.ordered_access) {
539
540 GroupRakeData data;
541 for (DataReaderSet::const_iterator pos = localreaders.begin();
542 pos != localreaders.end(); ++pos) {
543 (*pos)->get_ordered_data(data, sample_states, view_states, instance_states);
544 }
545
546 // Return list of readers in the order of the source timestamp of the received
547 // samples from readers.
548 data.get_datareaders(readers);
549 return DDS::RETCODE_OK;
550 }
551 }
552#endif
553
554 // Return set of datareaders.
555 readers.length(0);
556 for (DataReaderSet::const_iterator pos = localreaders.begin();
557 pos != localreaders.end(); ++pos) {
558 if ((*pos)->have_sample_states(sample_states) &&
559 (*pos)->have_view_states(view_states) &&
560 (*pos)->have_instance_states(instance_states)) {
561 push_back(readers, DDS::DataReader::_duplicate(pos->in()));
562 }
563 }
564
565 return DDS::RETCODE_OK;
566}
567
568DDS::ReturnCode_t
569SubscriberImpl::notify_datareaders()

Callers

nothing calls this directly

Calls 9

get_ordered_dataMethod · 0.80
have_view_statesMethod · 0.80
have_instance_statesMethod · 0.80
push_backFunction · 0.70
beginMethod · 0.45
endMethod · 0.45
lengthMethod · 0.45
have_sample_statesMethod · 0.45
inMethod · 0.45

Tested by

no test coverage detected