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

Method enable

dds/DCPS/RecorderImpl.cpp:862–941  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860}
861
862DDS::ReturnCode_t
863RecorderImpl::enable()
864{
865 if (DCPS_debug_level >= 2) {
866 ACE_DEBUG((LM_DEBUG,
867 ACE_TEXT("(%P|%t) RecorderImpl::enable\n")));
868 }
869 //According spec:
870 // - Calling enable on an already enabled Entity returns OK and has no
871 // effect.
872 // - Calling enable on an Entity whose factory is not enabled will fail
873 // and return PRECONDITION_NOT_MET.
874
875 if (is_enabled()) {
876 return DDS::RETCODE_OK;
877 }
878
879 set_enabled();
880
881 // if (topic_servant_ && !transport_disabled_) {
882 if (topic_servant_) {
883 if (DCPS_debug_level >= 2) {
884 ACE_DEBUG((LM_DEBUG, "(%P|%t) RecorderImpl::enable: enable_transport\n"));
885 }
886
887 try {
888 enable_transport(qos_.reliability.kind == DDS::RELIABLE_RELIABILITY_QOS,
889 qos_.durability.kind > DDS::VOLATILE_DURABILITY_QOS,
890 participant_servant_->get_id());
891 } catch (const Transport::Exception&) {
892 if (log_level >= LogLevel::Warning) {
893 ACE_ERROR((LM_WARNING, "(%P|%t) WARNING: RecorderImpl::enable: Transport Exception\n"));
894 }
895 return DDS::RETCODE_ERROR;
896 }
897
898 const TransportLocatorSeq& trans_conf_info = connection_info();
899
900 CORBA::String_var filterClassName = "";
901 CORBA::String_var filterExpression = "";
902 DDS::StringSeq exprParams;
903
904 Discovery_rch disco =
905 TheServiceParticipant->get_discovery(domain_id_);
906
907 DCPS::set_reader_effective_data_rep_qos(qos_.representation.value);
908 if (!topic_servant_->check_data_representation(qos_.representation.value, false)) {
909 return DDS::RETCODE_ERROR;
910 }
911
912 if (DCPS_debug_level >= 2) {
913 ACE_DEBUG((LM_DEBUG, "(%P|%t) RecorderImpl::enable: add_subscription\n"));
914 }
915
916 TypeInformation type_info;
917
918 const bool success =
919 disco->add_subscription(domain_id_,

Callers

nothing calls this directly

Calls 6

rchandle_fromFunction · 0.85
get_discoveryMethod · 0.80
get_idMethod · 0.45
add_subscriptionMethod · 0.45

Tested by

no test coverage detected