diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2013-02-27 08:21:02 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2013-02-27 08:21:02 +0000 |
commit | 4a9946335b733825b523cb2978e6dbf0143a3c4f (patch) | |
tree | d69516f54bb0b1e678b438fec8a07f490b0e5fca | |
parent | 4348d1ff469fe6e67740643c5fa89c57729e4083 (diff) | |
download | ATCD-4a9946335b733825b523cb2978e6dbf0143a3c4f.tar.gz |
Wed Feb 27 08:17:40 UTC 2013 Johnny Willemsen <jwillemsen@remedy.nl>
* connectors/dds4ccm/idl/dds4ccm_Connector.idl:
* connectors/dds4ccm/impl/DDS_Base_Connector_T.h:
* connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp:
* connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h:
* connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp:
Added a type_name attribute to the DDS TopicBase connector.
When the user doesn't specifiy this in the cdp we will
default to the DDS vendor specific type_name which is
not standardized. In case of interoperability problems
this type_name could be needed. This addition has been
reported to the OMG as issue 18499. Updated a few logging
statements to include type_name and don't use CORBA::is_nil
for checking whether a String_var has content
-rw-r--r-- | CIAO/ChangeLog | 16 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/idl/dds4ccm_Connector.idl | 5 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp | 32 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.h | 2 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp | 49 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h | 5 |
6 files changed, 75 insertions, 34 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 5e2bc10e552..cdc6b69198f 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,19 @@ +Wed Feb 27 08:17:40 UTC 2013 Johnny Willemsen <jwillemsen@remedy.nl> + + * connectors/dds4ccm/idl/dds4ccm_Connector.idl: + * connectors/dds4ccm/impl/DDS_Base_Connector_T.h: + * connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp: + * connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h: + * connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp: + Added a type_name attribute to the DDS TopicBase connector. + When the user doesn't specifiy this in the cdp we will + default to the DDS vendor specific type_name which is + not standardized. In case of interoperability problems + this type_name could be needed. This addition has been + reported to the OMG as issue 18499. Updated a few logging + statements to include type_name and don't use CORBA::is_nil + for checking whether a String_var has content + Wed Feb 13 22:38:40 UTC 2013 Kevin Stanley <stanleyk@ociweb.com> * CIAO_TAO_OpenDDS.mwc: diff --git a/CIAO/connectors/dds4ccm/idl/dds4ccm_Connector.idl b/CIAO/connectors/dds4ccm/idl/dds4ccm_Connector.idl index b56754a4643..45e4a2cef68 100644 --- a/CIAO/connectors/dds4ccm/idl/dds4ccm_Connector.idl +++ b/CIAO/connectors/dds4ccm/idl/dds4ccm_Connector.idl @@ -23,6 +23,11 @@ module CCM_DDS setraises (NonChangeable); attribute DDS::StringSeq key_fields setraises (NonChangeable); + /// The type_name that will be used by DDS4CCM when + /// registering the topic to DDS. If empty the default + /// typename from the DDS typesupport will be used, this + /// default typename is vendor specific + attribute string type_name; }; }; diff --git a/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp b/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp index 3bddcee0e7d..f3c7012c760 100644 --- a/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.cpp @@ -198,7 +198,7 @@ DDS_Base_Connector_T<CCM_TYPE>::init_domain ( this->domain_id_)); #if (CIAO_DDS4CCM_NDDS==1) - if (!::CORBA::is_nil (this->qos_profile_.in ())) + if (this->qos_profile_.in () != 0) { this->participant_factory_->set_default_participant_qos_with_profile ( this->qos_profile_.in ()); @@ -255,7 +255,7 @@ DDS_Base_Connector_T<CCM_TYPE>::init_domain ( throw ::CCM_DDS::InternalError (retcode, 0); } - if (!::CORBA::is_nil (this->qos_profile_.in ()) && this->qos_xml_) + if (this->qos_profile_.in () != 0 && this->qos_xml_) { DDS::ReturnCode_t const retcode_dp_qos = this->qos_xml_->get_participant_qos ( @@ -316,7 +316,7 @@ DDS_Base_Connector_T<CCM_TYPE>::init_domain ( std::string rtps_transport_name = str_domain_id; config_name.append ("#"); rtps_transport_name.append ("#"); - if (!::CORBA::is_nil (this->qos_profile_.in ())) + if (this->qos_profile_.in () != 0) { config_name.append (this->qos_profile_.in ()); rtps_transport_name.append (this->qos_profile_.in ()); @@ -467,7 +467,7 @@ DDS_Base_Connector_T<CCM_TYPE>::init_topic ( ::DDS::DomainParticipant_ptr participant, ::DDS::Topic_ptr & topic, const char * topic_name, - const char * typesupport_name) + const char * type_name) { DDS4CCM_TRACE ("DDS_Base_Connector_T::init_topic"); @@ -498,11 +498,11 @@ DDS_Base_Connector_T<CCM_TYPE>::init_topic ( return; } #if (CIAO_DDS4CCM_NDDS==1) - if (!::CORBA::is_nil (this->qos_profile_.in ())) + if (this->qos_profile_.in () != 0) { // Create a new topic topic = participant->create_topic_with_profile (topic_name, - typesupport_name, + type_name, this->qos_profile_.in (), ::DDS::TopicListener::_nil (), 0); @@ -523,7 +523,7 @@ DDS_Base_Connector_T<CCM_TYPE>::init_topic ( throw ::CCM_DDS::InternalError (retcode, 0); } - if (!::CORBA::is_nil (this->qos_profile_.in ()) && this->qos_xml_) + if (this->qos_profile_.in () != 0 && this->qos_xml_) { DDS::ReturnCode_t const retcode_tp_qos = this->qos_xml_->get_topic_qos ( @@ -555,7 +555,7 @@ DDS_Base_Connector_T<CCM_TYPE>::init_topic ( // Create a new topic topic = participant->create_topic (topic_name, - typesupport_name, + type_name, tqos, ::DDS::TopicListener::_nil (), 0); @@ -567,9 +567,9 @@ DDS_Base_Connector_T<CCM_TYPE>::init_topic ( "DDS_Base_Connector_T::init_topic - " "Created new topic " DDS_ENTITY_FORMAT_SPECIFIER - " name <%C> for profile <%C>\n", + " name <%C> type <%C> for profile <%C>\n", DDS_ENTITY_LOG (topic), - topic_name, this->qos_profile_.in ())); + topic_name, type_name, this->qos_profile_.in ())); } else { @@ -592,7 +592,7 @@ DDS_Base_Connector_T<CCM_TYPE>::init_publisher ( if (::CORBA::is_nil (publisher)) { #if (CIAO_DDS4CCM_NDDS==1) - if (!::CORBA::is_nil (this->qos_profile_.in ())) + if (this->qos_profile_.in () != 0) { publisher = participant->create_publisher_with_profile ( this->qos_profile_.in (), @@ -615,7 +615,7 @@ DDS_Base_Connector_T<CCM_TYPE>::init_publisher ( throw ::CCM_DDS::InternalError (retcode, 0); } - if (!::CORBA::is_nil (this->qos_profile_.in ()) && this->qos_xml_) + if (this->qos_profile_.in () != 0 && this->qos_xml_) { DDS::ReturnCode_t const retcode_pub_qos = this->qos_xml_->get_publisher_qos ( @@ -681,7 +681,7 @@ DDS_Base_Connector_T<CCM_TYPE>::init_subscriber ( if (::CORBA::is_nil (subscriber)) { #if (CIAO_DDS4CCM_NDDS==1) - if (!::CORBA::is_nil (this->qos_profile_.in ())) + if (this->qos_profile_.in () != 0) { subscriber = participant->create_subscriber_with_profile ( this->qos_profile_.in (), @@ -704,7 +704,7 @@ DDS_Base_Connector_T<CCM_TYPE>::init_subscriber ( throw ::CCM_DDS::InternalError (retcode, 0); } - if (!::CORBA::is_nil (this->qos_profile_.in ()) && this->qos_xml_) + if (this->qos_profile_.in () != 0 && this->qos_xml_) { DDS::ReturnCode_t const retcode_sub_qos = this->qos_xml_->get_subscriber_qos ( @@ -983,7 +983,7 @@ void DDS_Base_Connector_T<CCM_TYPE>::remove_topic ( DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION_STARTING, (LM_TRACE, DDS4CCM_INFO "DDS_Base_Connector_T::remove_topic - " - "Going to delete topic <%C>" + "Going to delete topic <%C> " DDS_ENTITY_FORMAT_SPECIFIER "from participant" DDS_ENTITY_FORMAT_SPECIFIER @@ -996,7 +996,7 @@ void DDS_Base_Connector_T<CCM_TYPE>::remove_topic ( DDS4CCM_DEBUG (DDS4CCM_LOG_LEVEL_ACTION, (LM_TRACE, DDS4CCM_INFO "DDS_Base_Connector_T::remove_topic - " - "Deleted topic <%C>" + "Deleted topic <%C> " DDS_ENTITY_FORMAT_SPECIFIER "from " DDS_ENTITY_FORMAT_SPECIFIER diff --git a/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.h b/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.h index fc2ba6ec291..9baab8de523 100644 --- a/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.h +++ b/CIAO/connectors/dds4ccm/impl/DDS_Base_Connector_T.h @@ -93,7 +93,7 @@ protected: void init_topic (::DDS::DomainParticipant_ptr participant, ::DDS::Topic_ptr & topic, const char * topic_name, - const char * typesupport_name); + const char * type_name); void init_publisher (::DDS::DomainParticipant_ptr participant, ::DDS::Publisher_ptr & publisher); void init_subscriber (::DDS::DomainParticipant_ptr participant, diff --git a/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp b/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp index 1942dabe5f8..1be0e509db3 100644 --- a/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp @@ -41,7 +41,7 @@ DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, SEQ_TYPE>::stop_dds ( { DDS4CCM_TRACE ("DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, SEQ_TYPE>::stop_dds"); - if (!::CORBA::is_nil (this->topic_name_.in ())) + if (this->topic_name_.in () != 0) { //topic name already set // do not stop DDS when topic names are equal if (ACE_OS::strlen (this->topic_name_.in ()) == 0) @@ -90,13 +90,19 @@ DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, SEQ_TYPE>::configuration_complete DDS4CCM_TRACE ("DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, SEQ_TYPE>::configuration_complete"); BaseConnector::configuration_complete (); - ::CORBA::String_var typesupport_name; + + // When the user has not set a type_name we default to the DDS + // vendor defined default type_name + if (this->type_name_.in () == 0 || + ACE_OS::strlen (this->type_name_.in ()) == 0) + { #if (CIAO_DDS4CCM_NDDS==1) - typesupport_name = ::CORBA::string_dup (DDS_TYPE::type_support::get_type_name ()); + this->type_name_ = ::CORBA::string_dup (DDS_TYPE::type_support::get_type_name ()); #elif (CIAO_DDS4CCM_OPENDDS==1) - typename DDS_TYPE::type_support type; - typesupport_name = type.get_type_name (); + typename DDS_TYPE::type_support type; + this->type_name_ = type.get_type_name (); #endif + } ::CCM_DDS::ConnectorStatusListener_var error_listener = this->context_->get_connection_error_listener (); @@ -106,12 +112,12 @@ DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, SEQ_TYPE>::configuration_complete if (::CORBA::is_nil (this->topic_.in ())) { this->register_type (this->domain_participant_.in (), - typesupport_name); + this->type_name_.in ()); this->init_topic (this->domain_participant_.in (), this->topic_.inout () , this->topic_name_.in (), - typesupport_name.in ()); + this->type_name_.in ()); } if (this->init_subscriber_) @@ -208,16 +214,8 @@ DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, SEQ_TYPE>::ccm_remove (void) topic = ::DDS::Topic::_nil (); } - ::CORBA::String_var typesupport_name; -#if (CIAO_DDS4CCM_NDDS==1) - typesupport_name = ::CORBA::string_dup (DDS_TYPE::type_support::get_type_name ()); -#elif (CIAO_DDS4CCM_OPENDDS==1) - typename DDS_TYPE::type_support type; - typesupport_name = type.get_type_name (); -#endif - this->unregister_type (this->domain_participant_.in (), - typesupport_name.in ()); + this->type_name_.in ()); ::DDS::Subscriber_var subscriber = this->subscriber_._retn (); if (!::CORBA::is_nil (subscriber.in ())) @@ -344,6 +342,25 @@ DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, SEQ_TYPE>::topic_name ( } template <typename CCM_TYPE, typename DDS_TYPE, typename SEQ_TYPE> +char * +DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, SEQ_TYPE>::type_name (void) +{ + DDS4CCM_TRACE ("DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, SEQ_TYPE>::type_name"); + + return CORBA::string_dup (this->type_name_.in ()); +} + +template <typename CCM_TYPE, typename DDS_TYPE, typename SEQ_TYPE> +void +DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, SEQ_TYPE>::type_name ( + const char * type_name) +{ + DDS4CCM_TRACE ("DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, FIXED>::type_name"); + + this->type_name_ = type_name; +} + +template <typename CCM_TYPE, typename DDS_TYPE, typename SEQ_TYPE> void DDS_TopicBase_Connector_T<CCM_TYPE, DDS_TYPE, SEQ_TYPE>::key_fields ( const ::DDS::StringSeq & key_fields) diff --git a/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h b/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h index 0e2e3d4778f..a3fc73aaa1a 100644 --- a/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h +++ b/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h @@ -23,9 +23,11 @@ public: virtual ::DDS::StringSeq *key_fields (void); virtual void topic_name (const char * topic_name); - virtual char *topic_name (void); + virtual void type_name (const char * type_name); + virtual char *type_name (void); + virtual void key_fields (const ::DDS::StringSeq & key_fields); virtual void configuration_complete (void); @@ -46,6 +48,7 @@ protected: bool stop_dds (const char * topic_name); CORBA::String_var topic_name_; + CORBA::String_var type_name_; DDS::StringSeq key_fields_; ::DDS::Topic_var topic_; |