diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2010-02-24 10:45:23 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2010-02-24 10:45:23 +0000 |
commit | b50c019c40853c54c7dc658ce400cf609c18e664 (patch) | |
tree | 2345dd7650e939c1b4bf0da486e706ef48980ceb | |
parent | 230d5cb5d0ce1a5e098d6e29c04537dffb56651c (diff) | |
download | ATCD-b50c019c40853c54c7dc658ce400cf609c18e664.tar.gz |
Wed Feb 24 10:45:52 UTC 2010 Johnny Willemsen <jwillemsen@remedy.nl>
* connectors/dds4ccm/impl/ndds/ContentFilteredTopic.cpp
* connectors/dds4ccm/impl/ndds/DataReader.cpp
* connectors/dds4ccm/impl/ndds/DataWriter.cpp
* connectors/dds4ccm/impl/ndds/DomainParticipant.cpp
* connectors/dds4ccm/impl/ndds/Publisher.cpp
* connectors/dds4ccm/impl/ndds/Reader_T.h
* connectors/dds4ccm/impl/ndds/StatusCondition.cpp
* connectors/dds4ccm/impl/ndds/StatusCondition.h
* connectors/dds4ccm/impl/ndds/Subscriber.cpp
* connectors/dds4ccm/impl/ndds/Topic.cpp
* connectors/dds4ccm/impl/ndds/Topic.h
* connectors/dds4ccm/impl/ndds/TopicDescription.cpp
* connectors/dds4ccm/impl/ndds/TopicDescription.h
* connectors/dds4ccm/impl/ndds/TopicListener.cpp
* connectors/dds4ccm/impl/ndds/TopicListener.h
Cleaning up the implementation
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/ContentFilteredTopic.cpp | 24 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/DataReader.cpp | 32 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/DataWriter.cpp | 32 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant.cpp | 92 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/Publisher.cpp | 20 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/Reader_T.h | 2 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.cpp | 95 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.h | 45 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/Subscriber.cpp | 18 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/Topic.cpp | 282 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/Topic.h | 80 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/TopicDescription.cpp | 111 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/TopicDescription.h | 40 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/TopicListener.cpp | 63 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/ndds/TopicListener.h | 36 |
15 files changed, 490 insertions, 482 deletions
diff --git a/CIAO/connectors/dds4ccm/impl/ndds/ContentFilteredTopic.cpp b/CIAO/connectors/dds4ccm/impl/ndds/ContentFilteredTopic.cpp index 8eaf1247a00..ef389fc0620 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/ContentFilteredTopic.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/ContentFilteredTopic.cpp @@ -64,31 +64,45 @@ namespace CIAO RTI_ContentFilteredTopic_i::get_related_topic (void) { DDS4CCM_TRACE ("RTI_ContentFilteredTopic_i::get_related_topic"); + ::DDS::Topic_var retval = ::DDS::Topic::_nil (); +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + DDSTopic *topic = this->impl ()->get_related_topic (); ACE_NEW_THROW_EX (retval, - RTI_Topic_i (), + CCM_DDS_Topic_i (topic), CORBA::NO_MEMORY ()); - DDSTopic *topic = this->impl ()->get_related_topic (); - RTI_Topic_i *rti_topic = dynamic_cast < RTI_Topic_i *> (retval.in ()); - rti_topic->set_impl (topic); return retval._retn (); +#else + ::DDS::Topic_var topic = this->impl ()->get_related_topic (); + ACE_NEW_THROW_EX (retval, + CCM_DDS_Topic_i (topic.in ()), + CORBA::NO_MEMORY ()); + return retval._retn (); +#endif } char * RTI_ContentFilteredTopic_i::get_type_name (void) { +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) return CORBA::string_dup (this->impl ()->get_type_name ()); +#else +#endif } char * RTI_ContentFilteredTopic_i::get_name (void) { +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) return CORBA::string_dup (this->impl ()->get_name ()); +#else +#endif } ::DDS::DomainParticipant_ptr RTI_ContentFilteredTopic_i::get_participant (void) { +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) ::DDS::DomainParticipant_var retval = ::DDS::DomainParticipant::_nil (); ACE_NEW_THROW_EX (retval, RTI_DomainParticipant_i (), @@ -98,6 +112,8 @@ namespace CIAO RTI_DomainParticipant_i *rti_dp = dynamic_cast < RTI_DomainParticipant_i *> (retval.in ()); rti_dp->set_impl (p); return retval._retn (); +#else +#endif } DDSContentFilteredTopic * diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DataReader.cpp b/CIAO/connectors/dds4ccm/impl/ndds/DataReader.cpp index 9fb0b784d05..306d7d38a29 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/DataReader.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/DataReader.cpp @@ -45,19 +45,19 @@ namespace CIAO ::DDS::StatusCondition_ptr RTI_DataReader_i::get_statuscondition (void) { -#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) ::DDS::StatusCondition_var retval = ::DDS::StatusCondition::_nil (); +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + DDSStatusCondition* sc = this->impl ()->get_statuscondition (); ACE_NEW_THROW_EX (retval, - RTI_StatusCondition_i (), + CCM_DDS_StatusCondition_i (sc), CORBA::NO_MEMORY ()); - - DDSStatusCondition* sc = this->impl ()->get_statuscondition (); - RTI_StatusCondition_i *rti_sc = dynamic_cast < RTI_StatusCondition_i *> (retval.in ()); - rti_sc->set_impl (sc); - return retval._retn (); #else - return this->impl ()->get_statuscondition (); + ::DDS::StatusCondition_var sc = this->impl ()->get_statuscondition (); + ACE_NEW_THROW_EX (retval, + CCM_DDS_StatusCondition_i (sc.in ()), + CORBA::NO_MEMORY ()); #endif + return retval._retn (); } ::DDS::StatusMask @@ -230,19 +230,19 @@ namespace CIAO ::DDS::TopicDescription_ptr RTI_DataReader_i::get_topicdescription (void) { -#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) ::DDS::TopicDescription_var dds_td = ::DDS::TopicDescription::_nil (); +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + ::DDSTopicDescription* td = this->impl ()->get_topicdescription (); ACE_NEW_THROW_EX (dds_td, - RTI_TopicDescription_i (), + CCM_DDS_TopicDescription_i (td), CORBA::NO_MEMORY ()); - - ::DDSTopicDescription* td = this->impl ()->get_topicdescription (); - RTI_TopicDescription_i *rti_td = dynamic_cast < RTI_TopicDescription_i *>(dds_td.in ()); - rti_td->set_impl (td); - return dds_td._retn (); #else - return this->impl ()->get_topicdescription (); + ::DDS::TopicDescription_var td = this->impl ()->get_topicdescription (); + ACE_NEW_THROW_EX (dds_td, + CCM_DDS_TopicDescription_i (td.in ()), + CORBA::NO_MEMORY ()); #endif + return dds_td._retn (); } ::DDS::Subscriber_ptr diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.cpp b/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.cpp index f5dba7c72ce..c8026c6cd0c 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/DataWriter.cpp @@ -95,19 +95,19 @@ namespace CIAO ::DDS::Topic_ptr RTI_DataWriter_i::get_topic (void) { -#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) ::DDS::Topic_var retval = ::DDS::Topic::_nil (); +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + DDSTopic* t = this->impl ()->get_topic (); ACE_NEW_THROW_EX (retval, - RTI_Topic_i (), + CCM_DDS_Topic_i (t), CORBA::NO_MEMORY ()); - - DDSTopic* t = this->impl ()->get_topic (); - RTI_Topic_i *tp = dynamic_cast < RTI_Topic_i *> (retval.in ()); - tp->set_impl (t); - return retval._retn (); #else - return this->impl ()->get_topic (); + ::DDS::Topic_var t = this->impl ()->get_topic (); + ACE_NEW_THROW_EX (retval, + CCM_DDS_Topic_i (t.in ()), + CORBA::NO_MEMORY ()); #endif + return retval._retn (); } ::DDS::Publisher_ptr @@ -235,19 +235,19 @@ namespace CIAO ::DDS::StatusCondition_ptr RTI_DataWriter_i::get_statuscondition (void) { -#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) ::DDS::StatusCondition_var retval = ::DDS::StatusCondition::_nil (); +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + DDSStatusCondition* sc = this->impl ()->get_statuscondition (); ACE_NEW_THROW_EX (retval, - RTI_StatusCondition_i (), + CCM_DDS_StatusCondition_i (sc), CORBA::NO_MEMORY ()); - - DDSStatusCondition* sc = this->impl ()->get_statuscondition (); - RTI_StatusCondition_i *rti_sc = dynamic_cast < RTI_StatusCondition_i *> (retval.in ()); - rti_sc->set_impl (sc); - return retval._retn (); #else - return this->impl ()->get_statuscondition (); + ::DDS::StatusCondition_var sc = this->impl ()->get_statuscondition (); + ACE_NEW_THROW_EX (retval, + CCM_DDS_StatusCondition_i (sc.in ()), + CORBA::NO_MEMORY ()); #endif + return retval._retn (); } ::DDS::StatusMask diff --git a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant.cpp b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant.cpp index a501959fcfa..0699efb27b3 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/DomainParticipant.cpp @@ -362,16 +362,11 @@ namespace CIAO "Attempting to create topic with name %C and type %C\n", impl_name, type_name)); - ::DDS::Topic_var retval = ::DDS::Topic::_nil (); - ACE_NEW_THROW_EX (retval, - RTI_Topic_i (), - CORBA::NO_MEMORY ()); - - RTI_TopicListener_i *rti_tl = 0; + CCM_DDS_TopicListener_i *rti_tl = 0; if (!CORBA::is_nil (a_listener)) { ACE_NEW_THROW_EX (rti_tl, - RTI_TopicListener_i (a_listener), + CCM_DDS_TopicListener_i (a_listener), CORBA::NO_MEMORY ()); } @@ -380,6 +375,7 @@ namespace CIAO DDS_TOPIC_QOS_DEFAULT, rti_tl, mask); + if (rti_topic == 0) { DDS4CCM_ERROR (1, (LM_ERROR, CLINFO "DDS_DomainParticipant_i::create_topic - " @@ -388,11 +384,16 @@ namespace CIAO throw CCM_DDS::InternalError (::DDS::RETCODE_ERROR, 0); } + ::DDS::Topic_var retval = ::DDS::Topic::_nil (); + ACE_NEW_THROW_EX (retval, + CCM_DDS_Topic_i (rti_topic), + CORBA::NO_MEMORY ()); + DDS4CCM_DEBUG (6, (LM_INFO, CLINFO "DDS_DomainParticipant_i::create_topic - " "Successfully created topic with name %C and type %C\n", impl_name, type_name)); - RTI_Topic_i *tp = dynamic_cast < RTI_Topic_i *> (retval.in ()); + CCM_DDS_Topic_i *tp = dynamic_cast < CCM_DDS_Topic_i *> (retval.in ()); tp->set_impl (rti_topic); return retval._retn (); @@ -439,16 +440,11 @@ namespace CIAO ::DDS::Topic_var tp = this->find_topic (impl_name, dur); if (CORBA::is_nil (tp)) { - ::DDS::Topic_var retval = ::DDS::Topic::_nil (); - ACE_NEW_THROW_EX (retval, - RTI_Topic_i (), - CORBA::NO_MEMORY ()); - - RTI_TopicListener_i *rti_tl = 0; + CCM_DDS_TopicListener_i *rti_tl = 0; if (!CORBA::is_nil (a_listener)) { ACE_NEW_THROW_EX (rti_tl, - RTI_TopicListener_i (a_listener), + CCM_DDS_TopicListener_i (a_listener), CORBA::NO_MEMORY ()); } DDSTopic *rti_topic = this->impl ()->create_topic_with_profile (impl_name, @@ -466,11 +462,16 @@ namespace CIAO throw CCM_DDS::InternalError (::DDS::RETCODE_ERROR, 0); } + ::DDS::Topic_var retval = ::DDS::Topic::_nil (); + ACE_NEW_THROW_EX (retval, + CCM_DDS_Topic_i (rti_topic), + CORBA::NO_MEMORY ()); + DDS4CCM_DEBUG (6, (LM_INFO, CLINFO "DDS_DomainParticipant_i::create_topic_with_profile - " "Successfully created topic with name %C and type %C\n", impl_name, type_name)); - RTI_Topic_i *tp = dynamic_cast < RTI_Topic_i *> (retval.in ()); + CCM_DDS_Topic_i *tp = dynamic_cast < CCM_DDS_Topic_i *> (retval.in ()); tp->set_impl (rti_topic); return retval._retn (); @@ -491,7 +492,7 @@ namespace CIAO DDS4CCM_TRACE ("DDS_DomainParticipant_i::delete_topic"); #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - RTI_Topic_i *top = dynamic_cast< RTI_Topic_i *> (a_topic); + CCM_DDS_Topic_i *top = dynamic_cast< CCM_DDS_Topic_i *> (a_topic); if (top == 0) { @@ -524,41 +525,45 @@ namespace CIAO RTI_DomainParticipant_i::find_topic (const char * impl_name, const ::DDS::Duration_t & timeout) { + ::DDS::Topic_var retval = ::DDS::Topic::_nil (); #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) ::DDS_Duration_t ddstimeout; ddstimeout <<= timeout; - ::DDS::Topic_var retval = ::DDS::Topic::_nil (); - ACE_NEW_RETURN (retval, - RTI_Topic_i (), - ::DDS::Topic::_nil ()); - ::DDSTopic* rti_topic = this->impl ()->find_topic (impl_name, ddstimeout); - if (rti_topic) + ::DDSTopic* topic = this->impl ()->find_topic (impl_name, ddstimeout); + if (topic) { - RTI_Topic_i *tp = dynamic_cast < RTI_Topic_i *> (retval.in ()); - tp->set_impl (rti_topic); - return retval._retn (); + ACE_NEW_RETURN (retval, + CCM_DDS_Topic_i (topic), + ::DDS::Topic::_nil ()); } - return ::DDS::Topic::_nil (); #else - return this->impl ()->find_topic (impl_name, timeout); + ::DDS::Topic_var topic = this->impl ()->find_topic (impl_name, timeout); + if (rti_topic) + { + ACE_NEW_RETURN (retval, + CCM_DDS_Topic_i (topic.in ()), + ::DDS::Topic::_nil ()); + } #endif + return retval._retn (); } ::DDS::TopicDescription_ptr RTI_DomainParticipant_i::lookup_topicdescription (const char * name) { -#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) ::DDS::TopicDescription_var retval = ::DDS::TopicDescription::_nil (); +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + ::DDSTopicDescription* topic = this->impl ()->lookup_topicdescription (name); ACE_NEW_THROW_EX (retval, - RTI_TopicDescription_i (), + CCM_DDS_TopicDescription_i (topic), CORBA::NO_MEMORY ()); - ::DDSTopicDescription* rti_topic = this->impl ()->lookup_topicdescription (name); - RTI_TopicDescription_i *rti_td = dynamic_cast < RTI_TopicDescription_i *>(retval.in ()); - rti_td->set_impl (rti_topic); - return retval._retn (); #else - return this->impl ()->lookup_topicdescription (name); + ::DDSTopicDescription_var topic = this->impl ()->lookup_topicdescription (name); + ACE_NEW_THROW_EX (retval, + CCM_DDS_TopicDescription_i (topic.in ()), + CORBA::NO_MEMORY ()); #endif + return retval._retn (); } ::DDS::ContentFilteredTopic_ptr @@ -570,7 +575,7 @@ namespace CIAO DDS4CCM_TRACE ("DDS_DomainParticipant_i::create_contentfilteredtopic"); #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - RTI_Topic_i *top = dynamic_cast< RTI_Topic_i *> (related_topic); + CCM_DDS_Topic_i *top = dynamic_cast< CCM_DDS_Topic_i *> (related_topic); if (!top) { DDS4CCM_ERROR (1, (LM_ERROR, CLINFO "RTI_DomainParticipant_i::create_contentfilteredtopic - " @@ -899,18 +904,19 @@ namespace CIAO ::DDS::StatusCondition_ptr RTI_DomainParticipant_i::get_statuscondition (void) { -#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) ::DDS::StatusCondition_var retval = ::DDS::StatusCondition::_nil (); +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + DDSStatusCondition* sc = this->impl ()->get_statuscondition (); ACE_NEW_THROW_EX (retval, - RTI_StatusCondition_i (), + CCM_DDS_StatusCondition_i (sc), CORBA::NO_MEMORY ()); - DDSStatusCondition* sc = this->impl ()->get_statuscondition (); - RTI_StatusCondition_i *rti_sc = dynamic_cast < RTI_StatusCondition_i *> (retval.in ()); - rti_sc->set_impl (sc); - return retval._retn (); #else - return this->impl ()->get_statuscondition (); + ::DDS::StatusCondition_var sc = this->impl ()->get_statuscondition (); + ACE_NEW_THROW_EX (retval, + CCM_DDS_StatusCondition_i (sc.in ()), + CORBA::NO_MEMORY ()); #endif + return retval._retn (); } ::DDS::StatusMask diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Publisher.cpp b/CIAO/connectors/dds4ccm/impl/ndds/Publisher.cpp index be24d40c5d6..9f88431cfab 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Publisher.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/Publisher.cpp @@ -43,7 +43,7 @@ namespace CIAO #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) ACE_UNUSED_ARG (qos); - RTI_Topic_i * topic = dynamic_cast < RTI_Topic_i * > (a_topic); + CCM_DDS_Topic_i * topic = dynamic_cast < CCM_DDS_Topic_i * > (a_topic); if (!topic) { @@ -103,7 +103,7 @@ namespace CIAO { DDS4CCM_TRACE ("RTI_Publisher_i::create_datawriter"); - RTI_Topic_i * topic = dynamic_cast < RTI_Topic_i * > (a_topic); + CCM_DDS_Topic_i * topic = dynamic_cast < CCM_DDS_Topic_i * > (a_topic); if (!topic) { @@ -345,19 +345,19 @@ namespace CIAO ::DDS::StatusCondition_ptr RTI_Publisher_i::get_statuscondition (void) { -#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) ::DDS::StatusCondition_var retval = ::DDS::StatusCondition::_nil (); +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + DDSStatusCondition* sc = this->impl ()->get_statuscondition (); ACE_NEW_THROW_EX (retval, - RTI_StatusCondition_i (), + CCM_DDS_StatusCondition_i (sc), CORBA::NO_MEMORY ()); - - DDSStatusCondition* sc = this->impl ()->get_statuscondition (); - RTI_StatusCondition_i *rti_sc = dynamic_cast < RTI_StatusCondition_i *> (retval.in ()); - rti_sc->set_impl (sc); - return retval._retn (); #else - return this->impl ()->get_statuscondition (); + ::DDS::StatusCondition_var sc = this->impl ()->get_statuscondition (); + ACE_NEW_THROW_EX (retval, + CCM_DDS_StatusCondition_i (sc.in ()), + CORBA::NO_MEMORY ()); #endif + return retval._retn (); } ::DDS::StatusMask diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Reader_T.h b/CIAO/connectors/dds4ccm/impl/ndds/Reader_T.h index fea1c03de7d..de473f0e4c7 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Reader_T.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/Reader_T.h @@ -12,7 +12,7 @@ #include "dds4ccm/idl/dds_rtf2_dcpsC.h" #include "ace/Copy_Disabled.h" -#if defined (DDS_MAJOR_VERSION) +#if defined (CIAO_DDS4CCM_OPENDDS) && (CIAO_DDS4CCM_OPENDDS==1) typedef ::DDS::InstanceHandle_t DDS_InstanceHandle_t; typedef ::DDS::SampleInfoSeq DDS_SampleInfoSeq; #endif diff --git a/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.cpp b/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.cpp index 2fc20f49bad..37baef77d72 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.cpp @@ -11,64 +11,61 @@ namespace CIAO { namespace DDS4CCM { - namespace RTI + CCM_DDS_StatusCondition_i::CCM_DDS_StatusCondition_i ( + DDSStatusCondition * sc) : + impl_ (sc) { - RTI_StatusCondition_i::RTI_StatusCondition_i (void) - : impl_ (0) - { - } - - RTI_StatusCondition_i::~RTI_StatusCondition_i (void) - { - } + } - ::CORBA::Boolean - RTI_StatusCondition_i::get_trigger_value (void) - { - return this->impl ()->get_trigger_value (); - } + CCM_DDS_StatusCondition_i::~CCM_DDS_StatusCondition_i (void) + { + } - ::DDS::StatusMask - RTI_StatusCondition_i::get_enabled_statuses (void) - { - return this->impl ()->get_enabled_statuses (); - } + ::CORBA::Boolean + CCM_DDS_StatusCondition_i::get_trigger_value (void) + { + return this->impl ()->get_trigger_value (); + } - ::DDS::ReturnCode_t - RTI_StatusCondition_i::set_enabled_statuses ( - ::DDS::StatusMask mask) - { - return this->impl ()->set_enabled_statuses (mask); - } + ::DDS::StatusMask + CCM_DDS_StatusCondition_i::get_enabled_statuses (void) + { + return this->impl ()->get_enabled_statuses (); + } - ::DDS::Entity_ptr - RTI_StatusCondition_i::get_entity (void) - { - throw CORBA::NO_IMPLEMENT (); - } + ::DDS::ReturnCode_t + CCM_DDS_StatusCondition_i::set_enabled_statuses ( + ::DDS::StatusMask mask) + { + return this->impl ()->set_enabled_statuses (mask); + } - DDSStatusCondition * - RTI_StatusCondition_i::get_impl (void) - { - return this->impl_; - } + ::DDS::Entity_ptr + CCM_DDS_StatusCondition_i::get_entity (void) + { + throw CORBA::NO_IMPLEMENT (); + } - void - RTI_StatusCondition_i::set_impl (DDSStatusCondition * sc) - { - this->impl_ = sc; - } + DDSStatusCondition * + CCM_DDS_StatusCondition_i::get_impl (void) + { + return this->impl_; + } - DDSStatusCondition * - RTI_StatusCondition_i::impl (void) - { - if (!this->impl_) - { - throw ::CORBA::BAD_INV_ORDER (); - } - return this->impl_; - } + void + CCM_DDS_StatusCondition_i::set_impl (DDSStatusCondition * sc) + { + this->impl_ = sc; + } + DDSStatusCondition * + CCM_DDS_StatusCondition_i::impl (void) + { + if (!this->impl_) + { + throw ::CORBA::BAD_INV_ORDER (); + } + return this->impl_; } } } diff --git a/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.h b/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.h index 1b5da7373ed..b10b437f864 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/StatusCondition.h @@ -31,42 +31,33 @@ namespace CIAO { namespace DDS4CCM { - namespace RTI + class DDS4CCM_NDDS_IMPL_Export CCM_DDS_StatusCondition_i : + public virtual ::DDS::CCM_StatusCondition, + public virtual ::CORBA::LocalObject { - class DDS4CCM_NDDS_IMPL_Export RTI_StatusCondition_i : - public virtual ::DDS::CCM_StatusCondition, - public virtual ::CORBA::LocalObject - { - public: - // Constructor - RTI_StatusCondition_i (void); + public: + /// Constructor + CCM_DDS_StatusCondition_i (DDSStatusCondition *sc); - // Destructor - virtual ~RTI_StatusCondition_i (void); + /// Destructor + virtual ~CCM_DDS_StatusCondition_i (void); - virtual ::CORBA::Boolean - get_trigger_value (void); + virtual ::CORBA::Boolean get_trigger_value (void); - virtual ::DDS::StatusMask - get_enabled_statuses (void); + virtual ::DDS::StatusMask get_enabled_statuses (void); - virtual ::DDS::ReturnCode_t - set_enabled_statuses ( - ::DDS::StatusMask mask); + virtual ::DDS::ReturnCode_t set_enabled_statuses (::DDS::StatusMask mask); - virtual ::DDS::Entity_ptr - get_entity (void); + virtual ::DDS::Entity_ptr get_entity (void); - DDSStatusCondition * get_impl (void); + DDSStatusCondition * get_impl (void); - void set_impl (DDSStatusCondition * sc); + void set_impl (DDSStatusCondition * sc); - private: - DDSStatusCondition * impl_; - - DDSStatusCondition * impl (void); - }; - } + private: + DDSStatusCondition * impl_; + DDSStatusCondition * impl (void); + }; } } diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Subscriber.cpp b/CIAO/connectors/dds4ccm/impl/ndds/Subscriber.cpp index ce92ae11ad4..db78c8299a9 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Subscriber.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/Subscriber.cpp @@ -41,13 +41,17 @@ namespace CIAO RTI_Subscriber_i::get_statuscondition (void) { ::DDS::StatusCondition_var retval = ::DDS::StatusCondition::_nil (); +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + DDSStatusCondition* sc = this->impl ()->get_statuscondition (); ACE_NEW_THROW_EX (retval, - RTI_StatusCondition_i (), + CCM_DDS_StatusCondition_i (sc), CORBA::NO_MEMORY ()); - - DDSStatusCondition* sc = this->impl ()->get_statuscondition (); - RTI_StatusCondition_i *rti_sc = dynamic_cast < RTI_StatusCondition_i *> (retval.in ()); - rti_sc->set_impl (sc); +#else + ::DDS::StatusCondition_var sc = this->impl ()->get_statuscondition (); + ACE_NEW_THROW_EX (retval, + CCM_DDS_StatusCondition_i (sc.in ()), + CORBA::NO_MEMORY ()); +#endif return retval._retn (); } @@ -160,7 +164,7 @@ namespace CIAO } DDSDataReader * rti_dr = 0; - RTI_Topic_i * topic = dynamic_cast < RTI_Topic_i * > (a_topic); + CCM_DDS_Topic_i * topic = dynamic_cast < CCM_DDS_Topic_i * > (a_topic); if (!topic) { @@ -222,7 +226,7 @@ namespace CIAO } DDSDataReader * rti_dr = 0; - RTI_Topic_i * topic = dynamic_cast < RTI_Topic_i * > (a_topic); + CCM_DDS_Topic_i * topic = dynamic_cast < CCM_DDS_Topic_i * > (a_topic); if (!topic) { diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Topic.cpp b/CIAO/connectors/dds4ccm/impl/ndds/Topic.cpp index 0bce5bb96c7..b7a2218fdda 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Topic.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/Topic.cpp @@ -13,197 +13,195 @@ namespace CIAO { namespace DDS4CCM { - namespace RTI + CCM_DDS_Topic_i::CCM_DDS_Topic_i (DDSTopic* topic) + : impl_ (topic) { - RTI_Topic_i::RTI_Topic_i (void) - : impl_ (0) - { - } + } - RTI_Topic_i::~RTI_Topic_i (void) - { - } + CCM_DDS_Topic_i::~CCM_DDS_Topic_i (void) + { + } - ::DDS::ReturnCode_t - RTI_Topic_i::set_qos (const ::DDS::TopicQos &qos) - { + ::DDS::ReturnCode_t + CCM_DDS_Topic_i::set_qos (const ::DDS::TopicQos &qos) + { #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - ::DDS_TopicQos ddsqos; - ddsqos <<= qos; - return this->impl ()->set_qos (ddsqos); + ::DDS_TopicQos ddsqos; + ddsqos <<= qos; + return this->impl ()->set_qos (ddsqos); #else - return this->impl ()->set_qos (qos); + return this->impl ()->set_qos (qos); #endif - } + } - ::DDS::ReturnCode_t - RTI_Topic_i::get_qos (::DDS::TopicQos &qos) - { + ::DDS::ReturnCode_t + CCM_DDS_Topic_i::get_qos (::DDS::TopicQos &qos) + { #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - ::DDS_TopicQos ddsqos; - ::DDS_ReturnCode_t const retval = this->impl ()->get_qos (ddsqos); - qos <<= ddsqos; - return retval; + ::DDS_TopicQos ddsqos; + ::DDS_ReturnCode_t const retval = this->impl ()->get_qos (ddsqos); + qos <<= ddsqos; + return retval; #else - return this->impl ()->get_qos (qos); + return this->impl ()->get_qos (qos); #endif - } + } - ::DDS::ReturnCode_t - RTI_Topic_i::set_listener (::DDS::TopicListener_ptr a_listener, - ::DDS::StatusMask mask) - { - DDS4CCM_TRACE ("RTI_Topic_i::set_listener"); + ::DDS::ReturnCode_t + CCM_DDS_Topic_i::set_listener ( + ::DDS::TopicListener_ptr a_listener, + ::DDS::StatusMask mask) + { + DDS4CCM_TRACE ("CCM_DDS_Topic_i::set_listener"); #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - RTI_TopicListener_i *rti_impl_list = 0; - if (!CORBA::is_nil (a_listener)) - { - ACE_NEW_THROW_EX (rti_impl_list, - RTI_TopicListener_i (a_listener), - CORBA::NO_MEMORY ()); - } - return this->impl ()->set_listener (rti_impl_list, mask); + CCM_DDS_TopicListener_i *rti_impl_list = 0; + if (!CORBA::is_nil (a_listener)) + { + ACE_NEW_THROW_EX (rti_impl_list, + CCM_DDS_TopicListener_i (a_listener), + CORBA::NO_MEMORY ()); + } + return this->impl ()->set_listener (rti_impl_list, mask); #else - return this->impl ()->set_listener (a_listener, mask); + return this->impl ()->set_listener (a_listener, mask); #endif - } + } - ::DDS::TopicListener_ptr - RTI_Topic_i::get_listener (void) - { - DDS4CCM_TRACE ("RTI_Topic_i::get_listener"); + ::DDS::TopicListener_ptr + CCM_DDS_Topic_i::get_listener (void) + { + DDS4CCM_TRACE ("CCM_DDS_Topic_i::get_listener"); #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - DDSTopicListener *rti_topic_list = this->impl ()->get_listener (); - RTI_TopicListener_i *list_proxy = dynamic_cast <RTI_TopicListener_i *> (rti_topic_list); - if (!list_proxy) - { - DDS4CCM_DEBUG (6, (LM_DEBUG, "RTI_Topic_i::get_listener - " - "DDS returned a NIL listener.\n")); - return ::DDS::TopicListener::_nil (); - } - return list_proxy->get_topiclistener (); + DDSTopicListener *rti_topic_list = this->impl ()->get_listener (); + CCM_DDS_TopicListener_i *list_proxy = dynamic_cast <CCM_DDS_TopicListener_i *> (rti_topic_list); + if (!list_proxy) + { + DDS4CCM_DEBUG (6, (LM_DEBUG, "CCM_DDS_Topic_i::get_listener - " + "DDS returned a NIL listener.\n")); + return ::DDS::TopicListener::_nil (); + } + return list_proxy->get_topiclistener (); #else - return this->impl ()->get_listener (); + return this->impl ()->get_listener (); #endif - } + } - ::DDS::ReturnCode_t - RTI_Topic_i::get_inconsistent_topic_status (::DDS::InconsistentTopicStatus & a_status) - { + ::DDS::ReturnCode_t + CCM_DDS_Topic_i::get_inconsistent_topic_status ( + ::DDS::InconsistentTopicStatus & a_status) + { #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - DDS_InconsistentTopicStatus ddsstatus; - ddsstatus <<= a_status; - return this->impl ()->get_inconsistent_topic_status (ddsstatus); + DDS_InconsistentTopicStatus ddsstatus; + ddsstatus <<= a_status; + return this->impl ()->get_inconsistent_topic_status (ddsstatus); #else - return this->impl ()->get_inconsistent_topic_status (a_status); + return this->impl ()->get_inconsistent_topic_status (a_status); #endif - } + } - ::DDS::ReturnCode_t - RTI_Topic_i::enable (void) - { - return this->impl ()->enable (); - } + ::DDS::ReturnCode_t + CCM_DDS_Topic_i::enable (void) + { + return this->impl ()->enable (); + } - ::DDS::StatusCondition_ptr - RTI_Topic_i::get_statuscondition (void) - { + ::DDS::StatusCondition_ptr + CCM_DDS_Topic_i::get_statuscondition (void) + { + ::DDS::StatusCondition_var retval = ::DDS::StatusCondition::_nil (); #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - ::DDS::StatusCondition_var retval = ::DDS::StatusCondition::_nil (); - ACE_NEW_THROW_EX (retval, - RTI_StatusCondition_i (), - CORBA::NO_MEMORY ()); - - DDSStatusCondition* sc = this->impl ()->get_statuscondition (); - RTI_StatusCondition_i *rti_sc = dynamic_cast < RTI_StatusCondition_i *> (retval.in ()); - rti_sc->set_impl (sc); - return retval._retn (); + DDSStatusCondition* sc = this->impl ()->get_statuscondition (); + ACE_NEW_THROW_EX (retval, + CCM_DDS_StatusCondition_i (sc), + CORBA::NO_MEMORY ()); #else - return this->impl ()->get_statuscondition (); + ::DDS::StatusCondition_var sc = this->impl ()->get_statuscondition (); + ACE_NEW_THROW_EX (retval, + CCM_DDS_StatusCondition_i (sc.in ()), + CORBA::NO_MEMORY ()); #endif - } + return retval._retn (); + } - ::DDS::StatusMask - RTI_Topic_i::get_status_changes (void) - { - return this->impl ()->get_status_changes (); - } + ::DDS::StatusMask + CCM_DDS_Topic_i::get_status_changes (void) + { + return this->impl ()->get_status_changes (); + } - ::DDS::InstanceHandle_t - RTI_Topic_i::get_instance_handle (void) - { + ::DDS::InstanceHandle_t + CCM_DDS_Topic_i::get_instance_handle (void) + { #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - ::DDS_InstanceHandle_t const rtihandle = this->impl ()->get_instance_handle (); - ::DDS::InstanceHandle_t handle; - handle <<= rtihandle; - return handle; + ::DDS_InstanceHandle_t const rtihandle = this->impl ()->get_instance_handle (); + ::DDS::InstanceHandle_t handle; + handle <<= rtihandle; + return handle; #else - return this->impl ()->get_instance_handle (); + return this->impl ()->get_instance_handle (); #endif - } + } - char * - RTI_Topic_i::get_type_name (void) - { + char * + CCM_DDS_Topic_i::get_type_name (void) + { #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - return CORBA::string_dup (this->impl ()->get_type_name ()); + return CORBA::string_dup (this->impl ()->get_type_name ()); #else - return this->impl ()->get_type_name (); + return this->impl ()->get_type_name (); #endif - } + } - char * - RTI_Topic_i::get_name (void) - { + char * + CCM_DDS_Topic_i::get_name (void) + { #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - return CORBA::string_dup (this->impl ()->get_name ()); + return CORBA::string_dup (this->impl ()->get_name ()); #else - return this->impl ()->get_name (); + return this->impl ()->get_name (); #endif - } + } - ::DDS::DomainParticipant_ptr - RTI_Topic_i::get_participant (void) - { + ::DDS::DomainParticipant_ptr + CCM_DDS_Topic_i::get_participant (void) + { #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - ::DDS::DomainParticipant_var retval = ::DDS::DomainParticipant::_nil (); - ACE_NEW_THROW_EX (retval, - RTI_DomainParticipant_i (), - CORBA::NO_MEMORY ()); - - DDSDomainParticipant* p = this->impl ()->get_participant (); - RTI_DomainParticipant_i *rti_dp = dynamic_cast < RTI_DomainParticipant_i *> (retval.in ()); - rti_dp->set_impl (p); - return retval._retn (); + ::DDS::DomainParticipant_var retval = ::DDS::DomainParticipant::_nil (); + ACE_NEW_THROW_EX (retval, + ::CIAO::DDS4CCM::RTI::RTI_DomainParticipant_i (), + CORBA::NO_MEMORY ()); + + DDSDomainParticipant* p = this->impl ()->get_participant (); + ::CIAO::DDS4CCM::RTI::RTI_DomainParticipant_i *rti_dp = dynamic_cast < ::CIAO::DDS4CCM::RTI::RTI_DomainParticipant_i *> (retval.in ()); + rti_dp->set_impl (p); + return retval._retn (); #else - return this->impl ()->get_participant (); + return this->impl ()->get_participant (); #endif - } + } - DDSTopic * - RTI_Topic_i::get_impl (void) - { - return this->impl_; - } + DDSTopic * + CCM_DDS_Topic_i::get_impl (void) + { + return this->impl_; + } - void - RTI_Topic_i::set_impl (DDSTopic * topic) - { - this->impl_ = topic; - } + void + CCM_DDS_Topic_i::set_impl (DDSTopic * topic) + { + this->impl_ = topic; + } - DDSTopic * - RTI_Topic_i::impl (void) - { - if (!this->impl_) - { - throw ::CORBA::BAD_INV_ORDER (); - } - return this->impl_; + DDSTopic * + CCM_DDS_Topic_i::impl (void) + { + if (!this->impl_) + { + throw ::CORBA::BAD_INV_ORDER (); + } + return this->impl_; } - - } } } diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Topic.h b/CIAO/connectors/dds4ccm/impl/ndds/Topic.h index 1e12f982023..20b40839cd9 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Topic.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/Topic.h @@ -15,7 +15,7 @@ #include "dds4ccm/impl/ndds/dds4ccm_ndds_impl_export.h" #include "tao/LocalObject.h" -#if defined (DDS_MAJOR_VERSION) +#if defined (CIAO_DDS4CCM_OPENDDS) && (CIAO_DDS4CCM_OPENDDS==1) typedef ::DDS::Topic DDSTopic; #endif @@ -23,66 +23,60 @@ namespace CIAO { namespace DDS4CCM { - namespace RTI + class DDS4CCM_NDDS_IMPL_Export CCM_DDS_Topic_i : + public virtual ::DDS::CCM_Topic, + public virtual ::CORBA::LocalObject { - class DDS4CCM_NDDS_IMPL_Export RTI_Topic_i : - public virtual ::DDS::CCM_Topic, - public virtual ::CORBA::LocalObject - { - public: - // Constructor - RTI_Topic_i (void); + public: + /// Constructor + CCM_DDS_Topic_i (DDSTopic* topic); - // Destructor - virtual ~RTI_Topic_i (void); + /// Destructor + virtual ~CCM_DDS_Topic_i (void); - virtual - ::DDS::ReturnCode_t set_qos (const ::DDS::TopicQos & qos); + virtual ::DDS::ReturnCode_t set_qos (const ::DDS::TopicQos & qos); - virtual - ::DDS::ReturnCode_t get_qos (::DDS::TopicQos & qos); + virtual ::DDS::ReturnCode_t get_qos (::DDS::TopicQos & qos); - virtual - ::DDS::ReturnCode_t set_listener (::DDS::TopicListener_ptr a_listener, - ::DDS::StatusMask mask); + virtual ::DDS::ReturnCode_t set_listener ( + ::DDS::TopicListener_ptr a_listener, + ::DDS::StatusMask mask); - virtual - ::DDS::TopicListener_ptr get_listener (void); + virtual ::DDS::TopicListener_ptr get_listener (void); - virtual - ::DDS::ReturnCode_t get_inconsistent_topic_status (::DDS::InconsistentTopicStatus & a_status); + virtual ::DDS::ReturnCode_t get_inconsistent_topic_status ( + ::DDS::InconsistentTopicStatus & a_status); - virtual - ::DDS::ReturnCode_t enable (void); + virtual + ::DDS::ReturnCode_t enable (void); - virtual - ::DDS::StatusCondition_ptr get_statuscondition (void); + virtual + ::DDS::StatusCondition_ptr get_statuscondition (void); - virtual - ::DDS::StatusMask get_status_changes (void); + virtual + ::DDS::StatusMask get_status_changes (void); - virtual - ::DDS::InstanceHandle_t get_instance_handle (void); + virtual + ::DDS::InstanceHandle_t get_instance_handle (void); - virtual - char * get_type_name (void); + virtual + char * get_type_name (void); - virtual - char * get_name (void); + virtual + char * get_name (void); - virtual - ::DDS::DomainParticipant_ptr get_participant (void); + virtual + ::DDS::DomainParticipant_ptr get_participant (void); - DDSTopic * get_impl (void); + DDSTopic * get_impl (void); - void set_impl (DDSTopic * topic); + void set_impl (DDSTopic* topic); - private: - DDSTopic * impl_; + private: + DDSTopic * impl_; - DDSTopic * impl (void); - }; - } + DDSTopic * impl (void); + }; } } diff --git a/CIAO/connectors/dds4ccm/impl/ndds/TopicDescription.cpp b/CIAO/connectors/dds4ccm/impl/ndds/TopicDescription.cpp index 0f3ef19a300..fe844488904 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/TopicDescription.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/TopicDescription.cpp @@ -11,64 +11,75 @@ namespace CIAO { namespace DDS4CCM { - namespace RTI + CCM_DDS_TopicDescription_i::CCM_DDS_TopicDescription_i ( + DDSTopicDescription * rc) : impl_ (rc) { - RTI_TopicDescription_i::RTI_TopicDescription_i (void) - : impl_ (0) - { - } - - RTI_TopicDescription_i::~RTI_TopicDescription_i (void) - { - } + } - char * - RTI_TopicDescription_i::get_type_name (void) - { - return CORBA::string_dup (this->impl ()->get_type_name ()); - } + CCM_DDS_TopicDescription_i::~CCM_DDS_TopicDescription_i (void) + { + } - char * - RTI_TopicDescription_i::get_name (void) - { - return CORBA::string_dup (this->impl ()->get_name ()); - } + char * + CCM_DDS_TopicDescription_i::get_type_name (void) + { +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + return CORBA::string_dup (this->impl ()->get_type_name ()); +#else + return this->impl ()->get_type_name (); +#endif + } - ::DDS::DomainParticipant_ptr - RTI_TopicDescription_i::get_participant (void) - { - ::DDS::DomainParticipant_var retval = ::DDS::DomainParticipant::_nil (); - ACE_NEW_THROW_EX (retval, - RTI_DomainParticipant_i (), - CORBA::NO_MEMORY ()); - DDSDomainParticipant* p = this->impl ()->get_participant (); - RTI_DomainParticipant_i *rti_dp = dynamic_cast < RTI_DomainParticipant_i *> (retval.in ()); - rti_dp->set_impl (p); - return retval._retn (); - } + char * + CCM_DDS_TopicDescription_i::get_name (void) + { +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + return CORBA::string_dup (this->impl ()->get_name ()); +#else + return this->impl ()->get_name (); +#endif + } - DDSTopicDescription * - RTI_TopicDescription_i::get_impl (void) - { - return this->impl_; - } + ::DDS::DomainParticipant_ptr + CCM_DDS_TopicDescription_i::get_participant (void) + { + ::DDS::DomainParticipant_var retval = ::DDS::DomainParticipant::_nil (); +#if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) + ACE_NEW_THROW_EX (retval, + ::CIAO::DDS4CCM::RTI::RTI_DomainParticipant_i (), + CORBA::NO_MEMORY ()); + DDSDomainParticipant* p = this->impl ()->get_participant (); + ::CIAO::DDS4CCM::RTI::RTI_DomainParticipant_i *rti_dp = dynamic_cast < ::CIAO::DDS4CCM::RTI::RTI_DomainParticipant_i *> (retval.in ()); + rti_dp->set_impl (p); +#else + ::DDS::DomainParticipant_var p = this->impl ()->get_participant (); + ACE_NEW_THROW_EX (retval, + RTI_DomainParticipant_i (p.in ()), + CORBA::NO_MEMORY ()); +#endif + return retval._retn (); + } - void - RTI_TopicDescription_i::set_impl (DDSTopicDescription * rc) - { - this->impl_ = rc; - } + DDSTopicDescription * + CCM_DDS_TopicDescription_i::get_impl (void) + { + return this->impl_; + } - DDSTopicDescription * - RTI_TopicDescription_i::impl (void) - { - if (!this->impl_) - { - throw ::CORBA::BAD_INV_ORDER (); - } - return this->impl_; - } + void + CCM_DDS_TopicDescription_i::set_impl (DDSTopicDescription * rc) + { + this->impl_ = rc; + } + DDSTopicDescription * + CCM_DDS_TopicDescription_i::impl (void) + { + if (!this->impl_) + { + throw ::CORBA::BAD_INV_ORDER (); + } + return this->impl_; } } } diff --git a/CIAO/connectors/dds4ccm/impl/ndds/TopicDescription.h b/CIAO/connectors/dds4ccm/impl/ndds/TopicDescription.h index 10f90b24dfb..2cd87cf0057 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/TopicDescription.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/TopicDescription.h @@ -31,38 +31,32 @@ namespace CIAO { namespace DDS4CCM { - namespace RTI + class DDS4CCM_NDDS_IMPL_Export CCM_DDS_TopicDescription_i : + public virtual ::DDS::CCM_TopicDescription, + public virtual ::CORBA::LocalObject { - class DDS4CCM_NDDS_IMPL_Export RTI_TopicDescription_i : - public virtual ::DDS::CCM_TopicDescription, - public virtual ::CORBA::LocalObject - { - public: - // Constructor - RTI_TopicDescription_i (void); + public: + /// Constructor + CCM_DDS_TopicDescription_i (DDSTopicDescription * rc); - // Destructor - virtual ~RTI_TopicDescription_i (void); + /// Destructor + virtual ~CCM_DDS_TopicDescription_i (void); - virtual char * - get_type_name (void); + virtual char * get_type_name (void); - virtual char * - get_name (void); + virtual char * get_name (void); - virtual ::DDS::DomainParticipant_ptr - get_participant (void); + virtual ::DDS::DomainParticipant_ptr get_participant (void); - DDSTopicDescription * get_impl (void); + DDSTopicDescription * get_impl (void); - void set_impl (DDSTopicDescription * rc); + void set_impl (DDSTopicDescription * rc); - private: - DDSTopicDescription * impl_; + private: + DDSTopicDescription * impl_; - DDSTopicDescription * impl (void); - }; - } + DDSTopicDescription * impl (void); + }; } } diff --git a/CIAO/connectors/dds4ccm/impl/ndds/TopicListener.cpp b/CIAO/connectors/dds4ccm/impl/ndds/TopicListener.cpp index 95d6496bb18..6f25052d232 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/TopicListener.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/TopicListener.cpp @@ -12,40 +12,39 @@ namespace CIAO { namespace DDS4CCM { - namespace RTI + CCM_DDS_TopicListener_i::CCM_DDS_TopicListener_i (::DDS::TopicListener_ptr p) + : impl_ (::DDS::TopicListener::_duplicate (p)) + { + } + + CCM_DDS_TopicListener_i::~CCM_DDS_TopicListener_i (void) + { + } + + void + CCM_DDS_TopicListener_i::on_inconsistent_topic ( + ::DDSTopic* the_topic, + const ::DDS_InconsistentTopicStatus & status) { - RTI_TopicListener_i::RTI_TopicListener_i (::DDS::TopicListener_ptr p) - : impl_ (::DDS::TopicListener::_duplicate (p)) - { - } - - RTI_TopicListener_i::~RTI_TopicListener_i (void) - { - } - - void - RTI_TopicListener_i::on_inconsistent_topic ( - ::DDSTopic* the_topic, - const ::DDS_InconsistentTopicStatus & status) - { #if defined (CIAO_DDS4CCM_NDDS) && (CIAO_DDS4CCM_NDDS==1) - ::DDS::InconsistentTopicStatus ddsstatus; - ddsstatus <<= status; - ::DDS::Topic_var dds_topic = ::DDS::Topic::_nil (); - ACE_NEW (dds_topic, RTI_Topic_i ()); - RTI_Topic_i *tp = dynamic_cast < RTI_Topic_i *> (dds_topic.in ()); - tp->set_impl (the_topic); - this->impl_->on_inconsistent_topic (dds_topic.in (), ddsstatus); -#else - this->impl_->on_inconsistent_topic (the_topic, status); -#endif - } - - ::DDS::TopicListener_ptr - RTI_TopicListener_i::get_topiclistener (void) - { - return ::DDS::TopicListener::_duplicate (this->impl_.in ()); - } + ::DDS::InconsistentTopicStatus ddsstatus; + ddsstatus <<= status; + ::DDS::Topic_var dds_topic = ::DDS::Topic::_nil (); + ACE_NEW (dds_topic, + CCM_DDS_Topic_i (the_topic)); + this->impl_->on_inconsistent_topic (dds_topic.in (), ddsstatus); +#else + ::DDS::Topic_var dds_topic = ::DDS::Topic::_nil (); + ACE_NEW (dds_topic, + CCM_DDS_Topic_i (the_topic)); + this->impl_->on_inconsistent_topic (dds_topic.in (), status); +#endif + } + + ::DDS::TopicListener_ptr + CCM_DDS_TopicListener_i::get_topiclistener (void) + { + return ::DDS::TopicListener::_duplicate (this->impl_.in ()); } } } diff --git a/CIAO/connectors/dds4ccm/impl/ndds/TopicListener.h b/CIAO/connectors/dds4ccm/impl/ndds/TopicListener.h index 25c96d6b154..19098d1d066 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/TopicListener.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/TopicListener.h @@ -28,26 +28,24 @@ namespace CIAO { namespace DDS4CCM { - namespace RTI + class DDS4CCM_NDDS_IMPL_Export CCM_DDS_TopicListener_i : + public virtual ::DDSTopicListener { - class DDS4CCM_NDDS_IMPL_Export RTI_TopicListener_i : - public virtual ::DDSTopicListener - { - public: - // Constructor - RTI_TopicListener_i (::DDS::TopicListener_ptr p); - - // Destructor - virtual ~RTI_TopicListener_i (void); - - virtual void on_inconsistent_topic(::DDSTopic* topic, - const ::DDS_InconsistentTopicStatus& status); - - ::DDS::TopicListener_ptr get_topiclistener (void); - private: - ::DDS::TopicListener_var impl_; - }; - } + public: + /// Constructor + CCM_DDS_TopicListener_i (::DDS::TopicListener_ptr p); + + /// Destructor + virtual ~CCM_DDS_TopicListener_i (void); + + virtual void on_inconsistent_topic( + ::DDSTopic* topic, + const ::DDS_InconsistentTopicStatus& status); + + ::DDS::TopicListener_ptr get_topiclistener (void); + private: + ::DDS::TopicListener_var impl_; + }; } } |