Implements the OpenDDS::DCPS::DomainParticipant interfaces. More...
#include <DomainParticipantImpl.h>
Implements the OpenDDS::DCPS::DomainParticipant interfaces.
This class acts as an entrypoint of the service and a factory for publisher, subscriber and topic. It also acts as a container for the publisher, subscriber and topic objects.
See the DDS specification, OMG formal/04-12-02, for a description of the interface this class is implementing.
Definition at line 78 of file DomainParticipantImpl.h.
typedef Objref_Servant_Pair<PublisherImpl, DDS::Publisher, DDS::Publisher_ptr, DDS::Publisher_var> OpenDDS::DCPS::DomainParticipantImpl::Publisher_Pair |
Definition at line 88 of file DomainParticipantImpl.h.
typedef Objref_Servant_Pair<SubscriberImpl, DDS::Subscriber, DDS::Subscriber_ptr, DDS::Subscriber_var> OpenDDS::DCPS::DomainParticipantImpl::Subscriber_Pair |
Definition at line 85 of file DomainParticipantImpl.h.
typedef Objref_Servant_Pair<TopicImpl, DDS::Topic, DDS::Topic_ptr, DDS::Topic_var> OpenDDS::DCPS::DomainParticipantImpl::Topic_Pair |
Definition at line 91 of file DomainParticipantImpl.h.
anonymous enum [private] |
The implementation of create_topic.
Definition at line 389 of file DomainParticipantImpl.h.
00389 { 00390 TOPIC_TYPE_HAS_KEYS =1, 00391 TOPIC_TYPELESS = 2 00392 } TopicTypeMask;
OpenDDS::DCPS::DomainParticipantImpl::DomainParticipantImpl | ( | DomainParticipantFactoryImpl * | factory, | |
const DDS::DomainId_t & | domain_id, | |||
const DDS::DomainParticipantQos & | qos, | |||
DDS::DomainParticipantListener_ptr | a_listener, | |||
const DDS::StatusMask & | mask | |||
) |
Definition at line 91 of file DomainParticipantImpl.cpp.
References monitor_, set_listener(), and TheServiceParticipant.
00096 : factory_(factory), 00097 default_topic_qos_(TheServiceParticipant->initial_TopicQos()), 00098 default_publisher_qos_(TheServiceParticipant->initial_PublisherQos()), 00099 default_subscriber_qos_(TheServiceParticipant->initial_SubscriberQos()), 00100 qos_(qos), 00101 domain_id_(domain_id), 00102 dp_id_(GUID_UNKNOWN), 00103 federated_(false), 00104 shutdown_condition_(shutdown_mutex_), 00105 shutdown_complete_(false), 00106 monitor_(0), 00107 pub_id_gen_(dp_id_), 00108 automatic_liveliness_timer_ (*this), 00109 participant_liveliness_timer_ (*this) 00110 { 00111 (void) this->set_listener(a_listener, mask); 00112 monitor_ = TheServiceParticipant->monitor_factory_->create_dp_monitor(this); 00113 }
OpenDDS::DCPS::DomainParticipantImpl::~DomainParticipantImpl | ( | ) | [virtual] |
Definition at line 115 of file DomainParticipantImpl.cpp.
void OpenDDS::DCPS::DomainParticipantImpl::add_adjust_liveliness_timers | ( | DataWriterImpl * | writer | ) |
Definition at line 2201 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::DomainParticipantImpl::LivelinessTimer::add_adjust(), automatic_liveliness_timer_, and participant_liveliness_timer_.
02202 { 02203 automatic_liveliness_timer_.add_adjust(writer); 02204 participant_liveliness_timer_.add_adjust(writer); 02205 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::assert_liveliness | ( | ) | [virtual] |
Implements DDS::DomainParticipant.
Definition at line 1331 of file DomainParticipantImpl.cpp.
References ACE_OS::gettimeofday(), last_liveliness_activity_, publishers_, publishers_protector_, DDS::RETCODE_ERROR, and DDS::RETCODE_OK.
01332 { 01333 // This operation needs to only be used if the DomainParticipant contains 01334 // DataWriter entities with the LIVELINESS set to MANUAL_BY_PARTICIPANT and 01335 // it only affects the liveliness of those DataWriter entities. Otherwise, 01336 // it has no effect. 01337 // This will do nothing in current implementation since we only 01338 // support the AUTOMATIC liveliness qos for datawriter. 01339 // Add implementation here. 01340 01341 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 01342 tao_mon, 01343 this->publishers_protector_, 01344 DDS::RETCODE_ERROR); 01345 01346 for (PublisherSet::iterator it(publishers_.begin()); 01347 it != publishers_.end(); ++it) { 01348 it->svt_->assert_liveliness_by_participant(); 01349 } 01350 01351 last_liveliness_activity_ = ACE_OS::gettimeofday(); 01352 01353 return DDS::RETCODE_OK; 01354 }
CORBA::Boolean OpenDDS::DCPS::DomainParticipantImpl::contains_entity | ( | DDS::InstanceHandle_t | a_handle | ) | [virtual] |
Check top-level containers for Topic, Subscriber, and Publisher instances.
Recurse into SubscriberImpl and PublisherImpl for DataReader and DataWriter instances respectively.
Definition at line 1015 of file DomainParticipantImpl.cpp.
References publishers_, publishers_protector_, subscribers_, subscribers_protector_, topics_, and topics_protector_.
01016 { 01017 /// Check top-level containers for Topic, Subscriber, 01018 /// and Publisher instances. 01019 { 01020 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 01021 guard, 01022 this->topics_protector_, 01023 false); 01024 01025 for (TopicMap::iterator it(topics_.begin()); 01026 it != topics_.end(); ++it) { 01027 if (a_handle == it->second.pair_.svt_->get_instance_handle()) 01028 return true; 01029 } 01030 } 01031 01032 { 01033 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 01034 guard, 01035 this->subscribers_protector_, 01036 false); 01037 01038 for (SubscriberSet::iterator it(subscribers_.begin()); 01039 it != subscribers_.end(); ++it) { 01040 if (a_handle == it->svt_->get_instance_handle()) 01041 return true; 01042 } 01043 } 01044 01045 { 01046 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 01047 guard, 01048 this->publishers_protector_, 01049 false); 01050 01051 for (PublisherSet::iterator it(publishers_.begin()); 01052 it != publishers_.end(); ++it) { 01053 if (a_handle == it->svt_->get_instance_handle()) 01054 return true; 01055 } 01056 } 01057 01058 /// Recurse into SubscriberImpl and PublisherImpl for 01059 /// DataReader and DataWriter instances respectively. 01060 for (SubscriberSet::iterator it(subscribers_.begin()); 01061 it != subscribers_.end(); ++it) { 01062 if (it->svt_->contains_reader(a_handle)) 01063 return true; 01064 } 01065 01066 for (PublisherSet::iterator it(publishers_.begin()); 01067 it != publishers_.end(); ++it) { 01068 if (it->svt_->contains_writer(a_handle)) 01069 return true; 01070 } 01071 01072 return false; 01073 }
DDS::ContentFilteredTopic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_contentfilteredtopic | ( | const char * | name, | |
DDS::Topic_ptr | related_topic, | |||
const char * | filter_expression, | |||
const DDS::StringSeq & | expression_parameters | |||
) | [virtual] |
Definition at line 738 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, CORBA::is_nil(), LM_ERROR, DDS::RETCODE_OK, topic_descrs_, topics_, and topics_protector_.
00743 { 00744 if (CORBA::is_nil(related_topic)) { 00745 if (DCPS_debug_level > 3) { 00746 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00747 ACE_TEXT("DomainParticipantImpl::create_contentfilteredtopic, ") 00748 ACE_TEXT("can't create a content-filtered topic due to null related ") 00749 ACE_TEXT("topic.\n"))); 00750 } 00751 return 0; 00752 } 00753 00754 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, topics_protector_, 0); 00755 00756 if (topics_.count(name)) { 00757 if (DCPS_debug_level > 3) { 00758 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00759 ACE_TEXT("DomainParticipantImpl::create_contentfilteredtopic, ") 00760 ACE_TEXT("can't create a content-filtered topic due to name \"%C\" ") 00761 ACE_TEXT("already in use by a Topic.\n"), name)); 00762 } 00763 return 0; 00764 } 00765 00766 if (topic_descrs_.count(name)) { 00767 if (DCPS_debug_level > 3) { 00768 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00769 ACE_TEXT("DomainParticipantImpl::create_contentfilteredtopic, ") 00770 ACE_TEXT("can't create a content-filtered topic due to name \"%C\" ") 00771 ACE_TEXT("already in use by a TopicDescription.\n"), name)); 00772 } 00773 return 0; 00774 } 00775 00776 DDS::ContentFilteredTopic_var cft; 00777 try { 00778 // Create the cft in two steps so that we only have one place to 00779 // check the expression parameters 00780 cft = new ContentFilteredTopicImpl(name, related_topic, filter_expression, this); 00781 if (cft->set_expression_parameters(expression_parameters) != DDS::RETCODE_OK) { 00782 return 0; 00783 } 00784 } catch (const std::exception& e) { 00785 if (DCPS_debug_level) { 00786 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00787 ACE_TEXT("DomainParticipantImpl::create_contentfilteredtopic, ") 00788 ACE_TEXT("can't create a content-filtered topic due to runtime error: ") 00789 ACE_TEXT("%C.\n"), e.what())); 00790 } 00791 return 0; 00792 } 00793 DDS::TopicDescription_var td = DDS::TopicDescription::_duplicate(cft); 00794 topic_descrs_[name] = td; 00795 return cft._retn(); 00796 }
DDS::MultiTopic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_multitopic | ( | const char * | name, | |
const char * | type_name, | |||
const char * | subscription_expression, | |||
const DDS::StringSeq & | expression_parameters | |||
) | [virtual] |
Definition at line 846 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, LM_ERROR, topic_descrs_, topics_, and topics_protector_.
00850 { 00851 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, topics_protector_, 0); 00852 00853 if (topics_.count(name)) { 00854 if (DCPS_debug_level > 3) { 00855 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00856 ACE_TEXT("DomainParticipantImpl::create_multitopic, ") 00857 ACE_TEXT("can't create a multi topic due to name \"%C\" ") 00858 ACE_TEXT("already in use by a Topic.\n"), name)); 00859 } 00860 return 0; 00861 } 00862 00863 if (topic_descrs_.count(name)) { 00864 if (DCPS_debug_level > 3) { 00865 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00866 ACE_TEXT("DomainParticipantImpl::create_multitopic, ") 00867 ACE_TEXT("can't create a multi topic due to name \"%C\" ") 00868 ACE_TEXT("already in use by a TopicDescription.\n"), name)); 00869 } 00870 return 0; 00871 } 00872 00873 DDS::MultiTopic_var mt; 00874 try { 00875 mt = new MultiTopicImpl(name, type_name, subscription_expression, 00876 expression_parameters, this); 00877 } catch (const std::exception& e) { 00878 if (DCPS_debug_level) { 00879 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00880 ACE_TEXT("DomainParticipantImpl::create_multitopic, ") 00881 ACE_TEXT("can't create a multi topic due to runtime error: ") 00882 ACE_TEXT("%C.\n"), e.what())); 00883 } 00884 return 0; 00885 } 00886 DDS::TopicDescription_var td = DDS::TopicDescription::_duplicate(mt); 00887 topic_descrs_[name] = td; 00888 return mt._retn(); 00889 }
DDS::Topic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_new_topic | ( | const RepoId | topic_id, | |
const char * | topic_name, | |||
const char * | type_name, | |||
const DDS::TopicQos & | qos, | |||
DDS::TopicListener_ptr | a_listener, | |||
const DDS::StatusMask & | mask, | |||
OpenDDS::DCPS::TypeSupport_ptr | type_support | |||
) | [private] |
Definition at line 1862 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), CORBA::LocalObject::_nil(), access, ACE_NEW_RETURN(), ACE_TEXT(), OpenDDS::DCPS::bind(), DDS::Security::SecurityException::code, domain_id_, OpenDDS::DCPS::TopicImpl::enable(), OpenDDS::DCPS::EntityImpl::enabled_, DDS::DomainParticipantQos::entity_factory, DDS::Security::TopicSecurityAttributes::is_read_protected, DDS::Security::TopicSecurityAttributes::is_write_protected, LM_ERROR, LM_WARNING, DDS::Security::SecurityException::message, DDS::Security::SecurityException::minor_code, monitor_, NO_DUP, OpenDDS::DCPS::Objref_Servant_Pair< T_impl, T, T_ptr, T_var >::obj_, OpenDDS::DCPS::DomainParticipantImpl::RefCounted_Topic::pair_, qos_, OpenDDS::DCPS::Monitor::report(), TheServiceParticipant, topics_, and topics_protector_.
Referenced by create_topic_i(), and find_topic().
01870 { 01871 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 01872 tao_mon, 01873 this->topics_protector_, 01874 DDS::Topic::_nil()); 01875 01876 #if defined(OPENDDS_SECURITY) 01877 if (TheServiceParticipant->get_security() && !is_bit(topic_name)) { 01878 Security::AccessControl_var access = security_config_->get_access_control(); 01879 01880 DDS::Security::SecurityException se; 01881 01882 DDS::Security::TopicSecurityAttributes sec_attr; 01883 if (!access->get_topic_sec_attributes(perm_handle_, topic_name, sec_attr, se)) { 01884 ACE_ERROR((LM_WARNING, 01885 ACE_TEXT("(%P|%t) WARNING: ") 01886 ACE_TEXT("DomainParticipantImpl::create_new_topic, ") 01887 ACE_TEXT("Unable to get security attributes for topic '%C'. SecurityException[%d.%d]: %C\n"), 01888 topic_name, se.code, se.minor_code, se.message.in())); 01889 return DDS::Topic::_nil(); 01890 } 01891 01892 if ((sec_attr.is_write_protected || sec_attr.is_read_protected) && 01893 !access->check_create_topic(perm_handle_, domain_id_, topic_name, qos, se)) { 01894 ACE_ERROR((LM_WARNING, 01895 ACE_TEXT("(%P|%t) WARNING: ") 01896 ACE_TEXT("DomainParticipantImpl::create_new_topic, ") 01897 ACE_TEXT("Permissions check failed to create new topic '%C'. SecurityException[%d.%d]: %C\n"), 01898 topic_name, se.code, se.minor_code, se.message.in())); 01899 return DDS::Topic::_nil(); 01900 } 01901 } 01902 #endif 01903 01904 TopicImpl* topic_servant = 0; 01905 01906 ACE_NEW_RETURN(topic_servant, 01907 TopicImpl(topic_id, 01908 topic_name, 01909 type_name, 01910 type_support, 01911 qos, 01912 a_listener, 01913 mask, 01914 this), 01915 DDS::Topic::_nil()); 01916 01917 if ((enabled_ == true) 01918 && (qos_.entity_factory.autoenable_created_entities)) { 01919 topic_servant->enable(); 01920 } 01921 01922 DDS::Topic_ptr obj(topic_servant); 01923 01924 // this object will also act as a guard against leaking the new TopicImpl 01925 RefCounted_Topic refCounted_topic(Topic_Pair(topic_servant, obj, NO_DUP)); 01926 01927 if (OpenDDS::DCPS::bind(topics_, topic_name, refCounted_topic) == -1) { 01928 ACE_ERROR((LM_ERROR, 01929 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::create_new_topic, ") 01930 ACE_TEXT("%p \n"), 01931 ACE_TEXT("bind"))); 01932 return DDS::Topic::_nil(); 01933 } 01934 01935 if (this->monitor_) { 01936 this->monitor_->report(); 01937 } 01938 01939 // the topics_ map has one reference and we duplicate to give 01940 // the caller another reference. 01941 return DDS::Topic::_duplicate(refCounted_topic.pair_.obj_.in()); 01942 }
DDS::Publisher_ptr OpenDDS::DCPS::DomainParticipantImpl::create_publisher | ( | const DDS::PublisherQos & | qos, | |
DDS::PublisherListener_ptr | a_listener, | |||
DDS::StatusMask | mask | |||
) | [virtual] |
Definition at line 120 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), CORBA::LocalObject::_nil(), ACE_NEW_RETURN(), ACE_TEXT(), OpenDDS::DCPS::PublisherImpl::enable(), OpenDDS::DCPS::EntityImpl::enabled_, DDS::DomainParticipantQos::entity_factory, OpenDDS::DCPS::insert(), LM_ERROR, OpenDDS::DCPS::DomainParticipantImpl::RepoIdSequence::next(), OpenDDS::DCPS::InstanceHandleGenerator::next(), NO_DUP, participant_handles_, pub_id_gen_, publishers_, publishers_protector_, qos_, and validate_publisher_qos().
00124 { 00125 DDS::PublisherQos pub_qos = qos; 00126 00127 if (! this->validate_publisher_qos(pub_qos)) 00128 return DDS::Publisher::_nil(); 00129 00130 PublisherImpl* pub = 0; 00131 ACE_NEW_RETURN(pub, 00132 PublisherImpl(participant_handles_.next(), 00133 pub_id_gen_.next(), 00134 pub_qos, 00135 a_listener, 00136 mask, 00137 this), 00138 DDS::Publisher::_nil()); 00139 00140 if ((enabled_ == true) && (qos_.entity_factory.autoenable_created_entities)) { 00141 pub->enable(); 00142 } 00143 00144 DDS::Publisher_ptr pub_obj(pub); 00145 00146 // this object will also act as the guard for leaking Publisher Impl 00147 Publisher_Pair pair(pub, pub_obj, NO_DUP); 00148 00149 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 00150 tao_mon, 00151 this->publishers_protector_, 00152 DDS::Publisher::_nil()); 00153 00154 if (OpenDDS::DCPS::insert(publishers_, pair) == -1) { 00155 ACE_ERROR((LM_ERROR, 00156 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::create_publisher, ") 00157 ACE_TEXT("%p\n"), 00158 ACE_TEXT("insert"))); 00159 return DDS::Publisher::_nil(); 00160 } 00161 00162 return DDS::Publisher::_duplicate(pub_obj); 00163 }
Recorder_ptr OpenDDS::DCPS::DomainParticipantImpl::create_recorder | ( | DDS::Topic_ptr | a_topic, | |
const DDS::SubscriberQos & | subscriber_qos, | |||
const DDS::DataReaderQos & | datareader_qos, | |||
const RecorderListener_rch & | a_listener, | |||
DDS::StatusMask | mask | |||
) |
Definition at line 2092 of file DomainParticipantImpl.cpp.
References TAO_Objref_Var_T< T >::_retn(), ACE_TEXT(), OpenDDS::DCPS::RecorderImpl::enable(), OpenDDS::DCPS::EntityImpl::enabled_, DDS::DomainParticipantQos::entity_factory, OpenDDS::DCPS::RecorderImpl::init(), CORBA::is_nil(), LM_ERROR, qos_, recorders_, recorders_protector_, TheServiceParticipant, OpenDDS::DCPS::SubscriberImpl::validate_datareader_qos(), and validate_subscriber_qos().
Referenced by OpenDDS::DCPS::Service_Participant::create_recorder().
02097 { 02098 if (CORBA::is_nil(a_topic)) { 02099 ACE_ERROR((LM_ERROR, 02100 ACE_TEXT("(%P|%t) ERROR: ") 02101 ACE_TEXT("SubscriberImpl::create_datareader, ") 02102 ACE_TEXT("topic desc is nil.\n"))); 02103 return 0; 02104 } 02105 02106 DDS::SubscriberQos sub_qos = subscriber_qos; 02107 DDS::DataReaderQos dr_qos; 02108 02109 if (! this->validate_subscriber_qos(sub_qos) || 02110 ! SubscriberImpl::validate_datareader_qos(datareader_qos, 02111 TheServiceParticipant->initial_DataReaderQos(), 02112 a_topic, 02113 dr_qos, false) ) { 02114 return 0; 02115 } 02116 02117 RecorderImpl* recorder(new RecorderImpl); 02118 Recorder_var result(recorder); 02119 02120 recorder->init(dynamic_cast<TopicDescriptionImpl*>(a_topic), 02121 dr_qos, a_listener, 02122 mask, this, subscriber_qos); 02123 02124 if ((enabled_ == true) && (qos_.entity_factory.autoenable_created_entities)) { 02125 recorder->enable(); 02126 } 02127 02128 ACE_Guard<ACE_Recursive_Thread_Mutex> guard(recorders_protector_); 02129 recorders_.insert(result); 02130 02131 return result._retn(); 02132 }
Replayer_ptr OpenDDS::DCPS::DomainParticipantImpl::create_replayer | ( | DDS::Topic_ptr | a_topic, | |
const DDS::PublisherQos & | publisher_qos, | |||
const DDS::DataWriterQos & | datawriter_qos, | |||
const ReplayerListener_rch & | a_listener, | |||
DDS::StatusMask | mask | |||
) |
Definition at line 2135 of file DomainParticipantImpl.cpp.
References TAO_Objref_Var_T< T >::_retn(), ACE_TEXT(), OpenDDS::DCPS::ReplayerImpl::enable(), OpenDDS::DCPS::EntityImpl::enabled_, DDS::DomainParticipantQos::entity_factory, OpenDDS::DCPS::ReplayerImpl::init(), CORBA::is_nil(), LM_ERROR, qos_, replayers_, replayers_protector_, DDS::RETCODE_OK, TheServiceParticipant, OpenDDS::DCPS::PublisherImpl::validate_datawriter_qos(), and validate_publisher_qos().
Referenced by OpenDDS::DCPS::Service_Participant::create_replayer().
02140 { 02141 if (CORBA::is_nil(a_topic)) { 02142 ACE_ERROR((LM_ERROR, 02143 ACE_TEXT("(%P|%t) ERROR: ") 02144 ACE_TEXT("SubscriberImpl::create_datareader, ") 02145 ACE_TEXT("topic desc is nil.\n"))); 02146 return 0; 02147 } 02148 02149 DDS::PublisherQos pub_qos = publisher_qos; 02150 DDS::DataWriterQos dw_qos; 02151 02152 if (! this->validate_publisher_qos(pub_qos) || 02153 ! PublisherImpl::validate_datawriter_qos(datawriter_qos, 02154 TheServiceParticipant->initial_DataWriterQos(), 02155 a_topic, 02156 dw_qos)) { 02157 return 0; 02158 } 02159 02160 TopicImpl* topic_servant = dynamic_cast<TopicImpl*>(a_topic); 02161 02162 ReplayerImpl* replayer(new ReplayerImpl); 02163 Replayer_var result(replayer); 02164 02165 replayer->init(a_topic, topic_servant, dw_qos, a_listener, mask, this, pub_qos); 02166 02167 if ((this->enabled_ == true) && (qos_.entity_factory.autoenable_created_entities)) { 02168 const DDS::ReturnCode_t ret = replayer->enable(); 02169 02170 if (ret != DDS::RETCODE_OK) { 02171 ACE_ERROR((LM_ERROR, 02172 ACE_TEXT("(%P|%t) ERROR: ") 02173 ACE_TEXT("DomainParticipantImpl::create_replayer, ") 02174 ACE_TEXT("enable failed.\n"))); 02175 return 0; 02176 } 02177 } 02178 02179 ACE_Guard<ACE_Recursive_Thread_Mutex> guard(replayers_protector_); 02180 replayers_.insert(result); 02181 return result._retn(); 02182 }
DDS::Subscriber_ptr OpenDDS::DCPS::DomainParticipantImpl::create_subscriber | ( | const DDS::SubscriberQos & | qos, | |
DDS::SubscriberListener_ptr | a_listener, | |||
DDS::StatusMask | mask | |||
) | [virtual] |
Definition at line 210 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), CORBA::LocalObject::_nil(), ACE_NEW_RETURN(), ACE_TEXT(), OpenDDS::DCPS::SubscriberImpl::enable(), OpenDDS::DCPS::EntityImpl::enabled_, DDS::DomainParticipantQos::entity_factory, OpenDDS::DCPS::insert(), LM_ERROR, OpenDDS::DCPS::InstanceHandleGenerator::next(), NO_DUP, participant_handles_, qos_, subscribers_, subscribers_protector_, and validate_subscriber_qos().
Referenced by OpenDDS::DCPS::InfoRepoDiscovery::init_bit(), and OpenDDS::DCPS::PeerDiscovery< Spdp >::init_bit().
00214 { 00215 DDS::SubscriberQos sub_qos = qos; 00216 00217 if (! this->validate_subscriber_qos(sub_qos)) { 00218 return DDS::Subscriber::_nil(); 00219 } 00220 00221 SubscriberImpl* sub = 0 ; 00222 ACE_NEW_RETURN(sub, 00223 SubscriberImpl(participant_handles_.next(), 00224 sub_qos, 00225 a_listener, 00226 mask, 00227 this), 00228 DDS::Subscriber::_nil()); 00229 00230 if ((enabled_ == true) && (qos_.entity_factory.autoenable_created_entities)) { 00231 sub->enable(); 00232 } 00233 00234 DDS::Subscriber_ptr sub_obj(sub); 00235 00236 Subscriber_Pair pair(sub, sub_obj, NO_DUP); 00237 00238 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 00239 tao_mon, 00240 this->subscribers_protector_, 00241 DDS::Subscriber::_nil()); 00242 00243 if (OpenDDS::DCPS::insert(subscribers_, pair) == -1) { 00244 ACE_ERROR((LM_ERROR, 00245 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::create_subscriber, ") 00246 ACE_TEXT("%p\n"), 00247 ACE_TEXT("insert"))); 00248 return DDS::Subscriber::_nil(); 00249 } 00250 00251 return DDS::Subscriber::_duplicate(sub_obj); 00252 }
DDS::Topic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_topic | ( | const char * | topic_name, | |
const char * | type_name, | |||
const DDS::TopicQos & | qos, | |||
DDS::TopicListener_ptr | a_listener, | |||
DDS::StatusMask | mask | |||
) | [virtual] |
Definition at line 316 of file DomainParticipantImpl.cpp.
References create_topic_i().
Referenced by OpenDDS::DCPS::Discovery::create_bit_topics().
00322 { 00323 return create_topic_i(topic_name, 00324 type_name, 00325 qos, 00326 a_listener, 00327 mask, 00328 0); 00329 }
DDS::Topic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_topic_i | ( | const char * | topic_name, | |
const char * | type_name, | |||
const DDS::TopicQos & | qos, | |||
DDS::TopicListener_ptr | a_listener, | |||
DDS::StatusMask | mask, | |||
int | topic_mask | |||
) | [private] |
Definition at line 352 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), CORBA::LocalObject::_nil(), ACE_TEXT(), OpenDDS::DCPS::Qos_Helper::consistent(), create_new_topic(), OpenDDS::DCPS::CREATED, OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, Util::find(), OpenDDS::DCPS::FOUND, get_default_topic_qos(), OpenDDS::DCPS::GUID_UNKNOWN, OpenDDS::DCPS::EntityImpl::is_enabled(), CORBA::is_nil(), LM_DEBUG, LM_ERROR, monitor_, OPENDDS_NO_DURABILITY_KIND_TRANSIENT_PERSISTENT_COMPATIBILITY_CHECK, OPENDDS_NO_DURABILITY_SERVICE_COMPATIBILITY_CHECK, OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE_COMPATIBILITY_CHECK, OPENDDS_NO_OWNERSHIP_PROFILE_COMPATIBILITY_CHECK, Registered_Data_Types, OpenDDS::DCPS::Monitor::report(), status, ACE_OS::strcmp(), TheServiceParticipant, topic_descrs_, OpenDDS::DCPS::TOPIC_DISABLED, TOPIC_QOS_DEFAULT, TOPIC_TYPE_HAS_KEYS, topics_, topics_protector_, and OpenDDS::DCPS::Qos_Helper::valid().
Referenced by create_topic(), and create_typeless_topic().
00359 { 00360 DDS::TopicQos topic_qos; 00361 00362 if (qos == TOPIC_QOS_DEFAULT) { 00363 this->get_default_topic_qos(topic_qos); 00364 00365 } else { 00366 topic_qos = qos; 00367 } 00368 00369 OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE_COMPATIBILITY_CHECK(qos, DDS::Topic::_nil()); 00370 OPENDDS_NO_OWNERSHIP_PROFILE_COMPATIBILITY_CHECK(qos, DDS::Topic::_nil()); 00371 OPENDDS_NO_DURABILITY_SERVICE_COMPATIBILITY_CHECK(qos, DDS::Topic::_nil()); 00372 OPENDDS_NO_DURABILITY_KIND_TRANSIENT_PERSISTENT_COMPATIBILITY_CHECK(qos, DDS::Topic::_nil()); 00373 00374 if (!Qos_Helper::valid(topic_qos)) { 00375 ACE_ERROR((LM_ERROR, 00376 ACE_TEXT("(%P|%t) ERROR: ") 00377 ACE_TEXT("DomainParticipantImpl::create_topic, ") 00378 ACE_TEXT("invalid qos.\n"))); 00379 return DDS::Topic::_nil(); 00380 } 00381 00382 if (!Qos_Helper::consistent(topic_qos)) { 00383 ACE_ERROR((LM_ERROR, 00384 ACE_TEXT("(%P|%t) ERROR: ") 00385 ACE_TEXT("DomainParticipantImpl::create_topic, ") 00386 ACE_TEXT("inconsistent qos.\n"))); 00387 return DDS::Topic::_nil(); 00388 } 00389 00390 TopicMap::mapped_type* entry = 0; 00391 bool found = false; 00392 { 00393 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 00394 tao_mon, 00395 this->topics_protector_, 00396 DDS::Topic::_nil()); 00397 00398 #if !defined(OPENDDS_NO_CONTENT_FILTERED_TOPIC) || !defined(OPENDDS_NO_MULTI_TOPIC) 00399 if (topic_descrs_.count(topic_name)) { 00400 if (DCPS_debug_level > 3) { 00401 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00402 ACE_TEXT("DomainParticipantImpl::create_topic, ") 00403 ACE_TEXT("can't create a Topic due to name \"%C\" already in use ") 00404 ACE_TEXT("by a TopicDescription.\n"), topic_name)); 00405 } 00406 return 0; 00407 } 00408 #endif 00409 00410 if (Util::find(topics_, topic_name, entry) == 0) { 00411 found = true; 00412 } 00413 } 00414 00415 if (found) { 00416 CORBA::String_var found_type 00417 = entry->pair_.svt_->get_type_name(); 00418 00419 if (ACE_OS::strcmp(type_name, found_type) == 0) { 00420 DDS::TopicQos found_qos; 00421 entry->pair_.svt_->get_qos(found_qos); 00422 00423 if (topic_qos == found_qos) { // match type name, qos 00424 { 00425 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 00426 tao_mon, 00427 this->topics_protector_, 00428 DDS::Topic::_nil()); 00429 ++entry->client_refs_; 00430 } 00431 return DDS::Topic::_duplicate(entry->pair_.obj_.in()); 00432 00433 } else { 00434 if (DCPS_debug_level >= 1) { 00435 ACE_DEBUG((LM_DEBUG, 00436 ACE_TEXT("(%P|%t) DomainParticipantImpl::create_topic, ") 00437 ACE_TEXT("qos not match: topic_name=%C type_name=%C\n"), 00438 topic_name, type_name)); 00439 } 00440 00441 return DDS::Topic::_nil(); 00442 } 00443 00444 } else { // no match 00445 if (DCPS_debug_level >= 1) { 00446 ACE_DEBUG((LM_DEBUG, 00447 ACE_TEXT("(%P|%t) DomainParticipantImpl::create_topic, ") 00448 ACE_TEXT(" not match: topic_name=%C type_name=%C\n"), 00449 topic_name, type_name)); 00450 } 00451 00452 return DDS::Topic::_nil(); 00453 } 00454 00455 } else { 00456 00457 OpenDDS::DCPS::TypeSupport_var type_support; 00458 bool has_keys = (topic_mask & TOPIC_TYPE_HAS_KEYS); 00459 00460 if (0 == topic_mask) { 00461 // creating a topic with compile time type 00462 type_support = Registered_Data_Types->lookup(this, type_name); 00463 if (CORBA::is_nil(type_support)) { 00464 if (DCPS_debug_level >= 1) { 00465 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00466 ACE_TEXT("DomainParticipantImpl::create_topic, ") 00467 ACE_TEXT("can't create a topic=%C type_name=%C ") 00468 ACE_TEXT("is not registered.\n"), 00469 topic_name, type_name)); 00470 } 00471 return DDS::Topic::_nil(); 00472 } 00473 has_keys = type_support->has_dcps_key(); 00474 } 00475 00476 RepoId topic_id = GUID_UNKNOWN; 00477 TopicStatus status = TOPIC_DISABLED; 00478 00479 if (is_enabled()) { 00480 Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_); 00481 status = disco->assert_topic(topic_id, 00482 domain_id_, 00483 dp_id_, 00484 topic_name, 00485 type_name, 00486 topic_qos, 00487 has_keys); 00488 } 00489 00490 if (status == CREATED || status == FOUND || status == TOPIC_DISABLED) { 00491 DDS::Topic_ptr new_topic = create_new_topic(topic_id, 00492 topic_name, 00493 type_name, 00494 topic_qos, 00495 a_listener, 00496 mask, 00497 type_support); 00498 if (this->monitor_) { 00499 this->monitor_->report(); 00500 } 00501 return new_topic; 00502 00503 } else { 00504 ACE_ERROR((LM_ERROR, 00505 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::create_topic, ") 00506 ACE_TEXT("assert_topic failed with return value %d.\n"), status)); 00507 return DDS::Topic::_nil(); 00508 } 00509 } 00510 }
DDS::Topic_ptr OpenDDS::DCPS::DomainParticipantImpl::create_typeless_topic | ( | const char * | topic_name, | |
const char * | type_name, | |||
bool | type_has_keys, | |||
const DDS::TopicQos & | qos, | |||
DDS::TopicListener_ptr | a_listener, | |||
DDS::StatusMask | mask | |||
) |
Definition at line 332 of file DomainParticipantImpl.cpp.
References create_topic_i(), TOPIC_TYPE_HAS_KEYS, and TOPIC_TYPELESS.
Referenced by OpenDDS::DCPS::Service_Participant::create_typeless_topic().
00339 { 00340 int topic_mask = (type_has_keys ? TOPIC_TYPE_HAS_KEYS : 0 ) | TOPIC_TYPELESS; 00341 00342 return create_topic_i(topic_name, 00343 type_name, 00344 qos, 00345 a_listener, 00346 mask, 00347 topic_mask); 00348 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_contained_entities | ( | ) | [virtual] |
Implements DDS::DomainParticipant.
Definition at line 978 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_nil(), ACE_Thread_Mutex::acquire(), bit_subscriber_, domain_id_, handle_exception(), Registered_Data_Types, ACE_Thread_Mutex::release(), ACE_Thread::self(), OpenDDS::DCPS::EntityImpl::set_deleted(), shutdown_complete_, shutdown_condition_, shutdown_mutex_, shutdown_result_, TheServiceParticipant, ACE_OS::thr_equal(), and ACE_Condition< ACE_Thread_Mutex >::wait().
Referenced by OpenDDS::DCPS::DomainParticipantFactoryImpl::delete_participant().
00979 { 00980 // mark that the entity is being deleted 00981 set_deleted(true); 00982 00983 // BIT subscriber and data readers will be deleted with the 00984 // rest of the entities, so need to report to discovery that 00985 // BIT is no longer available 00986 Discovery_rch disc = TheServiceParticipant->get_discovery(this->domain_id_); 00987 if (disc) 00988 disc->fini_bit(this); 00989 00990 if (ACE_OS::thr_equal(TheServiceParticipant->reactor_owner(), 00991 ACE_Thread::self())) { 00992 handle_exception(0); 00993 00994 } else { 00995 TheServiceParticipant->reactor()->notify(this); 00996 00997 shutdown_mutex_.acquire(); 00998 while (!shutdown_complete_) { 00999 shutdown_condition_.wait(); 01000 } 01001 shutdown_complete_ = false; 01002 shutdown_mutex_.release(); 01003 } 01004 01005 bit_subscriber_ = DDS::Subscriber::_nil(); 01006 01007 OpenDDS::DCPS::Registered_Data_Types->unregister_participant(this); 01008 01009 // the participant can now start creating new contained entities 01010 set_deleted(false); 01011 return shutdown_result_; 01012 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_contentfilteredtopic | ( | DDS::ContentFilteredTopic_ptr | a_contentfilteredtopic | ) | [virtual] |
Definition at line 798 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::TopicDescriptionImpl::has_entity_refs(), LM_ERROR, DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_OUT_OF_RESOURCES, DDS::RETCODE_PRECONDITION_NOT_MET, topic_descrs_, and topics_protector_.
00800 { 00801 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, topics_protector_, 00802 DDS::RETCODE_OUT_OF_RESOURCES); 00803 DDS::ContentFilteredTopic_var cft = 00804 DDS::ContentFilteredTopic::_duplicate(a_contentfilteredtopic); 00805 CORBA::String_var name = cft->get_name(); 00806 TopicDescriptionMap::iterator iter = topic_descrs_.find(name.in()); 00807 if (iter == topic_descrs_.end()) { 00808 if (DCPS_debug_level > 3) { 00809 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00810 ACE_TEXT("DomainParticipantImpl::delete_contentfilteredtopic, ") 00811 ACE_TEXT("can't delete a content-filtered topic \"%C\" ") 00812 ACE_TEXT("because it is not in the set.\n"), name.in ())); 00813 } 00814 return DDS::RETCODE_PRECONDITION_NOT_MET; 00815 } 00816 00817 TopicDescriptionImpl* tdi = dynamic_cast<TopicDescriptionImpl*>(iter->second.in()); 00818 00819 if (!tdi) { 00820 if (DCPS_debug_level > 3) { 00821 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00822 ACE_TEXT("DomainParticipantImpl::delete_contentfilteredtopic, ") 00823 ACE_TEXT("can't delete a content-filtered topic \"%C\" ") 00824 ACE_TEXT("failed to obtain TopicDescriptionImpl\n"), name.in())); 00825 } 00826 return DDS::RETCODE_ERROR; 00827 } 00828 00829 if (tdi->has_entity_refs()) { 00830 if (DCPS_debug_level > 3) { 00831 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00832 ACE_TEXT("DomainParticipantImpl::delete_contentfilteredtopic, ") 00833 ACE_TEXT("can't delete a content-filtered topic \"%C\" ") 00834 ACE_TEXT("because it is used by a datareader\n"), name.in ())); 00835 } 00836 return DDS::RETCODE_PRECONDITION_NOT_MET; 00837 } 00838 topic_descrs_.erase(iter); 00839 return DDS::RETCODE_OK; 00840 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_multitopic | ( | DDS::MultiTopic_ptr | a_multitopic | ) | [virtual] |
Definition at line 891 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::TopicDescriptionImpl::has_entity_refs(), LM_ERROR, DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_OUT_OF_RESOURCES, DDS::RETCODE_PRECONDITION_NOT_MET, topic_descrs_, and topics_protector_.
00893 { 00894 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, topics_protector_, 00895 DDS::RETCODE_OUT_OF_RESOURCES); 00896 DDS::MultiTopic_var mt = DDS::MultiTopic::_duplicate(a_multitopic); 00897 CORBA::String_var mt_name = mt->get_name(); 00898 TopicDescriptionMap::iterator iter = topic_descrs_.find(mt_name.in()); 00899 if (iter == topic_descrs_.end()) { 00900 if (DCPS_debug_level > 3) { 00901 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00902 ACE_TEXT("DomainParticipantImpl::delete_multitopic, ") 00903 ACE_TEXT("can't delete a multitopic \"%C\" ") 00904 ACE_TEXT("because it is not in the set.\n"), mt_name.in ())); 00905 } 00906 return DDS::RETCODE_PRECONDITION_NOT_MET; 00907 } 00908 00909 TopicDescriptionImpl* tdi = dynamic_cast<TopicDescriptionImpl*>(iter->second.in()); 00910 00911 if (!tdi) { 00912 if (DCPS_debug_level > 3) { 00913 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00914 ACE_TEXT("DomainParticipantImpl::delete_multitopic, ") 00915 ACE_TEXT("can't delete a multitopic topic \"%C\" ") 00916 ACE_TEXT("failed to obtain TopicDescriptionImpl.\n"), 00917 mt_name.in())); 00918 } 00919 return DDS::RETCODE_ERROR; 00920 } 00921 00922 if (tdi->has_entity_refs()) { 00923 if (DCPS_debug_level > 3) { 00924 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00925 ACE_TEXT("DomainParticipantImpl::delete_multitopic, ") 00926 ACE_TEXT("can't delete a multitopic topic \"%C\" ") 00927 ACE_TEXT("because it is used by a datareader.\n"), mt_name.in ())); 00928 } 00929 return DDS::RETCODE_PRECONDITION_NOT_MET; 00930 } 00931 topic_descrs_.erase(iter); 00932 return DDS::RETCODE_OK; 00933 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_publisher | ( | DDS::Publisher_ptr | p | ) | [virtual] |
Definition at line 166 of file DomainParticipantImpl.cpp.
References ACE_TEXT(), DUP, OpenDDS::DCPS::PublisherImpl::is_clean(), LM_ERROR, publishers_, publishers_protector_, OpenDDS::DCPS::remove(), DDS::RETCODE_ERROR, DDS::RETCODE_OK, and DDS::RETCODE_PRECONDITION_NOT_MET.
Referenced by handle_exception().
00168 { 00169 // The servant's ref count should be 2 at this point, 00170 // one referenced by poa, one referenced by the subscriber 00171 // set. 00172 PublisherImpl* the_servant = dynamic_cast<PublisherImpl*>(p); 00173 00174 if (!the_servant) { 00175 ACE_ERROR((LM_ERROR, 00176 ACE_TEXT("(%P|%t) ERROR: ") 00177 ACE_TEXT("DomainParticipantImpl::delete_publisher, ") 00178 ACE_TEXT("Failed to obtain PublisherImpl.\n"))); 00179 return DDS::RETCODE_ERROR; 00180 } 00181 00182 if (!the_servant->is_clean()) { 00183 ACE_ERROR((LM_ERROR, 00184 ACE_TEXT("(%P|%t) ERROR: ") 00185 ACE_TEXT("DomainParticipantImpl::delete_publisher, ") 00186 ACE_TEXT("The publisher is not empty.\n"))); 00187 return DDS::RETCODE_PRECONDITION_NOT_MET; 00188 } 00189 00190 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 00191 tao_mon, 00192 this->publishers_protector_, 00193 DDS::RETCODE_ERROR); 00194 00195 Publisher_Pair pair(the_servant, p, DUP); 00196 00197 if (OpenDDS::DCPS::remove(publishers_, pair) == -1) { 00198 ACE_ERROR((LM_ERROR, 00199 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::delete_publisher, ") 00200 ACE_TEXT("%p\n"), 00201 ACE_TEXT("remove"))); 00202 return DDS::RETCODE_ERROR; 00203 00204 } else { 00205 return DDS::RETCODE_OK; 00206 } 00207 }
void OpenDDS::DCPS::DomainParticipantImpl::delete_recorder | ( | Recorder_ptr | recorder | ) |
Definition at line 2185 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::Recorder::_duplicate(), recorders_, and recorders_protector_.
Referenced by OpenDDS::DCPS::Service_Participant::delete_recorder().
02186 { 02187 const Recorder_var recvar(Recorder::_duplicate(recorder)); 02188 ACE_Guard<ACE_Recursive_Thread_Mutex> guard(recorders_protector_); 02189 recorders_.erase(recvar); 02190 }
void OpenDDS::DCPS::DomainParticipantImpl::delete_replayer | ( | Replayer_ptr | replayer | ) |
Definition at line 2193 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::Replayer::_duplicate(), replayers_, and replayers_protector_.
Referenced by OpenDDS::DCPS::Service_Participant::delete_replayer().
02194 { 02195 const Replayer_var repvar(Replayer::_duplicate(replayer)); 02196 ACE_Guard<ACE_Recursive_Thread_Mutex> guard(replayers_protector_); 02197 replayers_.erase(repvar); 02198 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_subscriber | ( | DDS::Subscriber_ptr | s | ) | [virtual] |
Definition at line 255 of file DomainParticipantImpl.cpp.
References ACE_TEXT(), OpenDDS::DCPS::SubscriberImpl::delete_contained_entities(), DUP, OpenDDS::DCPS::SubscriberImpl::is_clean(), LM_ERROR, OpenDDS::DCPS::remove(), DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_PRECONDITION_NOT_MET, subscribers_, and subscribers_protector_.
Referenced by handle_exception().
00257 { 00258 // The servant's ref count should be 2 at this point, 00259 // one referenced by poa, one referenced by the subscriber 00260 // set. 00261 SubscriberImpl* the_servant = dynamic_cast<SubscriberImpl*>(s); 00262 00263 if (!the_servant) { 00264 ACE_ERROR((LM_ERROR, 00265 ACE_TEXT("(%P|%t) ERROR: ") 00266 ACE_TEXT("DomainParticipantImpl::delete_subscriber, ") 00267 ACE_TEXT("Failed to obtain SubscriberImpl.\n"))); 00268 return DDS::RETCODE_ERROR; 00269 } 00270 00271 if (!the_servant->is_clean()) { 00272 ACE_ERROR((LM_ERROR, 00273 ACE_TEXT("(%P|%t) ERROR: ") 00274 ACE_TEXT("DomainParticipantImpl::delete_subscriber, ") 00275 ACE_TEXT("The subscriber is not empty.\n"))); 00276 return DDS::RETCODE_PRECONDITION_NOT_MET; 00277 } 00278 00279 DDS::ReturnCode_t ret 00280 = the_servant->delete_contained_entities(); 00281 00282 if (ret != DDS::RETCODE_OK) { 00283 ACE_ERROR((LM_ERROR, 00284 ACE_TEXT("(%P|%t) ERROR: ") 00285 ACE_TEXT("DomainParticipantImpl::delete_subscriber, ") 00286 ACE_TEXT("Failed to delete contained entities.\n"))); 00287 return DDS::RETCODE_ERROR; 00288 } 00289 00290 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 00291 tao_mon, 00292 this->subscribers_protector_, 00293 DDS::RETCODE_ERROR); 00294 00295 Subscriber_Pair pair(the_servant, s, DUP); 00296 00297 if (OpenDDS::DCPS::remove(subscribers_, pair) == -1) { 00298 ACE_ERROR((LM_ERROR, 00299 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::delete_subscriber, ") 00300 ACE_TEXT("%p\n"), 00301 ACE_TEXT("remove"))); 00302 return DDS::RETCODE_ERROR; 00303 00304 } else { 00305 return DDS::RETCODE_OK; 00306 } 00307 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_topic | ( | DDS::Topic_ptr | a_topic | ) | [virtual] |
Definition at line 513 of file DomainParticipantImpl.cpp.
References delete_topic_i().
00515 { 00516 return delete_topic_i(a_topic, false); 00517 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::delete_topic_i | ( | DDS::Topic_ptr | a_topic, | |
bool | remove_objref | |||
) | [private] |
Delete the topic with option of whether the topic object reference should be removed.
Definition at line 520 of file DomainParticipantImpl.cpp.
References ACE_TEXT(), domain_id_, Util::find(), get_domain_id(), OpenDDS::DCPS::TopicImpl::get_id(), get_id(), OpenDDS::DCPS::TopicDescriptionImpl::get_name(), OpenDDS::DCPS::TopicDescriptionImpl::get_participant(), OpenDDS::DCPS::TopicDescriptionImpl::has_entity_refs(), LM_ERROR, OpenDDS::DCPS::REMOVED, DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_PRECONDITION_NOT_MET, status, TheServiceParticipant, topics_, and topics_protector_.
Referenced by delete_topic(), and handle_exception().
00523 { 00524 00525 DDS::ReturnCode_t ret = DDS::RETCODE_OK; 00526 00527 try { 00528 // The servant's ref count should be greater than 2 at this point, 00529 // one referenced by poa, one referenced by the topic map and 00530 // others referenced by the datareader/datawriter. 00531 TopicImpl* the_topic_servant = dynamic_cast<TopicImpl*>(a_topic); 00532 00533 if (!the_topic_servant) { 00534 ACE_ERROR_RETURN((LM_ERROR, 00535 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::delete_topic_i, ") 00536 ACE_TEXT("%p\n"), 00537 ACE_TEXT("failed to obtain TopicImpl.")), 00538 DDS::RETCODE_ERROR); 00539 } 00540 00541 CORBA::String_var topic_name = the_topic_servant->get_name(); 00542 00543 DDS::DomainParticipant_var dp = the_topic_servant->get_participant(); 00544 00545 DomainParticipantImpl* the_dp_servant = 00546 dynamic_cast<DomainParticipantImpl*>(dp.in()); 00547 00548 if (the_dp_servant != this || 00549 (!remove_objref && the_topic_servant->has_entity_refs())) { 00550 // If entity_refs is true (nonzero), then some reader or writer is using 00551 // this topic and the spec requires delete_topic() to fail with the error: 00552 return DDS::RETCODE_PRECONDITION_NOT_MET; 00553 } 00554 00555 { 00556 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 00557 tao_mon, 00558 this->topics_protector_, 00559 DDS::RETCODE_ERROR); 00560 00561 TopicMap::mapped_type* entry = 0; 00562 00563 if (Util::find(topics_, topic_name.in(), entry) == -1) { 00564 ACE_ERROR_RETURN((LM_ERROR, 00565 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::delete_topic_i, ") 00566 ACE_TEXT("%p\n"), 00567 ACE_TEXT("find")), 00568 DDS::RETCODE_ERROR); 00569 } 00570 00571 --entry->client_refs_; 00572 00573 if (remove_objref == true || 00574 0 == entry->client_refs_) { 00575 //TBD - mark the TopicImpl as deleted and make it 00576 // reject calls to the TopicImpl. 00577 Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_); 00578 TopicStatus status 00579 = disco->remove_topic(the_dp_servant->get_domain_id(), 00580 the_dp_servant->get_id(), 00581 the_topic_servant->get_id()); 00582 00583 if (status != REMOVED) { 00584 ACE_ERROR_RETURN((LM_ERROR, 00585 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::delete_topic_i, ") 00586 ACE_TEXT("remove_topic failed with return value %d\n"), status), 00587 DDS::RETCODE_ERROR); 00588 } 00589 00590 // note: this will destroy the TopicImpl if there are no 00591 // client object reference to it. 00592 if (topics_.erase(topic_name.in()) == 0) { 00593 ACE_ERROR_RETURN((LM_ERROR, 00594 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::delete_topic_i, ") 00595 ACE_TEXT("%p \n"), 00596 ACE_TEXT("unbind")), 00597 DDS::RETCODE_ERROR); 00598 00599 } else 00600 return DDS::RETCODE_OK; 00601 00602 } 00603 } 00604 00605 } catch (...) { 00606 ACE_ERROR((LM_ERROR, 00607 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::delete_topic_i, ") 00608 ACE_TEXT(" Caught Unknown Exception \n"))); 00609 ret = DDS::RETCODE_ERROR; 00610 } 00611 00612 return ret; 00613 }
void OpenDDS::DCPS::DomainParticipantImpl::deref_filter_eval | ( | const char * | filter | ) |
Definition at line 963 of file DomainParticipantImpl.cpp.
References filter_cache_lock_.
00964 { 00965 ACE_GUARD(ACE_Thread_Mutex, guard, filter_cache_lock_); 00966 typedef std::map<OPENDDS_STRING, RcHandle<FilterEvaluator> > Map; 00967 Map::iterator iter = filter_cache_.find(filter); 00968 if (iter != filter_cache_.end()) { 00969 if (iter->second->ref_count() == 1) { 00970 filter_cache_.erase(iter); 00971 } 00972 } 00973 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::enable | ( | ) | [virtual] |
Implements DDS::Entity.
Definition at line 1604 of file DomainParticipantImpl.cpp.
References access, ACE_TEXT(), bit_subscriber_, DDS::Security::SecurityException::code, OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, DDS::DomainParticipantQos::entity_factory, OpenDDS::DCPS::AddDomainStatus::federated, federated_, Util::filter_properties(), OpenDDS::DCPS::GUID_UNKNOWN, DDS::HANDLE_NIL, OpenDDS::DCPS::AddDomainStatus::id, OpenDDS::DCPS::EntityImpl::is_enabled(), OpenDDS::DCPS::RcHandle< T >::is_nil(), LM_DEBUG, LM_ERROR, DDS::Security::SecurityException::message, DDS::Security::SecurityException::minor_code, monitor_, OPENDDS_STRING, DDS::DomainParticipantQos::property, publishers_, qos_, OpenDDS::DCPS::Monitor::report(), DDS::RETCODE_ERROR, DDS::Security::RETCODE_NOT_ALLOWED_BY_SECURITY, DDS::RETCODE_OK, OpenDDS::DCPS::EntityImpl::set_enabled(), subscribers_, TheSecurityRegistry, TheServiceParticipant, TheTransientKludge, topics_, and DDS::Security::VALIDATION_OK.
01605 { 01606 //According spec: 01607 // - Calling enable on an already enabled Entity returns OK and has no 01608 // effect. 01609 // - Calling enable on an Entity whose factory is not enabled will fail 01610 // and return PRECONDITION_NOT_MET. 01611 01612 if (this->is_enabled()) { 01613 return DDS::RETCODE_OK; 01614 } 01615 01616 if (monitor_) { 01617 monitor_->report(); 01618 } 01619 01620 if (TheServiceParticipant->monitor_) { 01621 TheServiceParticipant->monitor_->report(); 01622 } 01623 01624 #if defined(OPENDDS_SECURITY) 01625 if (!security_config_ && TheServiceParticipant->get_security()) { 01626 security_config_ = TheSecurityRegistry->default_config(); 01627 if (!security_config_) { 01628 security_config_ = TheSecurityRegistry->fix_empty_default(); 01629 } 01630 } 01631 #endif 01632 01633 Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_); 01634 01635 if (disco.is_nil()) { 01636 ACE_ERROR((LM_ERROR, 01637 ACE_TEXT("(%P|%t) ERROR: ") 01638 ACE_TEXT("DomainParticipantImpl::enable, ") 01639 ACE_TEXT("no repository found for domain id: %d.\n"), domain_id_)); 01640 return DDS::RETCODE_ERROR; 01641 } 01642 01643 #if defined(OPENDDS_SECURITY) 01644 if (TheServiceParticipant->get_security() && !security_config_) { 01645 ACE_ERROR((LM_ERROR, 01646 ACE_TEXT("(%P|%t) ERROR: ") 01647 ACE_TEXT("DomainParticipantImpl::enable, ") 01648 ACE_TEXT("DCPSSecurity flag is set, but unable to load security plugin configuration.\n"))); 01649 return DDS::RETCODE_ERROR; 01650 } 01651 #endif 01652 01653 AddDomainStatus value = {GUID_UNKNOWN, false}; 01654 01655 #if defined(OPENDDS_SECURITY) 01656 if (TheServiceParticipant->get_security()) { 01657 Security::Authentication_var auth = security_config_->get_authentication(); 01658 01659 DDS::Security::SecurityException se; 01660 DDS::Security::ValidationResult_t val_res = 01661 auth->validate_local_identity(id_handle_, dp_id_, domain_id_, qos_, disco->generate_participant_guid(), se); 01662 01663 /* TODO - Handle VALIDATION_PENDING_RETRY */ 01664 if (val_res != DDS::Security::VALIDATION_OK) { 01665 ACE_ERROR((LM_ERROR, 01666 ACE_TEXT("(%P|%t) ERROR: ") 01667 ACE_TEXT("DomainParticipantImpl::enable, ") 01668 ACE_TEXT("Unable to validate local identity. SecurityException[%d.%d]: %C\n"), 01669 se.code, se.minor_code, se.message.in())); 01670 return DDS::Security::RETCODE_NOT_ALLOWED_BY_SECURITY; 01671 } 01672 01673 Security::AccessControl_var access = security_config_->get_access_control(); 01674 01675 perm_handle_ = access->validate_local_permissions(auth, id_handle_, domain_id_, qos_, se); 01676 01677 if (perm_handle_ == DDS::HANDLE_NIL) { 01678 ACE_ERROR((LM_ERROR, 01679 ACE_TEXT("(%P|%t) ERROR: ") 01680 ACE_TEXT("DomainParticipantImpl::enable, ") 01681 ACE_TEXT("Unable to validate local permissions. SecurityException[%d.%d]: %C\n"), 01682 se.code, se.minor_code, se.message.in())); 01683 return DDS::Security::RETCODE_NOT_ALLOWED_BY_SECURITY; 01684 } 01685 01686 bool check_create = access->check_create_participant(perm_handle_, domain_id_, qos_, se); 01687 if (!check_create) { 01688 ACE_ERROR((LM_ERROR, 01689 ACE_TEXT("(%P|%t) ERROR: ") 01690 ACE_TEXT("DomainParticipantImpl::enable, ") 01691 ACE_TEXT("Unable to create participant. SecurityException[%d.%d]: %C\n"), 01692 se.code, se.minor_code, se.message.in())); 01693 return DDS::Security::RETCODE_NOT_ALLOWED_BY_SECURITY; 01694 } 01695 01696 DDS::Security::ParticipantSecurityAttributes part_sec_attr; 01697 bool check_part_sec_attr = access->get_participant_sec_attributes(perm_handle_, part_sec_attr, se); 01698 01699 if (!check_part_sec_attr) { 01700 ACE_ERROR((LM_ERROR, 01701 ACE_TEXT("(%P|%t) ERROR: ") 01702 ACE_TEXT("DomainParticipantImpl::enable, ") 01703 ACE_TEXT("Unable to get participant security attributes. SecurityException[%d.%d]: %C\n"), 01704 se.code, se.minor_code, se.message.in())); 01705 return DDS::RETCODE_ERROR; 01706 } 01707 01708 Security::CryptoKeyFactory_var crypto = security_config_->get_crypto_key_factory(); 01709 01710 part_crypto_handle_ = crypto->register_local_participant(id_handle_, perm_handle_, 01711 Util::filter_properties(qos_.property.value, "dds.sec.crypto."), part_sec_attr, se); 01712 if (part_crypto_handle_ == DDS::HANDLE_NIL) { 01713 ACE_ERROR((LM_ERROR, 01714 ACE_TEXT("(%P|%t) ERROR: ") 01715 ACE_TEXT("DomainParticipantImpl::enable, ") 01716 ACE_TEXT("Unable to register local participant. SecurityException[%d.%d]: %C\n"), 01717 se.code, se.minor_code, se.message.in())); 01718 return DDS::RETCODE_ERROR; 01719 } 01720 01721 value = disco->add_domain_participant_secure(domain_id_, qos_, dp_id_, id_handle_, perm_handle_, part_crypto_handle_); 01722 01723 if (value.id == GUID_UNKNOWN) { 01724 ACE_ERROR((LM_ERROR, 01725 ACE_TEXT("(%P|%t) ERROR: ") 01726 ACE_TEXT("DomainParticipantImpl::enable, ") 01727 ACE_TEXT("add_domain_participant_secure returned invalid id.\n"))); 01728 return DDS::RETCODE_ERROR; 01729 } 01730 01731 } else { 01732 #endif 01733 01734 value = disco->add_domain_participant(domain_id_, qos_); 01735 01736 if (value.id == GUID_UNKNOWN) { 01737 ACE_ERROR((LM_ERROR, 01738 ACE_TEXT("(%P|%t) ERROR: ") 01739 ACE_TEXT("DomainParticipantImpl::enable, ") 01740 ACE_TEXT("add_domain_participant returned invalid id.\n"))); 01741 return DDS::RETCODE_ERROR; 01742 } 01743 01744 #if defined(OPENDDS_SECURITY) 01745 } 01746 #endif 01747 01748 dp_id_ = value.id; 01749 federated_ = value.federated; 01750 01751 const DDS::ReturnCode_t ret = this->set_enabled(); 01752 01753 if (DCPS_debug_level > 1) { 01754 ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) DomainParticipantImpl::enable: ") 01755 ACE_TEXT("enabled participant %C in domain %d\n"), 01756 OPENDDS_STRING(GuidConverter(dp_id_)).c_str(), domain_id_)); 01757 } 01758 01759 if (ret == DDS::RETCODE_OK && !TheTransientKludge->is_enabled()) { 01760 Discovery_rch disc = TheServiceParticipant->get_discovery(this->domain_id_); 01761 this->bit_subscriber_ = disc->init_bit(this); 01762 } 01763 01764 if (ret != DDS::RETCODE_OK) { 01765 return ret; 01766 } 01767 01768 if (qos_.entity_factory.autoenable_created_entities) { 01769 01770 for (TopicMap::iterator it = topics_.begin(); it != topics_.end(); ++it) { 01771 it->second.pair_.svt_->enable(); 01772 } 01773 01774 for (PublisherSet::iterator it = publishers_.begin(); it != publishers_.end(); ++it) { 01775 it->svt_->enable(); 01776 } 01777 01778 for (SubscriberSet::iterator it = subscribers_.begin(); it != subscribers_.end(); ++it) { 01779 it->svt_->enable(); 01780 } 01781 } 01782 01783 return DDS::RETCODE_OK; 01784 }
bool OpenDDS::DCPS::DomainParticipantImpl::federated | ( | ) | const [inline] |
Definition at line 341 of file DomainParticipantImpl.h.
Referenced by OpenDDS::DCPS::InfoRepoDiscovery::init_bit().
00341 { 00342 return this->federated_; 00343 }
DDS::Topic_ptr OpenDDS::DCPS::DomainParticipantImpl::find_topic | ( | const char * | topic_name, | |
const DDS::Duration_t & | timeout | |||
) | [virtual] |
Definition at line 618 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), CORBA::LocalObject::_nil(), ACE_TEXT(), create_new_topic(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::DEFAULT_STATUS_MASK, domain_id_, Util::find(), OpenDDS::DCPS::FOUND, ACE_OS::gettimeofday(), OpenDDS::DCPS::INTERNAL_ERROR, CORBA::is_nil(), LM_DEBUG, LM_ERROR, DDS::Duration_t::nanosec, Registered_Data_Types, ACE_Time_Value::sec(), DDS::Duration_t::sec, ACE_OS::sleep(), status, TheServiceParticipant, topics_, and topics_protector_.
00621 { 00622 ACE_Time_Value timeout_tv 00623 = ACE_OS::gettimeofday() + ACE_Time_Value(timeout.sec, timeout.nanosec/1000); 00624 00625 bool first_time = true; 00626 00627 while (first_time || ACE_OS::gettimeofday() < timeout_tv) { 00628 if (first_time) { 00629 first_time = false; 00630 } 00631 00632 TopicMap::mapped_type* entry = 0; 00633 { 00634 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 00635 tao_mon, 00636 this->topics_protector_, 00637 DDS::Topic::_nil()); 00638 00639 if (Util::find(topics_, topic_name, entry) == 0) { 00640 ++entry->client_refs_; 00641 return DDS::Topic::_duplicate(entry->pair_.obj_.in()); 00642 } 00643 } 00644 00645 RepoId topic_id; 00646 CORBA::String_var type_name; 00647 DDS::TopicQos_var qos; 00648 00649 Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_); 00650 TopicStatus status = disco->find_topic(domain_id_, 00651 topic_name, 00652 type_name.out(), 00653 qos.out(), 00654 topic_id); 00655 00656 00657 if (status == FOUND) { 00658 OpenDDS::DCPS::TypeSupport_var type_support = 00659 Registered_Data_Types->lookup(this, type_name.in()); 00660 if (CORBA::is_nil(type_support)) { 00661 if (DCPS_debug_level) { 00662 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00663 ACE_TEXT("DomainParticipantImpl::find_topic, ") 00664 ACE_TEXT("can't create a Topic: type_name \"%C\" ") 00665 ACE_TEXT("is not registered.\n"), type_name.in())); 00666 } 00667 00668 return DDS::Topic::_nil(); 00669 } 00670 00671 DDS::Topic_ptr new_topic = create_new_topic(topic_id, 00672 topic_name, 00673 type_name, 00674 qos, 00675 DDS::TopicListener::_nil(), 00676 OpenDDS::DCPS::DEFAULT_STATUS_MASK, 00677 type_support); 00678 return new_topic; 00679 00680 } else if (status == INTERNAL_ERROR) { 00681 ACE_ERROR((LM_ERROR, 00682 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::find_topic - ") 00683 ACE_TEXT("topic not found, discovery returned INTERNAL_ERROR!\n"))); 00684 return DDS::Topic::_nil(); 00685 } else { 00686 ACE_Time_Value now = ACE_OS::gettimeofday(); 00687 00688 if (now < timeout_tv) { 00689 ACE_Time_Value remaining = timeout_tv - now; 00690 00691 if (remaining.sec() >= 1) { 00692 ACE_OS::sleep(1); 00693 00694 } else { 00695 ACE_OS::sleep(remaining); 00696 } 00697 } 00698 } 00699 } 00700 00701 if (DCPS_debug_level >= 1) { 00702 // timed out 00703 ACE_DEBUG((LM_DEBUG, 00704 ACE_TEXT("(%P|%t) DomainParticipantImpl::find_topic, ") 00705 ACE_TEXT("timed out. \n"))); 00706 } 00707 00708 return DDS::Topic::_nil(); 00709 }
DDS::Subscriber_ptr OpenDDS::DCPS::DomainParticipantImpl::get_builtin_subscriber | ( | ) | [virtual] |
Implements DDS::DomainParticipant.
Definition at line 310 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), and bit_subscriber_.
Referenced by OpenDDS::DCPS::instance_handle_to_bit_data().
00311 { 00312 return DDS::Subscriber::_duplicate(bit_subscriber_.in()); 00313 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_current_time | ( | DDS::Time_t & | current_time | ) | [virtual] |
Definition at line 1420 of file DomainParticipantImpl.cpp.
References ACE_OS::gettimeofday(), DDS::RETCODE_OK, and OpenDDS::DCPS::time_value_to_time().
01422 { 01423 current_time 01424 = OpenDDS::DCPS::time_value_to_time( 01425 ACE_OS::gettimeofday()); 01426 return DDS::RETCODE_OK; 01427 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_default_publisher_qos | ( | DDS::PublisherQos & | qos | ) | [virtual] |
Definition at line 1370 of file DomainParticipantImpl.cpp.
References default_publisher_qos_, and DDS::RETCODE_OK.
Referenced by validate_publisher_qos().
01372 { 01373 qos = default_publisher_qos_; 01374 return DDS::RETCODE_OK; 01375 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_default_subscriber_qos | ( | DDS::SubscriberQos & | qos | ) | [virtual] |
Definition at line 1391 of file DomainParticipantImpl.cpp.
References default_subscriber_qos_, and DDS::RETCODE_OK.
Referenced by validate_subscriber_qos().
01393 { 01394 qos = default_subscriber_qos_; 01395 return DDS::RETCODE_OK; 01396 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_default_topic_qos | ( | DDS::TopicQos & | qos | ) | [virtual] |
Definition at line 1412 of file DomainParticipantImpl.cpp.
References default_topic_qos_, and DDS::RETCODE_OK.
Referenced by create_topic_i().
01414 { 01415 qos = default_topic_qos_; 01416 return DDS::RETCODE_OK; 01417 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_discovered_participant_data | ( | DDS::ParticipantBuiltinTopicData & | participant_data, | |
DDS::InstanceHandle_t | participant_handle | |||
) | [virtual] |
Definition at line 1463 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::LocalObject< DDS::DomainParticipant >::_narrow(), DDS::ANY_INSTANCE_STATE, DDS::ANY_SAMPLE_STATE, DDS::ANY_VIEW_STATE, bit_subscriber_, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC, OpenDDS::DCPS::GuidConverter::entityKind(), handle_protector_, handles_, OpenDDS::DCPS::KIND_PARTICIPANT, DDS::RETCODE_ERROR, DDS::RETCODE_NO_DATA, DDS::RETCODE_OK, and DDS::RETCODE_PRECONDITION_NOT_MET.
01466 { 01467 { 01468 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 01469 guard, 01470 this->handle_protector_, 01471 DDS::RETCODE_ERROR); 01472 01473 bool found = false; 01474 HandleMap::const_iterator itEnd = this->handles_.end(); 01475 01476 for (HandleMap::const_iterator iter = this->handles_.begin(); 01477 iter != itEnd; ++iter) { 01478 GuidConverter converter(iter->first); 01479 01480 if (participant_handle == iter->second 01481 && converter.entityKind() == KIND_PARTICIPANT) { 01482 found = true; 01483 break; 01484 } 01485 } 01486 01487 if (!found) 01488 return DDS::RETCODE_PRECONDITION_NOT_MET; 01489 } 01490 01491 DDS::SampleInfoSeq info; 01492 DDS::ParticipantBuiltinTopicDataSeq data; 01493 DDS::DataReader_var dr = 01494 this->bit_subscriber_->lookup_datareader(BUILT_IN_PARTICIPANT_TOPIC); 01495 DDS::ParticipantBuiltinTopicDataDataReader_var bit_part_dr = 01496 DDS::ParticipantBuiltinTopicDataDataReader::_narrow(dr); 01497 DDS::ReturnCode_t ret = bit_part_dr->read_instance(data, 01498 info, 01499 1, 01500 participant_handle, 01501 DDS::ANY_SAMPLE_STATE, 01502 DDS::ANY_VIEW_STATE, 01503 DDS::ANY_INSTANCE_STATE); 01504 01505 if (ret == DDS::RETCODE_OK) { 01506 if (info[0].valid_data) 01507 participant_data = data[0]; 01508 01509 else 01510 return DDS::RETCODE_NO_DATA; 01511 } 01512 01513 return ret; 01514 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_discovered_participants | ( | DDS::InstanceHandleSeq & | participant_handles | ) | [virtual] |
Definition at line 1432 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::GuidConverter::entityKind(), handle_protector_, handles_, ignored_participants_, OpenDDS::DCPS::KIND_PARTICIPANT, OpenDDS::DCPS::push_back(), DDS::RETCODE_ERROR, and DDS::RETCODE_OK.
01434 { 01435 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 01436 guard, 01437 this->handle_protector_, 01438 DDS::RETCODE_ERROR); 01439 01440 HandleMap::const_iterator itEnd = this->handles_.end(); 01441 01442 for (HandleMap::const_iterator iter = this->handles_.begin(); 01443 iter != itEnd; ++iter) { 01444 GuidConverter converter(iter->first); 01445 01446 if (converter.entityKind() == KIND_PARTICIPANT) 01447 { 01448 // skip itself and the ignored participant 01449 if (iter->first == this->dp_id_ 01450 || (this->ignored_participants_.find(iter->first) 01451 != this->ignored_participants_.end ())) { 01452 continue; 01453 } 01454 01455 push_back(participant_handles, iter->second); 01456 } 01457 } 01458 01459 return DDS::RETCODE_OK; 01460 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_discovered_topic_data | ( | DDS::TopicBuiltinTopicData & | topic_data, | |
DDS::InstanceHandle_t | topic_handle | |||
) | [virtual] |
Definition at line 1547 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::LocalObject< DDS::DomainParticipant >::_narrow(), DDS::ANY_INSTANCE_STATE, DDS::ANY_SAMPLE_STATE, DDS::ANY_VIEW_STATE, bit_subscriber_, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC, handle_protector_, handles_, OpenDDS::DCPS::GuidConverter::isTopic(), DDS::RETCODE_ERROR, DDS::RETCODE_NO_DATA, DDS::RETCODE_OK, and DDS::RETCODE_PRECONDITION_NOT_MET.
01550 { 01551 { 01552 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 01553 guard, 01554 this->handle_protector_, 01555 DDS::RETCODE_ERROR); 01556 01557 bool found = false; 01558 HandleMap::const_iterator itEnd = this->handles_.end(); 01559 01560 for (HandleMap::const_iterator iter = this->handles_.begin(); 01561 iter != itEnd; ++iter) { 01562 GuidConverter converter(iter->first); 01563 01564 if (topic_handle == iter->second && converter.isTopic()) { 01565 found = true; 01566 break; 01567 } 01568 } 01569 01570 if (!found) 01571 return DDS::RETCODE_PRECONDITION_NOT_MET; 01572 } 01573 01574 DDS::DataReader_var dr = 01575 bit_subscriber_->lookup_datareader(BUILT_IN_TOPIC_TOPIC); 01576 DDS::TopicBuiltinTopicDataDataReader_var bit_topic_dr = 01577 DDS::TopicBuiltinTopicDataDataReader::_narrow(dr); 01578 01579 DDS::SampleInfoSeq info; 01580 DDS::TopicBuiltinTopicDataSeq data; 01581 DDS::ReturnCode_t ret = 01582 bit_topic_dr->read_instance(data, 01583 info, 01584 1, 01585 topic_handle, 01586 DDS::ANY_SAMPLE_STATE, 01587 DDS::ANY_VIEW_STATE, 01588 DDS::ANY_INSTANCE_STATE); 01589 01590 if (ret == DDS::RETCODE_OK) { 01591 if (info[0].valid_data) 01592 topic_data = data[0]; 01593 01594 else 01595 return DDS::RETCODE_NO_DATA; 01596 } 01597 01598 return ret; 01599 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_discovered_topics | ( | DDS::InstanceHandleSeq & | topic_handles | ) | [virtual] |
Definition at line 1517 of file DomainParticipantImpl.cpp.
References handle_protector_, handles_, ignored_topics_, OpenDDS::DCPS::GuidConverter::isTopic(), OpenDDS::DCPS::push_back(), DDS::RETCODE_ERROR, and DDS::RETCODE_OK.
01519 { 01520 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 01521 guard, 01522 this->handle_protector_, 01523 DDS::RETCODE_ERROR); 01524 01525 HandleMap::const_iterator itEnd = this->handles_.end(); 01526 01527 for (HandleMap::const_iterator iter = this->handles_.begin(); 01528 iter != itEnd; ++iter) { 01529 GuidConverter converter(iter->first); 01530 01531 if (converter.isTopic()) { 01532 01533 // skip the ignored topic 01534 if (this->ignored_topics_.find(iter->first) 01535 != this->ignored_topics_.end ()) { 01536 continue; 01537 } 01538 01539 push_back(topic_handles, iter->second); 01540 } 01541 } 01542 01543 return DDS::RETCODE_OK; 01544 }
DDS::DomainId_t OpenDDS::DCPS::DomainParticipantImpl::get_domain_id | ( | ) | [virtual] |
Implements DDS::DomainParticipant.
Definition at line 1325 of file DomainParticipantImpl.cpp.
References domain_id_.
Referenced by OpenDDS::DCPS::PeerDiscovery< Spdp >::bit_key_to_repo_id(), OpenDDS::DCPS::MonitorFactoryImpl::create_dp_monitor(), OpenDDS::DCPS::DomainParticipantFactoryImpl::delete_participant(), delete_topic_i(), OpenDDS::DCPS::TopicImpl::enable(), OpenDDS::DCPS::PeerDiscovery< Spdp >::fini_bit(), OpenDDS::DCPS::ReplayerImpl::init(), OpenDDS::DCPS::RecorderImpl::init(), OpenDDS::DCPS::DataReaderImpl::init(), OpenDDS::DCPS::PeerDiscovery< Spdp >::init_bit(), OpenDDS::DCPS::BitPubListenerImpl::on_data_available(), OpenDDS::DCPS::DPMonitorImpl::report(), OpenDDS::DCPS::TopicImpl::set_qos(), OpenDDS::DCPS::ReplayerImpl::set_qos(), and OpenDDS::DCPS::RecorderImpl::set_qos().
01326 { 01327 return domain_id_; 01328 }
RcHandle< FilterEvaluator > OpenDDS::DCPS::DomainParticipantImpl::get_filter_eval | ( | const char * | filter | ) |
Definition at line 940 of file DomainParticipantImpl.cpp.
References ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, filter_cache_lock_, and LM_ERROR.
00941 { 00942 ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, filter_cache_lock_, 00943 RcHandle<FilterEvaluator>()); 00944 00945 RcHandle<FilterEvaluator>& result = filter_cache_[filter]; 00946 if (!result) { 00947 try { 00948 result = make_rch<FilterEvaluator>(filter, false); 00949 } catch (const std::exception& e) { 00950 filter_cache_.erase(filter); 00951 if (DCPS_debug_level) { 00952 ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ") 00953 ACE_TEXT("DomainParticipantImpl::get_filter_eval, ") 00954 ACE_TEXT("can't create a writer-side content filter due to ") 00955 ACE_TEXT("runtime error: %C.\n"), e.what())); 00956 } 00957 } 00958 } 00959 return result; 00960 }
RepoId OpenDDS::DCPS::DomainParticipantImpl::get_id | ( | void | ) |
Following methods are not the idl interfaces and are local operations. Return the id given by discovery.
Definition at line 1787 of file DomainParticipantImpl.cpp.
References dp_id_.
Referenced by OpenDDS::DCPS::ReplayerImpl::add_association(), OpenDDS::DCPS::RecorderImpl::add_association(), OpenDDS::DCPS::PeerDiscovery< Spdp >::bit_key_to_repo_id(), OpenDDS::DCPS::RecorderImpl::cleanup(), OpenDDS::DCPS::DomainParticipantFactoryImpl::delete_participant(), delete_topic_i(), OpenDDS::DCPS::TopicImpl::enable(), OpenDDS::DCPS::ReplayerImpl::enable(), OpenDDS::DCPS::RecorderImpl::enable(), OpenDDS::DCPS::PeerDiscovery< Spdp >::fini_bit(), OpenDDS::DCPS::PeerDiscovery< Spdp >::init_bit(), OpenDDS::DCPS::TopicMonitorImpl::report(), OpenDDS::DCPS::SubscriberMonitorImpl::report(), OpenDDS::DCPS::PublisherMonitorImpl::report(), OpenDDS::DCPS::DPMonitorImpl::report(), OpenDDS::DCPS::TopicImpl::set_qos(), OpenDDS::DCPS::ReplayerImpl::set_qos(), OpenDDS::DCPS::RecorderImpl::set_qos(), and signal_liveliness().
01788 { 01789 return dp_id_; 01790 }
DDS::InstanceHandle_t OpenDDS::DCPS::DomainParticipantImpl::get_instance_handle | ( | ) | [virtual] |
Implements OpenDDS::DCPS::EntityImpl.
Definition at line 1800 of file DomainParticipantImpl.cpp.
References dp_id_, and id_to_handle().
01801 { 01802 return this->id_to_handle(this->dp_id_); 01803 }
DDS::DomainParticipantListener_ptr OpenDDS::DCPS::DomainParticipantImpl::get_listener | ( | ) | [virtual] |
Implements DDS::DomainParticipant.
Definition at line 1131 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), and listener_.
01132 { 01133 return DDS::DomainParticipantListener::_duplicate(listener_.in()); 01134 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::get_qos | ( | DDS::DomainParticipantQos & | qos | ) | [virtual] |
Definition at line 1112 of file DomainParticipantImpl.cpp.
References qos_, and DDS::RETCODE_OK.
01114 { 01115 qos = qos_; 01116 return DDS::RETCODE_OK; 01117 }
RepoId OpenDDS::DCPS::DomainParticipantImpl::get_repoid | ( | const DDS::InstanceHandle_t & | id | ) |
Obtain a GUID representing a local hande.
Definition at line 1833 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::GUID_UNKNOWN, handle_protector_, and repoIds_.
Referenced by ignore_participant(), ignore_publication(), ignore_subscription(), ignore_topic(), and OpenDDS::DCPS::ReplayerImpl::write().
01834 { 01835 RepoId result = GUID_UNKNOWN; 01836 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 01837 guard, 01838 this->handle_protector_, 01839 GUID_UNKNOWN); 01840 RepoIdMap::const_iterator location = this->repoIds_.find(handle); 01841 if (location != this->repoIds_.end()) { 01842 result = location->second; 01843 } 01844 return result; 01845 }
void OpenDDS::DCPS::DomainParticipantImpl::get_topic_ids | ( | TopicIdVec & | topics | ) |
Populates an std::vector with the RepoId of the topics this participant has created/found.
Definition at line 1973 of file DomainParticipantImpl.cpp.
References topics_, and topics_protector_.
Referenced by OpenDDS::DCPS::DPMonitorImpl::report().
01974 { 01975 ACE_GUARD(ACE_Recursive_Thread_Mutex, 01976 guard, 01977 this->topics_protector_); 01978 01979 topics.reserve(topics_.size()); 01980 for (TopicMap::iterator it(topics_.begin()); 01981 it != topics_.end(); ++it) { 01982 topics.push_back(it->second.pair_.svt_->get_id()); 01983 } 01984 }
OPENDDS_STRING OpenDDS::DCPS::DomainParticipantImpl::get_unique_id | ( | void | ) |
Return a unique string based on repo ID.
Definition at line 1793 of file DomainParticipantImpl.cpp.
References dp_id_.
01794 { 01795 return GuidConverter(dp_id_).uniqueId(); 01796 }
int OpenDDS::DCPS::DomainParticipantImpl::handle_exception | ( | ACE_HANDLE | fd | ) | [private, virtual] |
Reimplemented from ACE_Event_Handler.
Definition at line 2371 of file DomainParticipantImpl.cpp.
References ACE_Thread_Mutex::acquire(), OpenDDS::DCPS::ReplayerImpl::cleanup(), OpenDDS::DCPS::RecorderImpl::cleanup(), delete_publisher(), delete_subscriber(), delete_topic_i(), publishers_, publishers_protector_, recorders_, recorders_protector_, ACE_Thread_Mutex::release(), replayers_, replayers_protector_, DDS::RETCODE_ERROR, DDS::RETCODE_OK, shutdown_complete_, shutdown_condition_, shutdown_mutex_, shutdown_result_, ACE_Condition< ACE_Thread_Mutex >::signal(), subscribers_, subscribers_protector_, topics_, and topics_protector_.
Referenced by delete_contained_entities().
02372 { 02373 DDS::ReturnCode_t ret = DDS::RETCODE_OK; 02374 02375 // delete publishers 02376 { 02377 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 02378 tao_mon, 02379 this->publishers_protector_, 02380 DDS::RETCODE_ERROR); 02381 02382 PublisherSet::iterator pubIter = publishers_.begin(); 02383 DDS::Publisher_ptr pubPtr; 02384 size_t pubsize = publishers_.size(); 02385 02386 while (pubsize > 0) { 02387 pubPtr = (*pubIter).obj_.in(); 02388 ++pubIter; 02389 02390 DDS::ReturnCode_t result 02391 = pubPtr->delete_contained_entities(); 02392 02393 if (result != DDS::RETCODE_OK) { 02394 ret = result; 02395 } 02396 02397 result = delete_publisher(pubPtr); 02398 02399 if (result != DDS::RETCODE_OK) { 02400 ret = result; 02401 } 02402 02403 --pubsize; 02404 } 02405 02406 } 02407 02408 // delete subscribers 02409 { 02410 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 02411 tao_mon, 02412 this->subscribers_protector_, 02413 DDS::RETCODE_ERROR); 02414 02415 SubscriberSet::iterator subIter = subscribers_.begin(); 02416 DDS::Subscriber_ptr subPtr; 02417 size_t subsize = subscribers_.size(); 02418 02419 while (subsize > 0) { 02420 subPtr = (*subIter).obj_.in(); 02421 ++subIter; 02422 02423 DDS::ReturnCode_t result = subPtr->delete_contained_entities(); 02424 02425 if (result != DDS::RETCODE_OK) { 02426 ret = result; 02427 } 02428 02429 result = delete_subscriber(subPtr); 02430 02431 if (result != DDS::RETCODE_OK) { 02432 ret = result; 02433 } 02434 02435 --subsize; 02436 } 02437 } 02438 02439 // delete topics 02440 { 02441 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 02442 tao_mon, 02443 this->topics_protector_, 02444 DDS::RETCODE_ERROR); 02445 02446 TopicMap::iterator topicIter = topics_.begin(); 02447 DDS::Topic_ptr topicPtr; 02448 size_t topicsize = topics_.size(); 02449 02450 while (topicsize > 0) { 02451 topicPtr = topicIter->second.pair_.obj_.in(); 02452 ++topicIter; 02453 02454 // Delete the topic the reference count. 02455 const DDS::ReturnCode_t result = this->delete_topic_i(topicPtr, true); 02456 02457 if (result != DDS::RETCODE_OK) { 02458 ret = result; 02459 } 02460 --topicsize; 02461 } 02462 } 02463 02464 { 02465 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 02466 tao_mon, 02467 this->recorders_protector_, 02468 DDS::RETCODE_ERROR); 02469 02470 RecorderSet::iterator it = recorders_.begin(); 02471 for (; it != recorders_.end(); ++it ){ 02472 RecorderImpl* impl = dynamic_cast<RecorderImpl* >(it->in()); 02473 DDS::ReturnCode_t result = DDS::RETCODE_ERROR; 02474 if (impl) result = impl->cleanup(); 02475 if (result != DDS::RETCODE_OK) ret = result; 02476 } 02477 recorders_.clear(); 02478 } 02479 02480 { 02481 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 02482 tao_mon, 02483 this->replayers_protector_, 02484 DDS::RETCODE_ERROR); 02485 02486 ReplayerSet::iterator it = replayers_.begin(); 02487 for (; it != replayers_.end(); ++it ){ 02488 ReplayerImpl* impl = static_cast<ReplayerImpl* >(it->in()); 02489 DDS::ReturnCode_t result = DDS::RETCODE_ERROR; 02490 if (impl) result = impl->cleanup(); 02491 if (result != DDS::RETCODE_OK) ret = result; 02492 02493 } 02494 02495 replayers_.clear(); 02496 } 02497 02498 shutdown_mutex_.acquire(); 02499 shutdown_result_ = ret; 02500 shutdown_complete_ = true; 02501 shutdown_condition_.signal(); 02502 shutdown_mutex_.release(); 02503 02504 return 0; 02505 }
DDS::InstanceHandle_t OpenDDS::DCPS::DomainParticipantImpl::id_to_handle | ( | const RepoId & | id | ) |
Obtain a local handle representing a GUID.
Definition at line 1806 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::GUID_UNKNOWN, handle_protector_, OpenDDS::DCPS::HANDLE_UNKNOWN(), handles_, OpenDDS::DCPS::InstanceHandleGenerator::next(), participant_handles_, and repoIds_.
Referenced by OpenDDS::DCPS::RecorderImpl::add_association(), OpenDDS::DCPS::ReplayerImpl::association_complete_i(), OpenDDS::DCPS::TopicImpl::get_instance_handle(), OpenDDS::DCPS::ReplayerImpl::get_instance_handle(), OpenDDS::DCPS::RecorderImpl::get_instance_handle(), get_instance_handle(), OpenDDS::DCPS::ReplayerImpl::lookup_instance_handles(), OpenDDS::DCPS::RecorderImpl::lookup_instance_handles(), and OpenDDS::DCPS::RecorderImpl::repoid_to_bit_key().
01807 { 01808 if (id == GUID_UNKNOWN) { 01809 return this->participant_handles_.next(); 01810 } 01811 01812 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 01813 guard, 01814 this->handle_protector_, 01815 HANDLE_UNKNOWN); 01816 01817 HandleMap::const_iterator location = this->handles_.find(id); 01818 DDS::InstanceHandle_t result; 01819 01820 if (location == this->handles_.end()) { 01821 // Map new handle in both directions 01822 result = this->participant_handles_.next(); 01823 this->handles_[id] = result; 01824 this->repoIds_[result] = id; 01825 } else { 01826 result = location->second; 01827 } 01828 01829 return result; 01830 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::ignore_participant | ( | DDS::InstanceHandle_t | handle | ) | [virtual] |
Definition at line 1137 of file DomainParticipantImpl.cpp.
References ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, OpenDDS::DCPS::EntityImpl::enabled_, get_repoid(), ignored_participants_, LM_DEBUG, LM_ERROR, OPENDDS_STRING, DDS::RETCODE_ERROR, DDS::RETCODE_NOT_ENABLED, DDS::RETCODE_OK, DDS::RETCODE_UNSUPPORTED, and TheServiceParticipant.
01139 { 01140 #if !defined (DDS_HAS_MINIMUM_BIT) 01141 01142 if (enabled_ == false) { 01143 ACE_ERROR_RETURN((LM_ERROR, 01144 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_participant, ") 01145 ACE_TEXT("Entity is not enabled. \n")), 01146 DDS::RETCODE_NOT_ENABLED); 01147 } 01148 01149 RepoId ignoreId = get_repoid(handle); 01150 HandleMap::const_iterator location = this->ignored_participants_.find(ignoreId); 01151 01152 if (location == this->ignored_participants_.end()) { 01153 this->ignored_participants_[ ignoreId] = handle; 01154 } 01155 else {// ignore same participant again, just return ok. 01156 return DDS::RETCODE_OK; 01157 } 01158 01159 if (DCPS_debug_level >= 4) { 01160 GuidConverter converter(dp_id_); 01161 ACE_DEBUG((LM_DEBUG, 01162 ACE_TEXT("(%P|%t) DomainParticipantImpl::ignore_participant: ") 01163 ACE_TEXT("%C ignoring handle %x.\n"), 01164 OPENDDS_STRING(converter).c_str(), 01165 handle)); 01166 } 01167 01168 Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_); 01169 if (!disco->ignore_domain_participant(domain_id_, 01170 dp_id_, 01171 ignoreId)) { 01172 ACE_ERROR_RETURN((LM_ERROR, 01173 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_participant, ") 01174 ACE_TEXT("Could not ignore domain participant.\n")), 01175 DDS::RETCODE_NOT_ENABLED); 01176 return DDS::RETCODE_ERROR; 01177 } 01178 01179 01180 if (DCPS_debug_level >= 4) { 01181 GuidConverter converter(dp_id_); 01182 ACE_DEBUG((LM_DEBUG, 01183 ACE_TEXT("(%P|%t) DomainParticipantImpl::ignore_participant: ") 01184 ACE_TEXT("%C repo call returned.\n"), 01185 OPENDDS_STRING(converter).c_str())); 01186 } 01187 01188 return DDS::RETCODE_OK; 01189 #else 01190 ACE_UNUSED_ARG(handle); 01191 return DDS::RETCODE_UNSUPPORTED; 01192 #endif // !defined (DDS_HAS_MINIMUM_BIT) 01193 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::ignore_publication | ( | DDS::InstanceHandle_t | handle | ) | [virtual] |
Definition at line 1244 of file DomainParticipantImpl.cpp.
References ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, OpenDDS::DCPS::EntityImpl::enabled_, get_repoid(), LM_DEBUG, LM_ERROR, OPENDDS_STRING, DDS::RETCODE_ERROR, DDS::RETCODE_NOT_ENABLED, DDS::RETCODE_OK, DDS::RETCODE_UNSUPPORTED, and TheServiceParticipant.
01246 { 01247 #if !defined (DDS_HAS_MINIMUM_BIT) 01248 01249 if (enabled_ == false) { 01250 ACE_ERROR_RETURN((LM_ERROR, 01251 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_publication, ") 01252 ACE_TEXT(" Entity is not enabled. \n")), 01253 DDS::RETCODE_NOT_ENABLED); 01254 } 01255 01256 if (DCPS_debug_level >= 4) { 01257 GuidConverter converter(dp_id_); 01258 ACE_DEBUG((LM_DEBUG, 01259 ACE_TEXT("(%P|%t) DomainParticipantImpl::ignore_publication: ") 01260 ACE_TEXT("%C ignoring handle %x.\n"), 01261 OPENDDS_STRING(converter).c_str(), 01262 handle)); 01263 } 01264 01265 RepoId ignoreId = get_repoid(handle); 01266 Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_); 01267 if (!disco->ignore_publication(domain_id_, 01268 dp_id_, 01269 ignoreId)) { 01270 ACE_ERROR_RETURN((LM_ERROR, 01271 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_publication, ") 01272 ACE_TEXT(" could not ignore publication in discovery. \n")), 01273 DDS::RETCODE_ERROR); 01274 } 01275 01276 return DDS::RETCODE_OK; 01277 #else 01278 ACE_UNUSED_ARG(handle); 01279 return DDS::RETCODE_UNSUPPORTED; 01280 #endif // !defined (DDS_HAS_MINIMUM_BIT) 01281 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::ignore_subscription | ( | DDS::InstanceHandle_t | handle | ) | [virtual] |
Definition at line 1284 of file DomainParticipantImpl.cpp.
References ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, OpenDDS::DCPS::EntityImpl::enabled_, get_repoid(), LM_DEBUG, LM_ERROR, OPENDDS_STRING, DDS::RETCODE_ERROR, DDS::RETCODE_NOT_ENABLED, DDS::RETCODE_OK, DDS::RETCODE_UNSUPPORTED, and TheServiceParticipant.
01286 { 01287 #if !defined (DDS_HAS_MINIMUM_BIT) 01288 01289 if (enabled_ == false) { 01290 ACE_ERROR_RETURN((LM_ERROR, 01291 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_subscription, ") 01292 ACE_TEXT(" Entity is not enabled. \n")), 01293 DDS::RETCODE_NOT_ENABLED); 01294 } 01295 01296 if (DCPS_debug_level >= 4) { 01297 GuidConverter converter(dp_id_); 01298 ACE_DEBUG((LM_DEBUG, 01299 ACE_TEXT("(%P|%t) DomainParticipantImpl::ignore_subscription: ") 01300 ACE_TEXT("%C ignoring handle %d.\n"), 01301 OPENDDS_STRING(converter).c_str(), 01302 handle)); 01303 } 01304 01305 01306 RepoId ignoreId = get_repoid(handle); 01307 Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_); 01308 if (!disco->ignore_subscription(domain_id_, 01309 dp_id_, 01310 ignoreId)) { 01311 ACE_ERROR_RETURN((LM_ERROR, 01312 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_subscription, ") 01313 ACE_TEXT(" could not ignore subscription in discovery. \n")), 01314 DDS::RETCODE_ERROR); 01315 } 01316 01317 return DDS::RETCODE_OK; 01318 #else 01319 ACE_UNUSED_ARG(handle); 01320 return DDS::RETCODE_UNSUPPORTED; 01321 #endif // !defined (DDS_HAS_MINIMUM_BIT) 01322 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::ignore_topic | ( | DDS::InstanceHandle_t | handle | ) | [virtual] |
Definition at line 1196 of file DomainParticipantImpl.cpp.
References ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, domain_id_, dp_id_, OpenDDS::DCPS::EntityImpl::enabled_, get_repoid(), ignored_topics_, LM_DEBUG, LM_ERROR, OPENDDS_STRING, DDS::RETCODE_NOT_ENABLED, DDS::RETCODE_OK, DDS::RETCODE_UNSUPPORTED, and TheServiceParticipant.
01198 { 01199 #if !defined (DDS_HAS_MINIMUM_BIT) 01200 01201 if (enabled_ == false) { 01202 ACE_ERROR_RETURN((LM_ERROR, 01203 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_topic, ") 01204 ACE_TEXT(" Entity is not enabled. \n")), 01205 DDS::RETCODE_NOT_ENABLED); 01206 } 01207 01208 RepoId ignoreId = get_repoid(handle); 01209 HandleMap::const_iterator location = this->ignored_topics_.find(ignoreId); 01210 01211 if (location == this->ignored_topics_.end()) { 01212 this->ignored_topics_[ ignoreId] = handle; 01213 } 01214 else { // ignore same topic again, just return ok. 01215 return DDS::RETCODE_OK; 01216 } 01217 01218 if (DCPS_debug_level >= 4) { 01219 GuidConverter converter(dp_id_); 01220 ACE_DEBUG((LM_DEBUG, 01221 ACE_TEXT("(%P|%t) DomainParticipantImpl::ignore_topic: ") 01222 ACE_TEXT("%C ignoring handle %x.\n"), 01223 OPENDDS_STRING(converter).c_str(), 01224 handle)); 01225 } 01226 01227 Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_); 01228 if (!disco->ignore_topic(domain_id_, 01229 dp_id_, 01230 ignoreId)) { 01231 ACE_ERROR((LM_ERROR, 01232 ACE_TEXT("(%P|%t) ERROR: DomainParticipantImpl::ignore_topic, ") 01233 ACE_TEXT(" Could not ignore topic.\n"))); 01234 } 01235 01236 return DDS::RETCODE_OK; 01237 #else 01238 ACE_UNUSED_ARG(handle); 01239 return DDS::RETCODE_UNSUPPORTED; 01240 #endif // !defined (DDS_HAS_MINIMUM_BIT) 01241 }
bool OpenDDS::DCPS::DomainParticipantImpl::is_clean | ( | ) | const |
Check if the topic is used by any datareader or datawriter.
Definition at line 1945 of file DomainParticipantImpl.cpp.
References publishers_, subscribers_, TheTransientKludge, and topics_.
Referenced by OpenDDS::DCPS::DomainParticipantFactoryImpl::delete_participant().
01946 { 01947 bool sub_is_clean = subscribers_.empty(); 01948 bool topics_is_clean = topics_.size() == 0; 01949 01950 if (!TheTransientKludge->is_enabled()) { 01951 // There are four topics and builtin topic subscribers 01952 // left. 01953 01954 sub_is_clean = !sub_is_clean ? subscribers_.size() == 1 : true; 01955 topics_is_clean = !topics_is_clean ? topics_.size() == 4 : true; 01956 } 01957 return (publishers_.empty() 01958 && sub_is_clean 01959 && topics_is_clean); 01960 }
DDS::DomainParticipantListener_ptr OpenDDS::DCPS::DomainParticipantImpl::listener_for | ( | DDS::StatusKind | kind | ) |
This is used to retrieve the listener for a certain status change. If this DomainParticipant has a registered listener and the status kind is in the listener mask then the listener is returned. Otherwise, return nil.
Definition at line 1963 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), CORBA::LocalObject::_nil(), CORBA::is_nil(), listener_, and listener_mask_.
Referenced by OpenDDS::DCPS::TopicImpl::inconsistent_topic().
01964 { 01965 if (CORBA::is_nil(listener_.in()) || (listener_mask_ & kind) == 0) { 01966 return DDS::DomainParticipantListener::_nil (); 01967 } else { 01968 return DDS::DomainParticipantListener::_duplicate(listener_.in()); 01969 } 01970 }
ACE_Time_Value OpenDDS::DCPS::DomainParticipantImpl::liveliness_check_interval | ( | DDS::LivelinessQosPolicyKind | kind | ) | [private] |
Definition at line 2317 of file DomainParticipantImpl.cpp.
References ACE_Time_Value::max_time, publishers_, and publishers_protector_.
Referenced by OpenDDS::DCPS::DomainParticipantImpl::LivelinessTimer::handle_timeout().
02318 { 02319 ACE_Time_Value tv = ACE_Time_Value::max_time; 02320 02321 ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, 02322 tao_mon, 02323 this->publishers_protector_, 02324 tv); 02325 02326 for (PublisherSet::iterator it(publishers_.begin()); 02327 it != publishers_.end(); ++it) { 02328 tv = std::min (tv, it->svt_->liveliness_check_interval(kind)); 02329 } 02330 02331 return tv; 02332 }
DDS::TopicDescription_ptr OpenDDS::DCPS::DomainParticipantImpl::lookup_topicdescription | ( | const char * | name | ) | [virtual] |
Definition at line 712 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), CORBA::LocalObject::_nil(), Util::find(), topic_descrs_, topics_, and topics_protector_.
Referenced by OpenDDS::DCPS::InfoRepoDiscovery::init_bit(), and OpenDDS::DCPS::PeerDiscovery< Spdp >::init_bit().
00713 { 00714 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, 00715 tao_mon, 00716 this->topics_protector_, 00717 DDS::Topic::_nil()); 00718 00719 TopicMap::mapped_type* entry = 0; 00720 00721 if (Util::find(topics_, name, entry) == -1) { 00722 #if !defined(OPENDDS_NO_CONTENT_FILTERED_TOPIC) || !defined(OPENDDS_NO_MULTI_TOPIC) 00723 TopicDescriptionMap::iterator iter = topic_descrs_.find(name); 00724 if (iter != topic_descrs_.end()) { 00725 return DDS::TopicDescription::_duplicate(iter->second); 00726 } 00727 #endif 00728 return DDS::TopicDescription::_nil(); 00729 00730 } else { 00731 return DDS::TopicDescription::_duplicate(entry->pair_.obj_.in()); 00732 } 00733 }
RepoId OpenDDS::DCPS::DomainParticipantImpl::nextPubId | ( | ) | [private] |
OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_MAP | ( | OPENDDS_STRING | , | |
RcHandle< FilterEvaluator > | ||||
) | [private] |
typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_MAP | ( | DDS::InstanceHandle_t | , | |
RepoId | ||||
) |
typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_MAP | ( | OPENDDS_STRING | , | |
DDS::TopicDescription_var | ||||
) |
typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_MAP | ( | OPENDDS_STRING | , | |
RefCounted_Topic | ||||
) |
typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_MAP_CMP | ( | RepoId | , | |
DDS::InstanceHandle_t | , | |||
GUID_tKeyLessThan | ||||
) |
typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_SET | ( | Publisher_Pair | ) |
typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_SET | ( | Subscriber_Pair | ) |
typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_SET_CMP | ( | Replayer_var | , | |
VarLess< Replayer > | ||||
) | [private] |
typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_SET_CMP | ( | Recorder_var | , | |
VarLess< Recorder > | ||||
) | [private] |
typedef OpenDDS::DCPS::DomainParticipantImpl::OPENDDS_VECTOR | ( | RepoId | ) |
OwnershipManager * OpenDDS::DCPS::DomainParticipantImpl::ownership_manager | ( | ) |
Accessor for ownership manager.
Definition at line 1989 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::LocalObject< DDS::DomainParticipant >::_narrow(), bit_subscriber_, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC, DDS::DATA_AVAILABLE_STATUS, CORBA::is_nil(), and owner_man_.
Referenced by OpenDDS::DCPS::RecorderImpl::init().
01990 { 01991 #if !defined (DDS_HAS_MINIMUM_BIT) 01992 01993 DDS::DataReader_var dr = 01994 bit_subscriber_->lookup_datareader(BUILT_IN_PUBLICATION_TOPIC); 01995 DDS::PublicationBuiltinTopicDataDataReader_var bit_pub_dr = 01996 DDS::PublicationBuiltinTopicDataDataReader::_narrow(dr); 01997 01998 if (!CORBA::is_nil(bit_pub_dr.in())) { 01999 DDS::DataReaderListener_var listener = bit_pub_dr->get_listener(); 02000 if (CORBA::is_nil(listener.in())) { 02001 DDS::DataReaderListener_var bit_pub_listener = 02002 new BitPubListenerImpl(this); 02003 bit_pub_dr->set_listener(bit_pub_listener, DDS::DATA_AVAILABLE_STATUS); 02004 // Must call on_data_available when attaching a listener late - samples may be waiting 02005 bit_pub_listener->on_data_available(bit_pub_dr.in()); 02006 } 02007 } 02008 02009 #endif 02010 return &this->owner_man_; 02011 }
bool OpenDDS::DCPS::DomainParticipantImpl::participant_liveliness_activity_after | ( | const ACE_Time_Value & | tv | ) | [private] |
Definition at line 2335 of file DomainParticipantImpl.cpp.
References last_liveliness_activity_, publishers_, and publishers_protector_.
Referenced by OpenDDS::DCPS::DomainParticipantImpl::ParticipantLivelinessTimer::dispatch().
02336 { 02337 if (last_liveliness_activity_ > tv) { 02338 return true; 02339 } 02340 02341 ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, 02342 tao_mon, 02343 this->publishers_protector_, 02344 tv); 02345 02346 for (PublisherSet::iterator it(publishers_.begin()); 02347 it != publishers_.end(); ++it) { 02348 if (it->svt_->participant_liveliness_activity_after(tv)) { 02349 return true; 02350 } 02351 } 02352 02353 return false; 02354 }
void OpenDDS::DCPS::DomainParticipantImpl::remove_adjust_liveliness_timers | ( | ) |
Definition at line 2208 of file DomainParticipantImpl.cpp.
References automatic_liveliness_timer_, participant_liveliness_timer_, and OpenDDS::DCPS::DomainParticipantImpl::LivelinessTimer::remove_adjust().
02209 { 02210 automatic_liveliness_timer_.remove_adjust(); 02211 participant_liveliness_timer_.remove_adjust(); 02212 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::set_default_publisher_qos | ( | const DDS::PublisherQos & | qos | ) | [virtual] |
Definition at line 1357 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::Qos_Helper::consistent(), default_publisher_qos_, DDS::RETCODE_INCONSISTENT_POLICY, DDS::RETCODE_OK, and OpenDDS::DCPS::Qos_Helper::valid().
01359 { 01360 if (Qos_Helper::valid(qos) && Qos_Helper::consistent(qos)) { 01361 default_publisher_qos_ = qos; 01362 return DDS::RETCODE_OK; 01363 01364 } else { 01365 return DDS::RETCODE_INCONSISTENT_POLICY; 01366 } 01367 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::set_default_subscriber_qos | ( | const DDS::SubscriberQos & | qos | ) | [virtual] |
Definition at line 1378 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::Qos_Helper::consistent(), default_subscriber_qos_, DDS::RETCODE_INCONSISTENT_POLICY, DDS::RETCODE_OK, and OpenDDS::DCPS::Qos_Helper::valid().
01380 { 01381 if (Qos_Helper::valid(qos) && Qos_Helper::consistent(qos)) { 01382 default_subscriber_qos_ = qos; 01383 return DDS::RETCODE_OK; 01384 01385 } else { 01386 return DDS::RETCODE_INCONSISTENT_POLICY; 01387 } 01388 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::set_default_topic_qos | ( | const DDS::TopicQos & | qos | ) | [virtual] |
Definition at line 1399 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::Qos_Helper::consistent(), default_topic_qos_, DDS::RETCODE_INCONSISTENT_POLICY, DDS::RETCODE_OK, and OpenDDS::DCPS::Qos_Helper::valid().
01401 { 01402 if (Qos_Helper::valid(qos) && Qos_Helper::consistent(qos)) { 01403 default_topic_qos_ = qos; 01404 return DDS::RETCODE_OK; 01405 01406 } else { 01407 return DDS::RETCODE_INCONSISTENT_POLICY; 01408 } 01409 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::set_listener | ( | DDS::DomainParticipantListener_ptr | a_listener, | |
DDS::StatusMask | mask | |||
) | [virtual] |
Definition at line 1120 of file DomainParticipantImpl.cpp.
References CORBA::LocalObject::_duplicate(), listener_, listener_mask_, and DDS::RETCODE_OK.
Referenced by DomainParticipantImpl().
01123 { 01124 listener_mask_ = mask; 01125 //note: OK to duplicate a nil object ref 01126 listener_ = DDS::DomainParticipantListener::_duplicate(a_listener); 01127 return DDS::RETCODE_OK; 01128 }
DDS::ReturnCode_t OpenDDS::DCPS::DomainParticipantImpl::set_qos | ( | const DDS::DomainParticipantQos & | qos | ) | [virtual] |
Definition at line 1076 of file DomainParticipantImpl.cpp.
References ACE_TEXT(), OpenDDS::DCPS::Qos_Helper::changeable(), OpenDDS::DCPS::Qos_Helper::consistent(), domain_id_, dp_id_, OpenDDS::DCPS::EntityImpl::enabled_, LM_ERROR, qos_, DDS::RETCODE_ERROR, DDS::RETCODE_IMMUTABLE_POLICY, DDS::RETCODE_INCONSISTENT_POLICY, DDS::RETCODE_OK, status, TheServiceParticipant, and OpenDDS::DCPS::Qos_Helper::valid().
01078 { 01079 if (Qos_Helper::valid(qos) && Qos_Helper::consistent(qos)) { 01080 if (qos_ == qos) 01081 return DDS::RETCODE_OK; 01082 01083 // for the not changeable qos, it can be changed before enable 01084 if (!Qos_Helper::changeable(qos_, qos) && enabled_ == true) { 01085 return DDS::RETCODE_IMMUTABLE_POLICY; 01086 01087 } else { 01088 qos_ = qos; 01089 01090 Discovery_rch disco = TheServiceParticipant->get_discovery(domain_id_); 01091 const bool status = 01092 disco->update_domain_participant_qos(domain_id_, 01093 dp_id_, 01094 qos_); 01095 01096 if (!status) { 01097 ACE_ERROR_RETURN((LM_ERROR, 01098 ACE_TEXT("(%P|%t) DomainParticipantImpl::set_qos, ") 01099 ACE_TEXT("failed on compatibility check. \n")), 01100 DDS::RETCODE_ERROR); 01101 } 01102 } 01103 01104 return DDS::RETCODE_OK; 01105 01106 } else { 01107 return DDS::RETCODE_INCONSISTENT_POLICY; 01108 } 01109 }
void OpenDDS::DCPS::DomainParticipantImpl::signal_liveliness | ( | DDS::LivelinessQosPolicyKind | kind | ) | [private] |
Definition at line 2357 of file DomainParticipantImpl.cpp.
References domain_id_, get_id(), and TheServiceParticipant.
Referenced by OpenDDS::DCPS::DomainParticipantImpl::ParticipantLivelinessTimer::dispatch(), and OpenDDS::DCPS::DomainParticipantImpl::AutomaticLivelinessTimer::dispatch().
02358 { 02359 TheServiceParticipant->get_discovery(domain_id_)->signal_liveliness (domain_id_, get_id(), kind); 02360 }
void OpenDDS::DCPS::DomainParticipantImpl::update_ownership_strength | ( | const PublicationId & | pub_id, | |
const CORBA::Long & | ownership_strength | |||
) |
Called upon receiving new BIT publication data to update the ownership strength of a publication.
Definition at line 2014 of file DomainParticipantImpl.cpp.
References OpenDDS::DCPS::EntityImpl::get_deleted(), subscribers_, and subscribers_protector_.
Referenced by OpenDDS::DCPS::BitPubListenerImpl::on_data_available().
02016 { 02017 ACE_GUARD(ACE_Recursive_Thread_Mutex, 02018 tao_mon, 02019 this->subscribers_protector_); 02020 02021 if (this->get_deleted ()) 02022 return; 02023 02024 for (SubscriberSet::iterator it(this->subscribers_.begin()); 02025 it != this->subscribers_.end(); ++it) { 02026 it->svt_->update_ownership_strength(pub_id, ownership_strength); 02027 } 02028 }
bool OpenDDS::DCPS::DomainParticipantImpl::validate_publisher_qos | ( | DDS::PublisherQos & | publisher_qos | ) | [private] |
Definition at line 2051 of file DomainParticipantImpl.cpp.
References ACE_TEXT(), OpenDDS::DCPS::Qos_Helper::consistent(), get_default_publisher_qos(), LM_ERROR, OPENDDS_NO_OBJECT_MODEL_PROFILE_COMPATIBILITY_CHECK, PUBLISHER_QOS_DEFAULT, and OpenDDS::DCPS::Qos_Helper::valid().
Referenced by create_publisher(), and create_replayer().
02052 { 02053 if (pub_qos == PUBLISHER_QOS_DEFAULT) { 02054 this->get_default_publisher_qos(pub_qos); 02055 } 02056 02057 OPENDDS_NO_OBJECT_MODEL_PROFILE_COMPATIBILITY_CHECK(pub_qos, false); 02058 02059 if (!Qos_Helper::valid(pub_qos) || !Qos_Helper::consistent(pub_qos)) { 02060 ACE_ERROR((LM_ERROR, 02061 ACE_TEXT("(%P|%t) ERROR: ") 02062 ACE_TEXT("DomainParticipantImpl::validate_publisher_qos, ") 02063 ACE_TEXT("invalid qos.\n"))); 02064 return false; 02065 } 02066 02067 return true; 02068 }
bool OpenDDS::DCPS::DomainParticipantImpl::validate_subscriber_qos | ( | DDS::SubscriberQos & | subscriber_qos | ) | [private] |
Definition at line 2071 of file DomainParticipantImpl.cpp.
References ACE_TEXT(), OpenDDS::DCPS::Qos_Helper::consistent(), get_default_subscriber_qos(), LM_ERROR, OPENDDS_NO_OBJECT_MODEL_PROFILE_COMPATIBILITY_CHECK, SUBSCRIBER_QOS_DEFAULT, and OpenDDS::DCPS::Qos_Helper::valid().
Referenced by create_recorder(), and create_subscriber().
02072 { 02073 if (subscriber_qos == SUBSCRIBER_QOS_DEFAULT) { 02074 this->get_default_subscriber_qos(subscriber_qos); 02075 } 02076 02077 OPENDDS_NO_OBJECT_MODEL_PROFILE_COMPATIBILITY_CHECK(subscriber_qos, false); 02078 02079 if (!Qos_Helper::valid(subscriber_qos) || !Qos_Helper::consistent(subscriber_qos)) { 02080 ACE_ERROR((LM_ERROR, 02081 ACE_TEXT("(%P|%t) ERROR: ") 02082 ACE_TEXT("DomainParticipantImpl::validate_subscriber_qos, ") 02083 ACE_TEXT("invalid qos.\n"))); 02084 return false; 02085 } 02086 02087 02088 return true; 02089 }
AutomaticLivelinessTimer OpenDDS::DCPS::DomainParticipantImpl::automatic_liveliness_timer_ [private] |
Definition at line 548 of file DomainParticipantImpl.h.
Referenced by add_adjust_liveliness_timers(), and remove_adjust_liveliness_timers().
DDS::Subscriber_var OpenDDS::DCPS::DomainParticipantImpl::bit_subscriber_ [private] |
The built in topic subscriber.
Definition at line 484 of file DomainParticipantImpl.h.
Referenced by delete_contained_entities(), enable(), get_builtin_subscriber(), get_discovered_participant_data(), get_discovered_topic_data(), and ownership_manager().
The default publisher qos.
Definition at line 422 of file DomainParticipantImpl.h.
Referenced by get_default_publisher_qos(), and set_default_publisher_qos().
The default subscriber qos.
Definition at line 424 of file DomainParticipantImpl.h.
Referenced by get_default_subscriber_qos(), and set_default_subscriber_qos().
The default topic qos.
Definition at line 420 of file DomainParticipantImpl.h.
Referenced by get_default_topic_qos(), and set_default_topic_qos().
const DDS::DomainId_t OpenDDS::DCPS::DomainParticipantImpl::domain_id_ [private] |
The id of the domain that creates this participant.
Definition at line 444 of file DomainParticipantImpl.h.
Referenced by create_new_topic(), create_topic_i(), delete_contained_entities(), delete_topic_i(), enable(), find_topic(), get_domain_id(), ignore_participant(), ignore_publication(), ignore_subscription(), ignore_topic(), set_qos(), and signal_liveliness().
This participant id given by discovery.
Definition at line 446 of file DomainParticipantImpl.h.
Referenced by create_topic_i(), enable(), get_id(), get_instance_handle(), get_unique_id(), ignore_participant(), ignore_publication(), ignore_subscription(), ignore_topic(), and set_qos().
Definition at line 418 of file DomainParticipantImpl.h.
bool OpenDDS::DCPS::DomainParticipantImpl::federated_ [private] |
Whether this DomainParticipant is attached to a federated repository.
Definition at line 450 of file DomainParticipantImpl.h.
Referenced by enable().
Definition at line 501 of file DomainParticipantImpl.h.
Referenced by deref_filter_eval(), and get_filter_eval().
Protect the handle collection.
Definition at line 476 of file DomainParticipantImpl.h.
Referenced by get_discovered_participant_data(), get_discovered_participants(), get_discovered_topic_data(), get_discovered_topics(), get_repoid(), and id_to_handle().
HandleMap OpenDDS::DCPS::DomainParticipantImpl::handles_ [private] |
Bidirectional collection of handles <--> RepoIds.
Definition at line 463 of file DomainParticipantImpl.h.
Referenced by get_discovered_participant_data(), get_discovered_participants(), get_discovered_topic_data(), get_discovered_topics(), and id_to_handle().
HandleMap OpenDDS::DCPS::DomainParticipantImpl::ignored_participants_ [private] |
Collection of ignored participants.
Definition at line 466 of file DomainParticipantImpl.h.
Referenced by get_discovered_participants(), and ignore_participant().
HandleMap OpenDDS::DCPS::DomainParticipantImpl::ignored_topics_ [private] |
Collection of ignored topics.
Definition at line 468 of file DomainParticipantImpl.h.
Referenced by get_discovered_topics(), and ignore_topic().
Definition at line 561 of file DomainParticipantImpl.h.
Referenced by assert_liveliness(), and participant_liveliness_activity_after().
DDS::DomainParticipantListener_var OpenDDS::DCPS::DomainParticipantImpl::listener_ [private] |
Used to notify the entity for relevant events.
Definition at line 429 of file DomainParticipantImpl.h.
Referenced by get_listener(), listener_for(), and set_listener().
The StatusKind bit mask indicates which status condition change can be notified by the listener of this entity.
Definition at line 432 of file DomainParticipantImpl.h.
Referenced by listener_for(), and set_listener().
Definition at line 490 of file DomainParticipantImpl.h.
Referenced by create_new_topic(), create_topic_i(), DomainParticipantImpl(), and enable().
Definition at line 493 of file DomainParticipantImpl.h.
Referenced by ownership_manager().
Instance handle generators for non-repo backed entities (i.e. subscribers and publishers).
Definition at line 488 of file DomainParticipantImpl.h.
Referenced by create_publisher(), create_subscriber(), and id_to_handle().
ParticipantLivelinessTimer OpenDDS::DCPS::DomainParticipantImpl::participant_liveliness_timer_ [private] |
Definition at line 555 of file DomainParticipantImpl.h.
Referenced by add_adjust_liveliness_timers(), and remove_adjust_liveliness_timers().
Publisher ID generator.
Definition at line 497 of file DomainParticipantImpl.h.
Referenced by create_publisher().
PublisherSet OpenDDS::DCPS::DomainParticipantImpl::publishers_ [private] |
Collection of publishers.
Definition at line 453 of file DomainParticipantImpl.h.
Referenced by assert_liveliness(), contains_entity(), create_publisher(), delete_publisher(), enable(), handle_exception(), is_clean(), liveliness_check_interval(), and participant_liveliness_activity_after().
Protect the publisher collection.
Definition at line 470 of file DomainParticipantImpl.h.
Referenced by assert_liveliness(), contains_entity(), create_publisher(), delete_publisher(), handle_exception(), liveliness_check_interval(), and participant_liveliness_activity_after().
The qos of this DomainParticipant.
Definition at line 427 of file DomainParticipantImpl.h.
Referenced by create_new_topic(), create_publisher(), create_recorder(), create_replayer(), create_subscriber(), enable(), get_qos(), and set_qos().
RecorderSet OpenDDS::DCPS::DomainParticipantImpl::recorders_ [private] |
Definition at line 508 of file DomainParticipantImpl.h.
Referenced by create_recorder(), delete_recorder(), and handle_exception().
Protect the recorders collection.
Definition at line 516 of file DomainParticipantImpl.h.
Referenced by create_recorder(), delete_recorder(), and handle_exception().
ReplayerSet OpenDDS::DCPS::DomainParticipantImpl::replayers_ [private] |
Definition at line 509 of file DomainParticipantImpl.h.
Referenced by create_replayer(), delete_replayer(), and handle_exception().
Protect the replayers collection.
Definition at line 518 of file DomainParticipantImpl.h.
Referenced by create_replayer(), delete_replayer(), and handle_exception().
RepoIdMap OpenDDS::DCPS::DomainParticipantImpl::repoIds_ [private] |
Definition at line 464 of file DomainParticipantImpl.h.
Referenced by get_repoid(), and id_to_handle().
bool OpenDDS::DCPS::DomainParticipantImpl::shutdown_complete_ [private] |
Definition at line 481 of file DomainParticipantImpl.h.
Referenced by delete_contained_entities(), and handle_exception().
Definition at line 479 of file DomainParticipantImpl.h.
Referenced by delete_contained_entities(), and handle_exception().
Protect the shutdown.
Definition at line 478 of file DomainParticipantImpl.h.
Referenced by delete_contained_entities(), and handle_exception().
Definition at line 480 of file DomainParticipantImpl.h.
Referenced by delete_contained_entities(), and handle_exception().
SubscriberSet OpenDDS::DCPS::DomainParticipantImpl::subscribers_ [private] |
Collection of subscribers.
Definition at line 455 of file DomainParticipantImpl.h.
Referenced by contains_entity(), create_subscriber(), delete_subscriber(), enable(), handle_exception(), is_clean(), and update_ownership_strength().
Protect the subscriber collection.
Definition at line 472 of file DomainParticipantImpl.h.
Referenced by contains_entity(), create_subscriber(), delete_subscriber(), handle_exception(), and update_ownership_strength().
TopicDescriptionMap OpenDDS::DCPS::DomainParticipantImpl::topic_descrs_ [private] |
Collection of TopicDescriptions which are not also Topics.
Definition at line 460 of file DomainParticipantImpl.h.
Referenced by create_contentfilteredtopic(), create_multitopic(), create_topic_i(), delete_contentfilteredtopic(), delete_multitopic(), and lookup_topicdescription().
TopicMap OpenDDS::DCPS::DomainParticipantImpl::topics_ [private] |
Collection of topics.
Definition at line 457 of file DomainParticipantImpl.h.
Referenced by contains_entity(), create_contentfilteredtopic(), create_multitopic(), create_new_topic(), create_topic_i(), delete_topic_i(), enable(), find_topic(), get_topic_ids(), handle_exception(), is_clean(), and lookup_topicdescription().
Protect the topic collection.
Definition at line 474 of file DomainParticipantImpl.h.
Referenced by contains_entity(), create_contentfilteredtopic(), create_multitopic(), create_new_topic(), create_topic_i(), delete_contentfilteredtopic(), delete_multitopic(), delete_topic_i(), find_topic(), get_topic_ids(), handle_exception(), and lookup_topicdescription().
enum { ... } OpenDDS::DCPS::DomainParticipantImpl::TopicTypeMask [private] |
The implementation of create_topic.