diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-11-09 14:12:03 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-11-09 14:12:03 +0000 |
commit | 8ed6baac240159ddcee1275a1be0055364ac41ad (patch) | |
tree | a07122783116735563cd74c62db9eee53be1ae23 | |
parent | 8a76e57cb73f48c9096779ae2bb2bb6d5c8612a2 (diff) | |
download | ATCD-8ed6baac240159ddcee1275a1be0055364ac41ad.tar.gz |
6 files changed, 33 insertions, 35 deletions
diff --git a/CIAO/connectors/dds4ccm/examples/Shapes/Sender/Shapes_Sender_exec.cpp b/CIAO/connectors/dds4ccm/examples/Shapes/Sender/Shapes_Sender_exec.cpp index ce4860b5779..a5fe98248be 100644 --- a/CIAO/connectors/dds4ccm/examples/Shapes/Sender/Shapes_Sender_exec.cpp +++ b/CIAO/connectors/dds4ccm/examples/Shapes/Sender/Shapes_Sender_exec.cpp @@ -22,8 +22,7 @@ namespace CIAO_Shapes_Sender_Impl } int - pulse_Generator::handle_timeout (const ACE_Time_Value &, - const void *) + pulse_Generator::handle_timeout (const ACE_Time_Value &, const void *) { // Notify the subscribers this->pulse_callback_.tick (); @@ -101,12 +100,14 @@ namespace CIAO_Shapes_Sender_Impl } catch (CCM_DDS::NonExistent& ) { - CIAO_ERROR ((LM_ERROR, ACE_TEXT ("Shape_info for <%C> not updated: <%C> didn't exist.\n"), + CIAO_ERROR ((LM_ERROR, + ACE_TEXT ("Shape_info for <%C> not updated: <%C> didn't exist.\n"), square_->color.in (), square_->color.in ())); } catch (CCM_DDS::InternalError& ) { - CIAO_ERROR ((LM_ERROR, ACE_TEXT ("Internal Error while updating Shape_info for <%C>.\n"), + CIAO_ERROR ((LM_ERROR, + ACE_TEXT ("Internal Error while updating Shape_info for <%C>.\n"), square_->color.in ())); } } @@ -138,7 +139,8 @@ namespace CIAO_Shapes_Sender_Impl } catch (CCM_DDS::NonExistent& ) { - CIAO_ERROR ((LM_ERROR, ACE_TEXT ("Shape_info for <%C> not deleted: <%C> didn't exist.\n"), + CIAO_ERROR ((LM_ERROR, + ACE_TEXT ("Shape_info for <%C> not deleted: <%C> didn't exist.\n"), square_->color.in (), square_->color.in ())); } catch (CCM_DDS::InternalError& ) @@ -150,7 +152,6 @@ namespace CIAO_Shapes_Sender_Impl delete this->square_; } - // Component attributes. ::CORBA::ULong Sender_exec_i::rate (void) { @@ -158,13 +159,11 @@ namespace CIAO_Shapes_Sender_Impl } void - Sender_exec_i::rate ( - ::CORBA::ULong rate) + Sender_exec_i::rate (::CORBA::ULong rate) { this->rate_ = rate; } - ::CORBA::UShort Sender_exec_i::max_x (void) { @@ -172,8 +171,7 @@ namespace CIAO_Shapes_Sender_Impl } void - Sender_exec_i::max_x ( - ::CORBA::UShort max_x) + Sender_exec_i::max_x (::CORBA::UShort max_x) { this->max_x_ = max_x; } @@ -185,8 +183,7 @@ namespace CIAO_Shapes_Sender_Impl } void - Sender_exec_i::max_y ( - ::CORBA::UShort max_y) + Sender_exec_i::max_y (::CORBA::UShort max_y) { this->max_y_ = max_y; } @@ -198,15 +195,13 @@ namespace CIAO_Shapes_Sender_Impl } void - Sender_exec_i::max_size ( - ::CORBA::UShort max_size) + Sender_exec_i::max_size (::CORBA::UShort max_size) { this->max_size_ = max_size; } void - Sender_exec_i::resize_shape ( - ::CORBA::Boolean resize) + Sender_exec_i::resize_shape (::CORBA::Boolean resize) { this->resize_ = resize; } @@ -217,12 +212,8 @@ namespace CIAO_Shapes_Sender_Impl return this->resize_; } - // Port operations. - - // Operations from Components::SessionComponent. void - Sender_exec_i::set_session_context ( - ::Components::SessionContext_ptr ctx) + Sender_exec_i::set_session_context (::Components::SessionContext_ptr ctx) { this->context_ = ::Shapes::CCM_Sender_Context::_narrow (ctx); diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.h b/CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.h index 308e48ac385..054b538a4f3 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/Coherent_Changes_Guard.h @@ -7,6 +7,9 @@ * Wrapper facade for NDDS. */ +#ifndef _CIAO_COHERENT_CHANGES_GUARD +#define _CIAO_COHERENT_CHANGES_GUARD + #include "ace/Copy_Disabled.h" #include "ndds/ndds_cpp.h" #include "dds4ccm/impl/ndds/dds4ccm_ndds_impl_export.h" @@ -21,7 +24,7 @@ namespace CIAO private ACE_Copy_Disabled { public: - Coherent_Changes_Guard (DDSPublisher* p, bool coherent_write); + Coherent_Changes_Guard (::DDSPublisher* p, bool coherent_write); ~Coherent_Changes_Guard (); private: ::DDSPublisher* p_; @@ -31,3 +34,4 @@ namespace CIAO } } +#endif /* _CIAO_COHERENT_CHANGES_GUARD */
\ No newline at end of file diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Connector_T.cpp b/CIAO/connectors/dds4ccm/impl/ndds/Connector_T.cpp index 603c2dcd940..5d03d4120cb 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Connector_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/Connector_T.cpp @@ -147,7 +147,7 @@ Connector_T<DDS_TYPE, CCM_TYPE>::configure_default_topic_ (void) { if (CORBA::is_nil (this->topic_)) { - CIAO::DDS4CCM::RTI::RTI_DomainParticipant_i *part = + CIAO::DDS4CCM::RTI::RTI_DomainParticipant_i *part = dynamic_cast< CIAO::DDS4CCM::RTI::RTI_DomainParticipant_i * > (this->domain_.in ()); DDS_ReturnCode_t retcode = DDS_TYPE::type_support::register_type( part->get_participant (), DDS_TYPE::type_support::get_type_name ()); @@ -285,7 +285,7 @@ Connector_T<DDS_TYPE, CCM_TYPE>::get_info_in_data (void) this->configure_port_info_in_ (); - return new CIAO::DDS4CCM::RTI::Writer_T<DDS_TYPE, CCM_TYPE> + return new CIAO::DDS4CCM::RTI::Writer_T<DDS_TYPE, CCM_TYPE> (this->__info_in_datawriter_.in ()); } diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.cpp b/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.cpp index 01ad45e5830..9b829692743 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.cpp @@ -1,20 +1,21 @@ // $Id$ #include "dds4ccm/impl/ndds/DataWriter.h" #include "dds4ccm/impl/ndds/Utils.h" +#include "dds4ccm/impl/ndds/Coherent_Changes_Guard.h" #include "ciao/Logger/Log_Macros.h" -// Implementation skeleton constructor template <typename DDS_TYPE, typename CCM_TYPE > CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::Updater_T (::DDS::DataWriter_ptr dw) : impl_ (0), - is_lifecycle_checked_ (false) + is_lifecycle_checked_ (false), + is_coherent_write_ (false) { CIAO_TRACE ("CIAO::DDS4CCM::RTI::Updater_T::Updater_T"); RTI_DataWriter_i *rdu = dynamic_cast <RTI_DataWriter_i *> (dw); - if (rdu == 0) + if (!rdu) { CIAO_ERROR ((LM_ERROR, CLINFO "CIAO::DDS4CCM::RTI::Updater_T::Updater - " "Unable to cast provided DataUpdater to servant\n")); @@ -53,9 +54,9 @@ CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::create ( const typename DDS_TYPE::value_type & an_instance) { CIAO_TRACE ("CIAO::DDS4CCM::RTI::Updater_T::create"); - + DDS_InstanceHandle_t hnd = this->impl_->lookup_instance (an_instance); - if (this->is_lifecycle_checked_ && + if (this->is_lifecycle_checked_ && !DDS_InstanceHandle_equals (&hnd, & ::DDS_HANDLE_NIL)) { throw CCM_DDS::AlreadyCreated (0); @@ -69,7 +70,7 @@ CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::update ( const typename DDS_TYPE::value_type & an_instance) { CIAO_TRACE ("CIAO::DDS4CCM::RTI::Updater_T::update"); - + DDS_InstanceHandle_t hnd = this->impl_->lookup_instance (an_instance); if (this->is_lifecycle_checked_ && DDS_InstanceHandle_equals (&hnd, &::DDS_HANDLE_NIL)) throw CCM_DDS::NonExistent (0); @@ -87,7 +88,7 @@ void CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::_cxx_delete (const typename DDS_TYPE::value_type & an_instance) { CIAO_TRACE ("CIAO::DDS4CCM::RTI::Updater_T::_cxx_delete"); - + DDS_InstanceHandle_t hnd = this->impl_->lookup_instance (an_instance); if (this->is_lifecycle_checked_ && DDS_InstanceHandle_equals (&hnd, & ::DDS_HANDLE_NIL)) throw CCM_DDS::NonExistent (0); @@ -99,3 +100,4 @@ CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::_cxx_delete (const typename D throw CCM_DDS::InternalError (result, 0); } } + diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.h b/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.h index 95046fd7ff6..d87ad096e81 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.h @@ -39,6 +39,7 @@ namespace CIAO private: typename DDS_TYPE::data_writer *impl_; bool is_lifecycle_checked_; + bool is_coherent_write_; }; } } diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Writer_T.cpp b/CIAO/connectors/dds4ccm/impl/ndds/Writer_T.cpp index ba93afad3e0..672e13b0969 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Writer_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/Writer_T.cpp @@ -92,7 +92,7 @@ CIAO::DDS4CCM::RTI::Writer_T<DDS_TYPE, CCM_TYPE>::write_many (const typename DDS } template <typename DDS_TYPE, typename CCM_TYPE > -::DDS::InstanceHandle_t +::DDS::InstanceHandle_t CIAO::DDS4CCM::RTI::Writer_T<DDS_TYPE, CCM_TYPE>::register_instance (const typename DDS_TYPE::value_type & datum) { ::DDS_InstanceHandle_t const handle = this->impl_->register_instance (datum); @@ -100,9 +100,9 @@ CIAO::DDS4CCM::RTI::Writer_T<DDS_TYPE, CCM_TYPE>::register_instance (const typen dds_handle <<= handle; return dds_handle; } - + template <typename DDS_TYPE, typename CCM_TYPE > -void +void CIAO::DDS4CCM::RTI::Writer_T<DDS_TYPE, CCM_TYPE>::unregister_instance (const typename DDS_TYPE::value_type & datum, const ::DDS::InstanceHandle_t & instance_handle) { ::DDS_InstanceHandle_t handle; |