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

Method enable

dds/DCPS/SubscriberImpl.cpp:869–907  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

867}
868
869DDS::ReturnCode_t
870SubscriberImpl::enable()
871{
872 //According spec:
873 // - Calling enable on an already enabled Entity returns OK and has no
874 // effect.
875 // - Calling enable on an Entity whose factory is not enabled will fail
876 // and return PRECONDITION_NOT_MET.
877
878 if (this->is_enabled()) {
879 return DDS::RETCODE_OK;
880 }
881
882 RcHandle<DomainParticipantImpl> participant = this->participant_.lock();
883 if (!participant || !participant->is_enabled()) {
884 return DDS::RETCODE_PRECONDITION_NOT_MET;
885 }
886
887 dp_id_ = participant->get_id();
888
889 if (this->monitor_) {
890 this->monitor_->report();
891 }
892
893 this->set_enabled();
894
895 if (qos_.entity_factory.autoenable_created_entities) {
896 DataReaderSet readers;
897 {
898 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, si_lock_, DDS::RETCODE_ERROR);
899 readers_not_enabled_.swap(readers);
900 }
901 for (DataReaderSet::iterator it = readers.begin(); it != readers.end(); ++it) {
902 (*it)->enable();
903 }
904 }
905
906 return DDS::RETCODE_OK;
907}
908
909bool SubscriberImpl::is_clean(String* leftover_entities) const
910{

Callers 1

create_datareaderMethod · 0.45

Calls 8

is_enabledMethod · 0.80
set_enabledMethod · 0.80
lockMethod · 0.45
get_idMethod · 0.45
reportMethod · 0.45
swapMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected