From 92d718eea727ccfc966a634c085b95ac34b8aa43 Mon Sep 17 00:00:00 2001 From: msmit Date: Mon, 1 Nov 2010 11:11:09 +0000 Subject: Mon Nov 1 11:15:34 UTC 2010 Marcel Smit * connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp: * connectors/dds4ccm/impl/DDS_State_Connector_T.cpp: * connectors/dds4ccm/impl/Updater_T.cpp: * connectors/dds4ccm/impl/Writer_T.cpp: * connectors/dds4ccm/impl/dds4ccm_impl.mpc: * connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.h: * connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.cpp: * connectors/dds4ccm/impl/ndds/DDSDataReaderListener_T.h: * connectors/dds4ccm/impl/ndds/DDSDomainParticipantListener.h: * connectors/dds4ccm/impl/ndds/DDSTopicListener_T.h: * connectors/dds4ccm/impl/ndds/DataReader.h: * connectors/dds4ccm/impl/ndds/DataWriter.h: * connectors/dds4ccm/impl/ndds/DomainParticipantFactory_T.cpp: * connectors/dds4ccm/impl/ndds/DomainParticipantManager.h: * connectors/dds4ccm/impl/ndds/DomainParticipantManager.cpp: * connectors/dds4ccm/impl/ndds/DomainParticipant_T.cpp: * connectors/dds4ccm/impl/ndds/StatusCondition.h: * connectors/dds4ccm/impl/ndds/dds4ccm_ndds_export.h: * connectors/dds4ccm/impl/ndds/ndds.mpc: * connectors/dds4ccm/impl/Coherent_Changes_Guard.h: * connectors/dds4ccm/impl/Coherent_Changes_Guard.cpp: * connectors/dds4ccm/impl/DomainParticipantManager.h: * connectors/dds4ccm/impl/DomainParticipantManager.cpp: * connectors/dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h: * connectors/dds4ccm/impl/ndds/dds4ccm_ndds.mpc: Continued with the rename and move actions. * connectors/dds4ccm/tests/LateBinding/ReadGet/Receiver/RG_LateBinding_Receiver_impl.h: * connectors/dds4ccm/tests/LateBinding/ReadGet/Receiver/RG_LateBinding_Receiver_impl.cpp: Create two handlers in order to handle read and get separately. --- .../dds4ccm/impl/Coherent_Changes_Guard.cpp | 23 -- .../dds4ccm/impl/Coherent_Changes_Guard.h | 38 --- .../dds4ccm/impl/DDS_Event_Connector_T.cpp | 58 +++-- .../dds4ccm/impl/DDS_State_Connector_T.cpp | 100 +++---- .../dds4ccm/impl/DomainParticipantManager.cpp | 290 --------------------- .../dds4ccm/impl/DomainParticipantManager.h | 102 -------- CIAO/connectors/dds4ccm/impl/Updater_T.cpp | 2 +- CIAO/connectors/dds4ccm/impl/Writer_T.cpp | 2 +- CIAO/connectors/dds4ccm/impl/dds4ccm_impl.mpc | 2 - .../dds4ccm/impl/ndds/Coherent_Changes_Guard.cpp | 23 ++ .../dds4ccm/impl/ndds/Coherent_Changes_Guard.h | 36 +++ .../dds4ccm/impl/ndds/DDSDataReaderListener_T.h | 2 +- .../impl/ndds/DDSDomainParticipantListener.h | 2 +- .../dds4ccm/impl/ndds/DDSTopicListener_T.h | 2 +- CIAO/connectors/dds4ccm/impl/ndds/DataReader.h | 4 +- CIAO/connectors/dds4ccm/impl/ndds/DataWriter.h | 4 +- .../impl/ndds/DomainParticipantFactory_T.cpp | 2 +- .../dds4ccm/impl/ndds/DomainParticipantManager.cpp | 290 +++++++++++++++++++++ .../dds4ccm/impl/ndds/DomainParticipantManager.h | 102 ++++++++ .../dds4ccm/impl/ndds/DomainParticipant_T.cpp | 2 +- .../connectors/dds4ccm/impl/ndds/StatusCondition.h | 4 +- .../dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h | 36 --- CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_ndds.mpc | 22 -- .../dds4ccm/impl/ndds/dds4ccm_ndds_export.h | 36 +++ CIAO/connectors/dds4ccm/impl/ndds/ndds.mpc | 24 ++ .../Receiver/RG_LateBinding_Receiver_impl.cpp | 12 +- .../Receiver/RG_LateBinding_Receiver_impl.h | 3 +- 27 files changed, 619 insertions(+), 604 deletions(-) delete mode 100644 CIAO/connectors/dds4ccm/impl/Coherent_Changes_Guard.cpp delete mode 100644 CIAO/connectors/dds4ccm/impl/Coherent_Changes_Guard.h delete mode 100644 CIAO/connectors/dds4ccm/impl/DomainParticipantManager.cpp delete mode 100644 CIAO/connectors/dds4ccm/impl/DomainParticipantManager.h create mode 100644 CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.cpp create mode 100644 CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.h create mode 100644 CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantManager.cpp create mode 100644 CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantManager.h delete mode 100644 CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h delete mode 100644 CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_ndds.mpc create mode 100644 CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_ndds_export.h create mode 100644 CIAO/connectors/dds4ccm/impl/ndds/ndds.mpc (limited to 'CIAO/connectors') diff --git a/CIAO/connectors/dds4ccm/impl/Coherent_Changes_Guard.cpp b/CIAO/connectors/dds4ccm/impl/Coherent_Changes_Guard.cpp deleted file mode 100644 index 8626e351417..00000000000 --- a/CIAO/connectors/dds4ccm/impl/Coherent_Changes_Guard.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ -#include "dds4ccm/impl/Coherent_Changes_Guard.h" - -CIAO::DDS4CCM::Coherent_Changes_Guard::Coherent_Changes_Guard ( - DDSPublisher* p, - bool coherent_write) : - p_ (p), - coherent_write_ (coherent_write) -{ - if (this->coherent_write_) - { - p_->begin_coherent_changes (); - } -} - -CIAO::DDS4CCM::Coherent_Changes_Guard::~Coherent_Changes_Guard () -{ - if (this->coherent_write_) - { - this->p_->end_coherent_changes (); - } -} - diff --git a/CIAO/connectors/dds4ccm/impl/Coherent_Changes_Guard.h b/CIAO/connectors/dds4ccm/impl/Coherent_Changes_Guard.h deleted file mode 100644 index 4e1d3929dfd..00000000000 --- a/CIAO/connectors/dds4ccm/impl/Coherent_Changes_Guard.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @author William R. Otte - * @author Johnny Willemsen - * - * $Id$ - * - * Wrapper facade for NDDS. - */ - -#ifndef _CIAO_COHERENT_CHANGES_GUARD -#define _CIAO_COHERENT_CHANGES_GUARD - -#include "ace/Copy_Disabled.h" -#include "dds4ccm/impl/dds4ccm_dds_impl_export.h" - -#if (CIAO_DDS4CCM_NDDS==1) -# include "ndds/ndds_cpp.h" -#endif - -namespace CIAO -{ - namespace DDS4CCM - { - class DDS4CCM_DDS_IMPL_Export Coherent_Changes_Guard : - private ACE_Copy_Disabled - { - public: - Coherent_Changes_Guard (::DDSPublisher* p, bool coherent_write); - ~Coherent_Changes_Guard (); - private: - ::DDSPublisher* p_; - bool const coherent_write_; - }; - } -} - -#endif /* _CIAO_COHERENT_CHANGES_GUARD */ - diff --git a/CIAO/connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp b/CIAO/connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp index 4396c6635f5..f9f940469d3 100644 --- a/CIAO/connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp @@ -406,21 +406,24 @@ DDS_Event_Connector_T::ccm_passivate (vo try { - if (this->push_consumer_obtained_) + if (ACE_OS::strlen (this->topic_name_) != 0) { - this->push_consumer_.passivate (); + if (this->push_consumer_obtained_) + { + this->push_consumer_.passivate (); + } + + if (this->supplier_obtained_) + { + this->supplier_.passivate (); + } + + if (this->pull_consumer_obtained_) + { + this->pull_consumer_.passivate (); + } + TopicBaseConnector::ccm_passivate (); } - - if (this->supplier_obtained_) - { - this->supplier_.passivate (); - } - - if (this->pull_consumer_obtained_) - { - this->pull_consumer_.passivate (); - } - TopicBaseConnector::ccm_passivate (); } catch (const ::CCM_DDS::InternalError &ex) { @@ -455,21 +458,24 @@ DDS_Event_Connector_T::ccm_remove (void) try { - if (this->push_consumer_obtained_) - { - this->push_consumer_.remove (this->subscriber_.in ()); - } - - if (this->supplier_obtained_) - { - this->supplier_.remove (this->publisher_.in ()); - } - - if (this->pull_consumer_obtained_) + if (ACE_OS::strlen (this->topic_name_) != 0) { - this->pull_consumer_.remove (this->subscriber_.in ()); + if (this->push_consumer_obtained_) + { + this->push_consumer_.remove (this->subscriber_.in ()); + } + + if (this->supplier_obtained_) + { + this->supplier_.remove (this->publisher_.in ()); + } + + if (this->pull_consumer_obtained_) + { + this->pull_consumer_.remove (this->subscriber_.in ()); + } + TopicBaseConnector::ccm_remove (); } - TopicBaseConnector::ccm_remove (); } catch (const ::CCM_DDS::InternalError &ex) { diff --git a/CIAO/connectors/dds4ccm/impl/DDS_State_Connector_T.cpp b/CIAO/connectors/dds4ccm/impl/DDS_State_Connector_T.cpp index 4bf2cb8068f..47aec096414 100644 --- a/CIAO/connectors/dds4ccm/impl/DDS_State_Connector_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/DDS_State_Connector_T.cpp @@ -542,32 +542,35 @@ DDS_State_Connector_T::ccm_passivate (vo try { - if (this->observable_obtained_) + if (ACE_OS::strlen (this->topic_name_) != 0) { - this->observable_.passivate (); + if (this->observable_obtained_) + { + this->observable_.passivate (); + } + + if (this->push_observer_obtained_) + { + this->push_observer_.passivate (); + } + + if (this->push_state_observer_obtained_) + { + this->push_state_observer_.passivate (); + } + + if (this->pull_observer_obtained_) + { + this->pull_observer_.passivate (); + } + + if (this->passive_observer_obtained_) + { + this->passive_observer_.passivate (); + } + + TopicBaseConnector::ccm_passivate (); } - - if (this->push_observer_obtained_) - { - this->push_observer_.passivate (); - } - - if (this->push_state_observer_obtained_) - { - this->push_state_observer_.passivate (); - } - - if (this->pull_observer_obtained_) - { - this->pull_observer_.passivate (); - } - - if (this->passive_observer_obtained_) - { - this->passive_observer_.passivate (); - } - - TopicBaseConnector::ccm_passivate (); } catch (const ::CCM_DDS::InternalError &ex) { @@ -602,31 +605,34 @@ DDS_State_Connector_T::ccm_remove (void) try { - if (this->observable_obtained_) - { - this->observable_.remove (this->publisher_.in ()); - } - - if (this->push_observer_obtained_) - { - this->push_observer_.remove (this->subscriber_.in ()); - } - - if (this->push_state_observer_obtained_) - { - this->push_state_observer_.remove (this->subscriber_.in ()); - } - - if (this->pull_observer_obtained_) - { - this->pull_observer_.remove (this->subscriber_.in ()); - } - - if (this->passive_observer_obtained_) + if (ACE_OS::strlen (this->topic_name_) != 0) { - this->passive_observer_.remove (this->subscriber_.in ()); + if (this->observable_obtained_) + { + this->observable_.remove (this->publisher_.in ()); + } + + if (this->push_observer_obtained_) + { + this->push_observer_.remove (this->subscriber_.in ()); + } + + if (this->push_state_observer_obtained_) + { + this->push_state_observer_.remove (this->subscriber_.in ()); + } + + if (this->pull_observer_obtained_) + { + this->pull_observer_.remove (this->subscriber_.in ()); + } + + if (this->passive_observer_obtained_) + { + this->passive_observer_.remove (this->subscriber_.in ()); + } + TopicBaseConnector::ccm_remove (); } - TopicBaseConnector::ccm_remove (); } catch (const ::CCM_DDS::InternalError &ex) { diff --git a/CIAO/connectors/dds4ccm/impl/DomainParticipantManager.cpp b/CIAO/connectors/dds4ccm/impl/DomainParticipantManager.cpp deleted file mode 100644 index 7bc3e2f5b25..00000000000 --- a/CIAO/connectors/dds4ccm/impl/DomainParticipantManager.cpp +++ /dev/null @@ -1,290 +0,0 @@ -// $Id$ - -#include "DomainParticipantManager.h" -#include "dds4ccm/impl/Log_Macros.h" -#include "dds4ccm/impl/Utils.h" - -namespace CIAO -{ - namespace DDS4CCM - { - //============================================================ - // DomainParticipantManager::DDSParticipantTopic::DDSParticipantTopic - //============================================================ - DomainParticipantManager::DDSParticipantTopic::DDSParticipantTopic ( - DDSDomainParticipant * dp) - : ref_count_ (1), - dp_ (dp) - { - DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::DDSParticipantTopic"); - } - - DomainParticipantManager::DDSParticipantTopic::~DDSParticipantTopic (void) - { - DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::~DDSParticipantTopic"); - } - - DDSDomainParticipant * - DomainParticipantManager::DDSParticipantTopic::get_participant () - { - DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::get_participant"); - - return this->dp_; - } - - bool - DomainParticipantManager::DDSParticipantTopic::add_topic (DDSTopic * tp) - { - DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::add_topic"); - - if (this->tps_.find (tp) == this->tps_.end ()) - { - this->tps_[tp] = 1; - - DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO - "DomainParticipantManager::DDSParticipantTopic" - "::add_topic - Added provided topic. topic <%C> - " - "ref_count <%d>\n", - tp->get_name (), - this->tps_[tp])); - return true; - } - return false; - } - - bool - DomainParticipantManager::DDSParticipantTopic::remove_topic (DDSTopic * tp) - { - DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::remove_topic"); - if (this->tps_[tp] == 1) - { - return true; - } - --this->tps_[tp]; - DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO - "DomainParticipantManager::DDSParticipantTopic" - "::remove_topic - Decremented ref_count. topic <%C> - " - "ref_count <%d>\n", - tp->get_name (), - this->tps_[tp])); - return false; - } - - int - DomainParticipantManager::DDSParticipantTopic::_ref_count () - { - DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::_ref_count"); - - return this->ref_count_; - } - - void - DomainParticipantManager::DDSParticipantTopic::_inc_ref () - { - DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::_inc_ref"); - - ++this->ref_count_; - } - - void - DomainParticipantManager::DDSParticipantTopic::_dec_ref () - { - DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::_dec_ref"); - - --this->ref_count_; - } - - void - DomainParticipantManager::DDSParticipantTopic::_inc_ref_topic (DDSTopic * tp) - { - DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::_inc_ref_topic"); - - ++this->tps_[tp]; - - DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO - "DomainParticipantManager::DDSParticipantTopic" - "::_inc_ref_topic - Increment topic ref_count. topic <%C> " - "- ref_count <%d>\n", - tp->get_name (), - this->tps_[tp])); - } - - //============================================================ - // DomainParticipantManager::DomainParticipantManager - //============================================================ - DomainParticipantManager::DomainParticipantManager (void) - { - DDS4CCM_TRACE ("DomainParticipantManager::DomainParticipantManager"); - } - - DomainParticipantManager::~DomainParticipantManager (void) - { - DDS4CCM_TRACE ("DomainParticipantManager::~DomainParticipantManager"); - - DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO - "DomainParticipantManager::~DomainParticipantManager - " - "Finalizing DDS\n")); - - DDSDomainParticipantFactory::finalize_instance (); - } - - bool - DomainParticipantManager::add_topic (DDSDomainParticipant * dp, - DDSTopic * tp) - { - DDS4CCM_TRACE ("DomainParticipantManager::add_topic"); - DomainParticipants_iterator iter = - this->get_participanttopic_by_participant (dp); - if (iter != this->dps_.end ()) - { - return iter->second->add_topic (tp); - } - DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO - "DomainParticipantManager::add_topic - " - "Unable to find provided DomainParticipant.\n")); - return false; - } - - bool - DomainParticipantManager::remove_topic (DDSDomainParticipant * dp, - DDSTopic * tp) - { - DDS4CCM_TRACE ("DomainParticipantManager::remove_topic"); - DomainParticipants_iterator iter = - this->get_participanttopic_by_participant (dp); - if (iter != this->dps_.end ()) - { - return iter->second->remove_topic (tp); - } - return false; - } - - DDSDomainParticipant * - DomainParticipantManager::get_participant ( - const char * qos_profile) - { - DDS4CCM_TRACE ("DomainParticipantManager::get_participant"); - - ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, _guard, - this->dps_mutex_, CORBA::INTERNAL ()); - DDSParticipantTopic * dpt = this->dps_[qos_profile]; - if (dpt) - { - dpt->_inc_ref (); - DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO - "DomainParticipantManager::get_participant - " - "DomainParticipant found. profile <%C> - ref_count <%d>\n", - qos_profile, - dpt->_ref_count ())); - return dpt->get_participant (); - } - DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO - "DomainParticipantManager::get_participant - " - "DomainParticipant with profile <%C> does not exist.\n", - qos_profile)); - return 0; - } - - bool - DomainParticipantManager::add_participant ( - const char * qos_profile, - DDSDomainParticipant * dp) - { - DDS4CCM_TRACE ("DomainParticipantManager::add_participant"); - - ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, _guard, - this->dps_mutex_, CORBA::INTERNAL ()); - DomainParticipants_iterator iter = - this->get_participanttopic_by_participant (dp); - if (iter == this->dps_.end ()) - { - DDSParticipantTopic * dpt = 0; - ACE_NEW_THROW_EX (dpt, - DDSParticipantTopic (dp), - ::CORBA::NO_MEMORY ()); - this->dps_[qos_profile] = dpt; - DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO - "DomainParticipantManager::add_participant - " - "Added participant with profile <%C>.\n", - qos_profile)); - return true; - } - DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO - "DomainParticipantManager::add_participant - " - "Don't add participant with profile <%C> since it already " - "exists.\n", - qos_profile)); - return false; - } - - bool - DomainParticipantManager::remove_participant ( - DDSDomainParticipant * dp) - { - DDS4CCM_TRACE ("DomainParticipantManager::remove_participant"); - - ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, _guard, - this->dps_mutex_, CORBA::INTERNAL ()); - - DomainParticipants_iterator iter = - this->get_participanttopic_by_participant (dp); - if (iter != this->dps_.end ()) - { - if (iter->second->_ref_count () == 1) - { - delete iter->second; - - // Save to remove from list - this->dps_.erase (iter); - } - else - { - DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_UNIMP_ACTION, (LM_TRACE, DDS4CCM_INFO - "DomainParticipantManager::remove_participant - " - "Don't delete participant since " - "it's still used - ref_count <%d>\n", - iter->second->_ref_count ())); - iter->second->_dec_ref (); - return false; - } - } - return true; - } - - void - DomainParticipantManager::_inc_ref (DDSDomainParticipant * dp, - DDSTopic * tp) - { - DDS4CCM_TRACE ("DomainParticipantManager::_inc_ref"); - DomainParticipants_iterator iter = - this->get_participanttopic_by_participant (dp); - if (iter != this->dps_.end ()) - { - iter->second->_inc_ref_topic (tp); - } - } - - DomainParticipantManager::DomainParticipants_iterator - DomainParticipantManager::get_participanttopic_by_participant ( - DDSDomainParticipant * dp) - { - DDS4CCM_TRACE ("DomainParticipantManager::get_participanttopic_by_participant"); - - DomainParticipants_iterator pos = this->dps_.begin(); - while (pos != this->dps_.end()) - { - if (pos->second && pos->second->get_participant () == dp) - { - break; - } - ++pos; - } - return pos; - } - } -} - -#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) -template ACE_Singleton * - ACE_Singleton::singleton_; -#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ diff --git a/CIAO/connectors/dds4ccm/impl/DomainParticipantManager.h b/CIAO/connectors/dds4ccm/impl/DomainParticipantManager.h deleted file mode 100644 index 297b74abac3..00000000000 --- a/CIAO/connectors/dds4ccm/impl/DomainParticipantManager.h +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @author William R. Otte - * @author Johnny Willemsen - * - * $Id$ - * - * Wrapper facade for NDDS. - */ - -#ifndef DOMAINPARTICIPANTMANAGER_H_ -#define DOMAINPARTICIPANTMANAGER_H_ - -#include "dds4ccm/impl/dds4ccm_dds_impl_export.h" - -#include "ace/Singleton.h" -#include "ace/SString.h" -#include "tao/orbconf.h" - -#include "ndds/ndds_cpp.h" - -#include - -namespace CIAO -{ - namespace DDS4CCM - { - class DDS4CCM_DDS_IMPL_Export DomainParticipantManager - { - friend class ACE_Singleton; - - class DDSParticipantTopic - { - public: - DDSParticipantTopic (DDSDomainParticipant * dp); - ~DDSParticipantTopic (void); - - DDSDomainParticipant * get_participant (); - - bool add_topic (DDSTopic * tp); - bool remove_topic (DDSTopic * tp); - - int _ref_count (); - void _inc_ref (); - void _dec_ref (); - - void _inc_ref_topic (DDSTopic * tp); - private: - int ref_count_; - DDSDomainParticipant * dp_; - - typedef std::map Topics; - typedef Topics::iterator Topics_iterator; - Topics tps_; - }; - - public: - /// Constructor - DomainParticipantManager (void); - - /// Destructor - ~DomainParticipantManager (void); - - bool add_topic (DDSDomainParticipant *dp, DDSTopic * tp); - - bool remove_topic (DDSDomainParticipant * dp, DDSTopic *tp); - - DDSDomainParticipant * get_participant (const char * qos_profile); - - bool - add_participant (const char * qos_profile, DDSDomainParticipant * dp); - - bool remove_participant (DDSDomainParticipant * dp); - - void _inc_ref (DDSDomainParticipant * dp, DDSTopic * tp); - - private: - TAO_SYNCH_MUTEX dps_mutex_; - typedef std::map DomainParticipants; - typedef DomainParticipants::iterator DomainParticipants_iterator; - DomainParticipants dps_; - - DomainParticipants_iterator - get_participanttopic_by_participant (DDSDomainParticipant * dp); - - private: - ACE_UNIMPLEMENTED_FUNC (void operator= (const DomainParticipantManager &)) - ACE_UNIMPLEMENTED_FUNC (DomainParticipantManager (const DomainParticipantManager &)) - }; - - typedef ACE_Singleton Domain_Participant_Factory; - } -} - -#define DPMANAGER ::CIAO::DDS4CCM::Domain_Participant_Factory::instance () - -/// Declare a process wide singleton -DDS4CCM_DDS_IMPL_SINGLETON_DECLARE (ACE_Singleton, - ::CIAO::DDS4CCM::DomainParticipantManager, - TAO_SYNCH_MUTEX) - -#endif diff --git a/CIAO/connectors/dds4ccm/impl/Updater_T.cpp b/CIAO/connectors/dds4ccm/impl/Updater_T.cpp index 812c6eed0bf..a25fd0f8e52 100644 --- a/CIAO/connectors/dds4ccm/impl/Updater_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/Updater_T.cpp @@ -2,7 +2,7 @@ #include "dds4ccm/impl/ndds/DataWriter_T.h" #include "dds4ccm/impl/Utils.h" -#include "dds4ccm/impl/Coherent_Changes_Guard.h" +#include "dds4ccm/impl/ndds/Coherent_Changes_Guard.h" #include "dds4ccm/impl/Log_Macros.h" template diff --git a/CIAO/connectors/dds4ccm/impl/Writer_T.cpp b/CIAO/connectors/dds4ccm/impl/Writer_T.cpp index cdce59f8a68..496325dcd17 100644 --- a/CIAO/connectors/dds4ccm/impl/Writer_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/Writer_T.cpp @@ -2,7 +2,7 @@ #include "dds4ccm/impl/ndds/DataWriter_T.h" #include "dds4ccm/impl/Utils.h" -#include "dds4ccm/impl/Coherent_Changes_Guard.h" +#include "dds4ccm/impl/ndds/Coherent_Changes_Guard.h" #include "dds4ccm/impl/ndds/convertors/InstanceHandle_t.h" diff --git a/CIAO/connectors/dds4ccm/impl/dds4ccm_impl.mpc b/CIAO/connectors/dds4ccm/impl/dds4ccm_impl.mpc index 55de1ee0e15..412a73a0f3c 100644 --- a/CIAO/connectors/dds4ccm/impl/dds4ccm_impl.mpc +++ b/CIAO/connectors/dds4ccm/impl/dds4ccm_impl.mpc @@ -14,11 +14,9 @@ project(CIAO_DDS4CCM_DDS_Impl) : install, dds4ccm_skel, dds4ccm_lem_stub, taolib } Source_Files { - Coherent_Changes_Guard.cpp ContentFilterSetting.cpp Utils.cpp DDSCallbackStatusHandler.cpp - DomainParticipantManager.cpp Log_Macros.cpp } } diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.cpp b/CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.cpp new file mode 100644 index 00000000000..f298eb8ba42 --- /dev/null +++ b/CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.cpp @@ -0,0 +1,23 @@ +// $Id$ +#include "dds4ccm/impl/ndds/Coherent_Changes_Guard.h" + +CIAO::DDS4CCM::Coherent_Changes_Guard::Coherent_Changes_Guard ( + DDSPublisher* p, + bool coherent_write) : + p_ (p), + coherent_write_ (coherent_write) +{ + if (this->coherent_write_) + { + p_->begin_coherent_changes (); + } +} + +CIAO::DDS4CCM::Coherent_Changes_Guard::~Coherent_Changes_Guard () +{ + if (this->coherent_write_) + { + this->p_->end_coherent_changes (); + } +} + diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.h b/CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.h new file mode 100644 index 00000000000..19cf0f22347 --- /dev/null +++ b/CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.h @@ -0,0 +1,36 @@ +/** + * @author William R. Otte + * @author Johnny Willemsen + * + * $Id$ + * + * Wrapper facade for NDDS. + */ + +#ifndef _CIAO_COHERENT_CHANGES_GUARD +#define _CIAO_COHERENT_CHANGES_GUARD + +#include "ace/Copy_Disabled.h" +#include "dds4ccm/impl/dds4ccm_dds_impl_export.h" + +#include "ndds/ndds_cpp.h" + +namespace CIAO +{ + namespace DDS4CCM + { + class DDS4CCM_DDS_IMPL_Export Coherent_Changes_Guard : + private ACE_Copy_Disabled + { + public: + Coherent_Changes_Guard (::DDSPublisher* p, bool coherent_write); + ~Coherent_Changes_Guard (); + private: + ::DDSPublisher* p_; + bool const coherent_write_; + }; + } +} + +#endif /* _CIAO_COHERENT_CHANGES_GUARD */ + diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DDSDataReaderListener_T.h b/CIAO/connectors/dds4ccm/impl/ndds/DDSDataReaderListener_T.h index d513f28f68f..1e399ab1e05 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/DDSDataReaderListener_T.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/DDSDataReaderListener_T.h @@ -13,7 +13,7 @@ #include "dds4ccm/impl/dds4ccm_conf.h" #include "dds4ccm/idl/dds_rtf2_dcpsEC.h" -#include "dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h" +#include "dds4ccm/impl/ndds/dds4ccm_ndds_export.h" # include "ndds/ndds_cpp.h" diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DDSDomainParticipantListener.h b/CIAO/connectors/dds4ccm/impl/ndds/DDSDomainParticipantListener.h index 34a9aaaf656..12abb32500e 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/DDSDomainParticipantListener.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/DDSDomainParticipantListener.h @@ -12,7 +12,7 @@ #include "dds4ccm/idl/dds_rtf2_dcpsC.h" -#include "dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h" +#include "dds4ccm/impl/ndds/dds4ccm_ndds_export.h" #include "dds4ccm/impl/dds4ccm_conf.h" # include "ndds/ndds_cpp.h" diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DDSTopicListener_T.h b/CIAO/connectors/dds4ccm/impl/ndds/DDSTopicListener_T.h index cbf9278192d..e688b40f475 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/DDSTopicListener_T.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/DDSTopicListener_T.h @@ -12,7 +12,7 @@ #include "dds4ccm/idl/dds_rtf2_dcpsC.h" #include "dds4ccm/impl/dds4ccm_conf.h" -#include "dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h" +#include "dds4ccm/impl/ndds/dds4ccm_ndds_export.h" # include "ndds/ndds_cpp.h" diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DataReader.h b/CIAO/connectors/dds4ccm/impl/ndds/DataReader.h index fd45d8db178..71f7472dd32 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/DataReader.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/DataReader.h @@ -12,7 +12,7 @@ #include "dds4ccm/idl/dds_rtf2_dcpsC.h" #include "dds4ccm/idl/dds_rtf2_dcpsEC.h" -#include "dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h" +#include "dds4ccm/impl/ndds/dds4ccm_ndds_export.h" #include "dds4ccm/impl/dds4ccm_conf.h" #include "tao/LocalObject.h" @@ -23,7 +23,7 @@ namespace CIAO { namespace DDS4CCM { - class DDS4CCM_DDS_NDDS_Export DDS_DataReader_Base + class DDS4CCM_NDDS_Export DDS_DataReader_Base : public virtual ::DDS::DataReader, public virtual ::CORBA::LocalObject { diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.h b/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.h index addf9f79a43..2d69d30e3c3 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.h @@ -12,7 +12,7 @@ #include "dds4ccm/idl/dds_rtf2_dcpsC.h" #include "dds4ccm/idl/dds_rtf2_dcpsEC.h" -#include "dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h" +#include "dds4ccm/impl/ndds/dds4ccm_ndds_export.h" #include "dds4ccm/impl/dds4ccm_conf.h" #include "tao/LocalObject.h" @@ -23,7 +23,7 @@ namespace CIAO { namespace DDS4CCM { - class DDS4CCM_DDS_NDDS_Export DDS_DataWriter_Base + class DDS4CCM_NDDS_Export DDS_DataWriter_Base : public virtual ::DDS::DataWriter, public virtual ::CORBA::LocalObject { diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantFactory_T.cpp b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantFactory_T.cpp index 1259e541344..6bf55b872cc 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantFactory_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantFactory_T.cpp @@ -13,7 +13,7 @@ #include "dds4ccm/idl/dds4ccm_BaseC.h" #include "dds4ccm/impl/dds4ccm_conf.h" -#include "dds4ccm/impl/DomainParticipantManager.h" +#include "dds4ccm/impl/ndds/DomainParticipantManager.h" namespace CIAO diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantManager.cpp b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantManager.cpp new file mode 100644 index 00000000000..7bc3e2f5b25 --- /dev/null +++ b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantManager.cpp @@ -0,0 +1,290 @@ +// $Id$ + +#include "DomainParticipantManager.h" +#include "dds4ccm/impl/Log_Macros.h" +#include "dds4ccm/impl/Utils.h" + +namespace CIAO +{ + namespace DDS4CCM + { + //============================================================ + // DomainParticipantManager::DDSParticipantTopic::DDSParticipantTopic + //============================================================ + DomainParticipantManager::DDSParticipantTopic::DDSParticipantTopic ( + DDSDomainParticipant * dp) + : ref_count_ (1), + dp_ (dp) + { + DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::DDSParticipantTopic"); + } + + DomainParticipantManager::DDSParticipantTopic::~DDSParticipantTopic (void) + { + DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::~DDSParticipantTopic"); + } + + DDSDomainParticipant * + DomainParticipantManager::DDSParticipantTopic::get_participant () + { + DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::get_participant"); + + return this->dp_; + } + + bool + DomainParticipantManager::DDSParticipantTopic::add_topic (DDSTopic * tp) + { + DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::add_topic"); + + if (this->tps_.find (tp) == this->tps_.end ()) + { + this->tps_[tp] = 1; + + DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO + "DomainParticipantManager::DDSParticipantTopic" + "::add_topic - Added provided topic. topic <%C> - " + "ref_count <%d>\n", + tp->get_name (), + this->tps_[tp])); + return true; + } + return false; + } + + bool + DomainParticipantManager::DDSParticipantTopic::remove_topic (DDSTopic * tp) + { + DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::remove_topic"); + if (this->tps_[tp] == 1) + { + return true; + } + --this->tps_[tp]; + DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO + "DomainParticipantManager::DDSParticipantTopic" + "::remove_topic - Decremented ref_count. topic <%C> - " + "ref_count <%d>\n", + tp->get_name (), + this->tps_[tp])); + return false; + } + + int + DomainParticipantManager::DDSParticipantTopic::_ref_count () + { + DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::_ref_count"); + + return this->ref_count_; + } + + void + DomainParticipantManager::DDSParticipantTopic::_inc_ref () + { + DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::_inc_ref"); + + ++this->ref_count_; + } + + void + DomainParticipantManager::DDSParticipantTopic::_dec_ref () + { + DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::_dec_ref"); + + --this->ref_count_; + } + + void + DomainParticipantManager::DDSParticipantTopic::_inc_ref_topic (DDSTopic * tp) + { + DDS4CCM_TRACE ("DomainParticipantManager::DDSParticipantTopic::_inc_ref_topic"); + + ++this->tps_[tp]; + + DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO + "DomainParticipantManager::DDSParticipantTopic" + "::_inc_ref_topic - Increment topic ref_count. topic <%C> " + "- ref_count <%d>\n", + tp->get_name (), + this->tps_[tp])); + } + + //============================================================ + // DomainParticipantManager::DomainParticipantManager + //============================================================ + DomainParticipantManager::DomainParticipantManager (void) + { + DDS4CCM_TRACE ("DomainParticipantManager::DomainParticipantManager"); + } + + DomainParticipantManager::~DomainParticipantManager (void) + { + DDS4CCM_TRACE ("DomainParticipantManager::~DomainParticipantManager"); + + DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO + "DomainParticipantManager::~DomainParticipantManager - " + "Finalizing DDS\n")); + + DDSDomainParticipantFactory::finalize_instance (); + } + + bool + DomainParticipantManager::add_topic (DDSDomainParticipant * dp, + DDSTopic * tp) + { + DDS4CCM_TRACE ("DomainParticipantManager::add_topic"); + DomainParticipants_iterator iter = + this->get_participanttopic_by_participant (dp); + if (iter != this->dps_.end ()) + { + return iter->second->add_topic (tp); + } + DDS4CCM_ERROR (DDS4CCM_LOG_LEVEL_ERROR, (LM_ERROR, DDS4CCM_INFO + "DomainParticipantManager::add_topic - " + "Unable to find provided DomainParticipant.\n")); + return false; + } + + bool + DomainParticipantManager::remove_topic (DDSDomainParticipant * dp, + DDSTopic * tp) + { + DDS4CCM_TRACE ("DomainParticipantManager::remove_topic"); + DomainParticipants_iterator iter = + this->get_participanttopic_by_participant (dp); + if (iter != this->dps_.end ()) + { + return iter->second->remove_topic (tp); + } + return false; + } + + DDSDomainParticipant * + DomainParticipantManager::get_participant ( + const char * qos_profile) + { + DDS4CCM_TRACE ("DomainParticipantManager::get_participant"); + + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, _guard, + this->dps_mutex_, CORBA::INTERNAL ()); + DDSParticipantTopic * dpt = this->dps_[qos_profile]; + if (dpt) + { + dpt->_inc_ref (); + DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO + "DomainParticipantManager::get_participant - " + "DomainParticipant found. profile <%C> - ref_count <%d>\n", + qos_profile, + dpt->_ref_count ())); + return dpt->get_participant (); + } + DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO + "DomainParticipantManager::get_participant - " + "DomainParticipant with profile <%C> does not exist.\n", + qos_profile)); + return 0; + } + + bool + DomainParticipantManager::add_participant ( + const char * qos_profile, + DDSDomainParticipant * dp) + { + DDS4CCM_TRACE ("DomainParticipantManager::add_participant"); + + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, _guard, + this->dps_mutex_, CORBA::INTERNAL ()); + DomainParticipants_iterator iter = + this->get_participanttopic_by_participant (dp); + if (iter == this->dps_.end ()) + { + DDSParticipantTopic * dpt = 0; + ACE_NEW_THROW_EX (dpt, + DDSParticipantTopic (dp), + ::CORBA::NO_MEMORY ()); + this->dps_[qos_profile] = dpt; + DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO + "DomainParticipantManager::add_participant - " + "Added participant with profile <%C>.\n", + qos_profile)); + return true; + } + DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_DEBUG, DDS4CCM_INFO + "DomainParticipantManager::add_participant - " + "Don't add participant with profile <%C> since it already " + "exists.\n", + qos_profile)); + return false; + } + + bool + DomainParticipantManager::remove_participant ( + DDSDomainParticipant * dp) + { + DDS4CCM_TRACE ("DomainParticipantManager::remove_participant"); + + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, _guard, + this->dps_mutex_, CORBA::INTERNAL ()); + + DomainParticipants_iterator iter = + this->get_participanttopic_by_participant (dp); + if (iter != this->dps_.end ()) + { + if (iter->second->_ref_count () == 1) + { + delete iter->second; + + // Save to remove from list + this->dps_.erase (iter); + } + else + { + DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_UNIMP_ACTION, (LM_TRACE, DDS4CCM_INFO + "DomainParticipantManager::remove_participant - " + "Don't delete participant since " + "it's still used - ref_count <%d>\n", + iter->second->_ref_count ())); + iter->second->_dec_ref (); + return false; + } + } + return true; + } + + void + DomainParticipantManager::_inc_ref (DDSDomainParticipant * dp, + DDSTopic * tp) + { + DDS4CCM_TRACE ("DomainParticipantManager::_inc_ref"); + DomainParticipants_iterator iter = + this->get_participanttopic_by_participant (dp); + if (iter != this->dps_.end ()) + { + iter->second->_inc_ref_topic (tp); + } + } + + DomainParticipantManager::DomainParticipants_iterator + DomainParticipantManager::get_participanttopic_by_participant ( + DDSDomainParticipant * dp) + { + DDS4CCM_TRACE ("DomainParticipantManager::get_participanttopic_by_participant"); + + DomainParticipants_iterator pos = this->dps_.begin(); + while (pos != this->dps_.end()) + { + if (pos->second && pos->second->get_participant () == dp) + { + break; + } + ++pos; + } + return pos; + } + } +} + +#if defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION) +template ACE_Singleton * + ACE_Singleton::singleton_; +#endif /* ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION */ diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantManager.h b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantManager.h new file mode 100644 index 00000000000..297b74abac3 --- /dev/null +++ b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipantManager.h @@ -0,0 +1,102 @@ +/** + * @author William R. Otte + * @author Johnny Willemsen + * + * $Id$ + * + * Wrapper facade for NDDS. + */ + +#ifndef DOMAINPARTICIPANTMANAGER_H_ +#define DOMAINPARTICIPANTMANAGER_H_ + +#include "dds4ccm/impl/dds4ccm_dds_impl_export.h" + +#include "ace/Singleton.h" +#include "ace/SString.h" +#include "tao/orbconf.h" + +#include "ndds/ndds_cpp.h" + +#include + +namespace CIAO +{ + namespace DDS4CCM + { + class DDS4CCM_DDS_IMPL_Export DomainParticipantManager + { + friend class ACE_Singleton; + + class DDSParticipantTopic + { + public: + DDSParticipantTopic (DDSDomainParticipant * dp); + ~DDSParticipantTopic (void); + + DDSDomainParticipant * get_participant (); + + bool add_topic (DDSTopic * tp); + bool remove_topic (DDSTopic * tp); + + int _ref_count (); + void _inc_ref (); + void _dec_ref (); + + void _inc_ref_topic (DDSTopic * tp); + private: + int ref_count_; + DDSDomainParticipant * dp_; + + typedef std::map Topics; + typedef Topics::iterator Topics_iterator; + Topics tps_; + }; + + public: + /// Constructor + DomainParticipantManager (void); + + /// Destructor + ~DomainParticipantManager (void); + + bool add_topic (DDSDomainParticipant *dp, DDSTopic * tp); + + bool remove_topic (DDSDomainParticipant * dp, DDSTopic *tp); + + DDSDomainParticipant * get_participant (const char * qos_profile); + + bool + add_participant (const char * qos_profile, DDSDomainParticipant * dp); + + bool remove_participant (DDSDomainParticipant * dp); + + void _inc_ref (DDSDomainParticipant * dp, DDSTopic * tp); + + private: + TAO_SYNCH_MUTEX dps_mutex_; + typedef std::map DomainParticipants; + typedef DomainParticipants::iterator DomainParticipants_iterator; + DomainParticipants dps_; + + DomainParticipants_iterator + get_participanttopic_by_participant (DDSDomainParticipant * dp); + + private: + ACE_UNIMPLEMENTED_FUNC (void operator= (const DomainParticipantManager &)) + ACE_UNIMPLEMENTED_FUNC (DomainParticipantManager (const DomainParticipantManager &)) + }; + + typedef ACE_Singleton Domain_Participant_Factory; + } +} + +#define DPMANAGER ::CIAO::DDS4CCM::Domain_Participant_Factory::instance () + +/// Declare a process wide singleton +DDS4CCM_DDS_IMPL_SINGLETON_DECLARE (ACE_Singleton, + ::CIAO::DDS4CCM::DomainParticipantManager, + TAO_SYNCH_MUTEX) + +#endif diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant_T.cpp b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant_T.cpp index fb4b8737b6e..61b6b4ece18 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant_T.cpp @@ -12,7 +12,7 @@ #include "dds4ccm/impl/Utils.h" #include "dds4ccm/impl/TopicListener_T.h" -#include "dds4ccm/impl/DomainParticipantManager.h" +#include "dds4ccm/impl/ndds/DomainParticipantManager.h" #include "dds4ccm/impl/ndds/convertors/PublisherQos.h" #include "dds4ccm/impl/ndds/convertors/SubscriberQos.h" diff --git a/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.h b/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.h index c15e3a10168..8b2a43bc103 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.h @@ -13,7 +13,7 @@ #include "dds4ccm/idl/dds_rtf2_dcpsEC.h" #include "dds4ccm/idl/dds_rtf2_dcpsC.h" -#include "dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h" +#include "dds4ccm/impl/ndds/dds4ccm_ndds_export.h" #include "dds4ccm/impl/dds4ccm_conf.h" #include "tao/LocalObject.h" @@ -24,7 +24,7 @@ namespace CIAO { namespace DDS4CCM { - class DDS4CCM_DDS_NDDS_Export DDS_StatusCondition_i : + class DDS4CCM_NDDS_Export DDS_StatusCondition_i : public virtual ::DDS::StatusCondition, public virtual ::CORBA::LocalObject { diff --git a/CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h b/CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h deleted file mode 100644 index cce68d2f990..00000000000 --- a/CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_dds_ndds_export.h +++ /dev/null @@ -1,36 +0,0 @@ -// -*- C++ -*- -// $Id$ -// Definition for Win32 Export directives. -// ------------------------------ -#ifndef DDS4CCM_DDS_NDDS_EXPORT_H -#define DDS4CCM_DDS_NDDS_EXPORT_H - -#include "ace/config-all.h" - -#if defined (ACE_AS_STATIC_LIBS) && !defined (DDS4CCM_DDS_NDDS_HAS_DLL) -# define DDS4CCM_DDS_NDDS_HAS_DLL 0 -#endif /* ACE_AS_STATIC_LIBS && DDS4CCM_DDS_NDDS_HAS_DLL */ - -#if !defined (DDS4CCM_DDS_NDDS_HAS_DLL) -# define DDS4CCM_DDS_NDDS_HAS_DLL 1 -#endif /* ! DDS4CCM_DDS_NDDS_HAS_DLL */ - -#if defined (DDS4CCM_DDS_NDDS_HAS_DLL) && (DDS4CCM_DDS_NDDS_HAS_DLL == 1) -# if defined (DDS4CCM_DDS_NDDS_BUILD_DLL) -# define DDS4CCM_DDS_NDDS_Export ACE_Proper_Export_Flag -# define DDS4CCM_DDS_NDDS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# define DDS4CCM_DDS_NDDS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# else /* DDS4CCM_DDS_NDDS_BUILD_DLL */ -# define DDS4CCM_DDS_NDDS_Export ACE_Proper_Import_Flag -# define DDS4CCM_DDS_NDDS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# define DDS4CCM_DDS_NDDS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -# endif /* DDS4CCM_DDS_NDDS_BUILD_DLL */ -#else /* DDS4CCM_DDS_NDDS_HAS_DLL == 1 */ -# define DDS4CCM_DDS_NDDS_Export -# define DDS4CCM_DDS_NDDS_SINGLETON_DECLARATION(T) -# define DDS4CCM_DDS_NDDS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) -#endif /* DDS4CCM_DDS_NDDS_HAS_DLL == 1 */ - -#endif /* DDS4CCM_DDS_NDDS_EXPORT_H */ - -// End of auto generated file. diff --git a/CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_ndds.mpc b/CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_ndds.mpc deleted file mode 100644 index 23e9497bf07..00000000000 --- a/CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_ndds.mpc +++ /dev/null @@ -1,22 +0,0 @@ -// $Id$ - -project(CIAO_DDS4CCM_DDS_NDDS) : install, dds4ccm_skel, dds4ccm_lem_stub, taolib, ciao_output, ccm_stub, ciao_logger { - - dynamicflags += DDS4CCM_DDS_NDDS_BUILD_DLL - macros += BUILDING_DDS_NDDS_LIB - Header_Files { - *.h - ndds/*.h - } - - Template_Files { - *_T.cpp - } - - Source_Files { - DataReader.cpp - DataWriter.cpp - StatusCondition.cpp - DDSDomainParticipantListener.cpp - } -} diff --git a/CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_ndds_export.h b/CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_ndds_export.h new file mode 100644 index 00000000000..e8f95a00361 --- /dev/null +++ b/CIAO/connectors/dds4ccm/impl/ndds/dds4ccm_ndds_export.h @@ -0,0 +1,36 @@ +// -*- C++ -*- +// $Id$ +// Definition for Win32 Export directives. +// ------------------------------ +#ifndef DDS4CCM_DDS_NDDS_EXPORT_H +#define DDS4CCM_DDS_NDDS_EXPORT_H + +#include "ace/config-all.h" + +#if defined (ACE_AS_STATIC_LIBS) && !defined (DDS4CCM_NDDS_HAS_DLL) +# define DDS4CCM_NDDS_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && DDS4CCM_NDDS_HAS_DLL */ + +#if !defined (DDS4CCM_NDDS_HAS_DLL) +# define DDS4CCM_NDDS_HAS_DLL 1 +#endif /* ! DDS4CCM_NDDS_HAS_DLL */ + +#if defined (DDS4CCM_NDDS_HAS_DLL) && (DDS4CCM_NDDS_HAS_DLL == 1) +# if defined (DDS4CCM_DDS_NDDS_BUILD_DLL) +# define DDS4CCM_NDDS_Export ACE_Proper_Export_Flag +# define DDS4CCM_NDDS_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define DDS4CCM_DDS_NDDS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* DDS4CCM_DDS_NDDS_BUILD_DLL */ +# define DDS4CCM_NDDS_Export ACE_Proper_Import_Flag +# define DDS4CCM_NDDS_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define DDS4CCM_DDS_NDDS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* DDS4CCM_DDS_NDDS_BUILD_DLL */ +#else /* DDS4CCM_NDDS_HAS_DLL == 1 */ +# define DDS4CCM_NDDS_Export +# define DDS4CCM_NDDS_SINGLETON_DECLARATION(T) +# define DDS4CCM_DDS_NDDS_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* DDS4CCM_NDDS_HAS_DLL == 1 */ + +#endif /* DDS4CCM_DDS_NDDS_EXPORT_H */ + +// End of auto generated file. diff --git a/CIAO/connectors/dds4ccm/impl/ndds/ndds.mpc b/CIAO/connectors/dds4ccm/impl/ndds/ndds.mpc new file mode 100644 index 00000000000..fc9aa026ce2 --- /dev/null +++ b/CIAO/connectors/dds4ccm/impl/ndds/ndds.mpc @@ -0,0 +1,24 @@ +// $Id$ + +project(CIAO_DDS4CCM_DDS_NDDS) : install, dds4ccm_skel, dds4ccm_lem_stub, taolib, ciao_output, ccm_stub, ciao_logger { + + dynamicflags += DDS4CCM_DDS_NDDS_BUILD_DLL + macros += BUILDING_DDS_NDDS_LIB + Header_Files { + *.h + ndds/*.h + } + + Template_Files { + *_T.cpp + } + + Source_Files { + DataReader.cpp + DataWriter.cpp + StatusCondition.cpp + DDSDomainParticipantListener.cpp + DomainParticipantManager.cpp + Coherent_Changes_Guard.cpp + } +} diff --git a/CIAO/connectors/dds4ccm/tests/LateBinding/ReadGet/Receiver/RG_LateBinding_Receiver_impl.cpp b/CIAO/connectors/dds4ccm/tests/LateBinding/ReadGet/Receiver/RG_LateBinding_Receiver_impl.cpp index 502dac842eb..be0b60e3b75 100644 --- a/CIAO/connectors/dds4ccm/tests/LateBinding/ReadGet/Receiver/RG_LateBinding_Receiver_impl.cpp +++ b/CIAO/connectors/dds4ccm/tests/LateBinding/ReadGet/Receiver/RG_LateBinding_Receiver_impl.cpp @@ -43,14 +43,18 @@ namespace CIAO_RG_LateBinding_Receiver_Impl ::RG_LateBinding::CCM_Receiver_Context::_duplicate (ctx)) , expected_ (expected) { - ACE_NEW_THROW_EX (this->to_handler_, + ACE_NEW_THROW_EX (this->to_handler_read_, + Timeout_Handler (*this), + ::CORBA::INTERNAL ()); + ACE_NEW_THROW_EX (this->to_handler_get_, Timeout_Handler (*this), ::CORBA::INTERNAL ()); } RG_LateBinding_Receiver_impl::~RG_LateBinding_Receiver_impl () { - delete this->to_handler_; + delete this->to_handler_read_; + delete this->to_handler_get_; } void @@ -308,7 +312,7 @@ namespace CIAO_RG_LateBinding_Receiver_Impl ACE_Reactor *reactor) { if (reactor->schedule_timer ( - this->to_handler_, + this->to_handler_read_, reinterpret_cast (0), ACE_Time_Value (8, 0)) == -1) { @@ -316,7 +320,7 @@ namespace CIAO_RG_LateBinding_Receiver_Impl "Error scheduling timer")); } if (reactor->schedule_timer ( - this->to_handler_, + this->to_handler_get_, reinterpret_cast (1), ACE_Time_Value (10, 0)) == -1) { diff --git a/CIAO/connectors/dds4ccm/tests/LateBinding/ReadGet/Receiver/RG_LateBinding_Receiver_impl.h b/CIAO/connectors/dds4ccm/tests/LateBinding/ReadGet/Receiver/RG_LateBinding_Receiver_impl.h index 04eaa1084c6..9d2b50b49bb 100644 --- a/CIAO/connectors/dds4ccm/tests/LateBinding/ReadGet/Receiver/RG_LateBinding_Receiver_impl.h +++ b/CIAO/connectors/dds4ccm/tests/LateBinding/ReadGet/Receiver/RG_LateBinding_Receiver_impl.h @@ -47,7 +47,8 @@ namespace CIAO_RG_LateBinding_Receiver_Impl ::RG_LateBinding::CCM_Receiver_Context_var ciao_context_; CORBA::UShort expected_; - Timeout_Handler *to_handler_; + Timeout_Handler *to_handler_read_; + Timeout_Handler *to_handler_get_; void check_samples ( const char * test, -- cgit v1.2.1