diff options
author | msmit <msmit@remedy.nl> | 2010-10-28 10:22:45 +0000 |
---|---|---|
committer | msmit <msmit@remedy.nl> | 2010-10-28 10:22:45 +0000 |
commit | 08f4df24547750cd3bd969f210c789d5e2a22bac (patch) | |
tree | 6ce974a6f6a42ec5170a662274ed87a65138e2a4 | |
parent | 402262df69c1137718963891ddcf8515d36a3f59 (diff) | |
download | ATCD-08f4df24547750cd3bd969f210c789d5e2a22bac.tar.gz |
Thu Oct 28 10:28:24 UTC 2010 Marcel Smit <msmit@remedy.nl>
* connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp:
* connectors/dds4ccm/impl/DDS_State_Connector_T.cpp:
* connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h:
* connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp:
Prevented double code by introducing a new method.
-rw-r--r-- | CIAO/ChangeLog | 8 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp | 15 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/DDS_State_Connector_T.cpp | 15 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp | 27 | ||||
-rw-r--r-- | CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h | 1 |
5 files changed, 38 insertions, 28 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 7afff2de15c..40b541db97f 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,11 @@ +Thu Oct 28 10:28:24 UTC 2010 Marcel Smit <msmit@remedy.nl> + + * connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp: + * connectors/dds4ccm/impl/DDS_State_Connector_T.cpp: + * connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h: + * connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp: + Prevented double code by introducing a new method. + Thu Oct 28 10:04:59 UTC 2010 Marcel Smit <msmit@remedy.nl> * connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp: diff --git a/CIAO/connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp b/CIAO/connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp index 7341da0d917..4396c6635f5 100644 --- a/CIAO/connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/DDS_Event_Connector_T.cpp @@ -184,24 +184,11 @@ DDS_Event_Connector_T<DDS_TYPE, CCM_TYPE, FIXED, VENDOR_TYPE>::topic_name ( { DDS4CCM_TRACE ("DDS_Event_Connector_T<DDS_TYPE, CCM_TYPE, FIXED, VENDOR_TYPE>::topic_name"); - this->late_binding (ACE_OS::strlen (topic_name) == 0); - - if (this->late_binding () && - ACE_OS::strlen (topic_name) > 0 && - ACE_OS::strlen (this->topic_name_.in ()) == 0) + if (this->late_binded (topic_name)) { - TopicBaseConnector::topic_name (topic_name); this->do_configuration_complete (); this->do_ccm_activate (); } - else if (this->configuration_complete_) - { - throw ::CCM_DDS::NonChangeable (); - } - else - { - TopicBaseConnector::topic_name (topic_name); - } } template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED, DDS4CCM_Vendor VENDOR_TYPE> diff --git a/CIAO/connectors/dds4ccm/impl/DDS_State_Connector_T.cpp b/CIAO/connectors/dds4ccm/impl/DDS_State_Connector_T.cpp index f1dd8ab5106..4bf2cb8068f 100644 --- a/CIAO/connectors/dds4ccm/impl/DDS_State_Connector_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/DDS_State_Connector_T.cpp @@ -300,24 +300,11 @@ DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED, VENDOR_TYPE>::topic_name ( { DDS4CCM_TRACE ("DDS_State_Connector_T<DDS_TYPE, CCM_TYPE, FIXED, VENDOR_TYPE>::topic_name"); - this->late_binding (ACE_OS::strlen (topic_name) == 0); - - if (this->late_binding () && - ACE_OS::strlen (topic_name) > 0 && - ACE_OS::strlen (this->topic_name_.in ()) == 0) + if (this->late_binded (topic_name)) { - TopicBaseConnector::topic_name (topic_name); this->do_configuration_complete (); this->do_ccm_activate (); } - else if (this->configuration_complete_) - { - throw ::CCM_DDS::NonChangeable (); - } - else - { - TopicBaseConnector::topic_name (topic_name); - } } template <typename DDS_TYPE, typename CCM_TYPE, bool FIXED, DDS4CCM_Vendor VENDOR_TYPE> diff --git a/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp b/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp index ef748a03ab1..8559ae5fdfd 100644 --- a/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.cpp @@ -33,6 +33,33 @@ DDS_TopicBase_Connector_T<DDS_TYPE, CCM_TYPE, VENDOR_TYPE>::late_binding (bool l } template <typename DDS_TYPE, typename CCM_TYPE, DDS4CCM_Vendor VENDOR_TYPE> +bool +DDS_TopicBase_Connector_T<DDS_TYPE, CCM_TYPE, VENDOR_TYPE>::late_binded ( + const char * topic_name) +{ + DDS4CCM_TRACE ("DDS_TopicBase_Connector_T<DDS_TYPE, CCM_TYPE, VENDOR_TYPE>::late_binded"); + + this->late_binding (ACE_OS::strlen (topic_name) == 0); + + if (this->late_binding () && + ACE_OS::strlen (topic_name) > 0 && + ACE_OS::strlen (this->topic_name_.in ()) == 0) + { + DDS_TopicBase_Connector_T::topic_name (topic_name); + return true; + } + else if (this->configuration_complete_) + { + throw ::CCM_DDS::NonChangeable (); + } + else + { + DDS_TopicBase_Connector_T::topic_name (topic_name); + } + return false; +} + +template <typename DDS_TYPE, typename CCM_TYPE, DDS4CCM_Vendor VENDOR_TYPE> void DDS_TopicBase_Connector_T<DDS_TYPE, CCM_TYPE, VENDOR_TYPE>::configuration_complete (void) { diff --git a/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h b/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h index 9032c5b6950..dec4a2a239b 100644 --- a/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h +++ b/CIAO/connectors/dds4ccm/impl/DDS_TopicBase_Connector_T.h @@ -55,6 +55,7 @@ protected: bool late_binding (void); void late_binding (bool late_binding); + bool late_binded (const char * topic_name); CORBA::String_var topic_name_; DDS::StringSeq key_fields_; |