diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-12-10 08:21:43 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-12-10 08:21:43 +0000 |
commit | 5422bb467d4f36cfdc89f5e0eb3261554ff5b3ea (patch) | |
tree | c635c40080ea213289c52ceb071613aa3a0ca85e | |
parent | 422f9ef1b51517e2bd5eb8c72f75ab65eea23163 (diff) | |
download | ATCD-5422bb467d4f36cfdc89f5e0eb3261554ff5b3ea.tar.gz |
Thu Dec 10 08:21:16 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* connectors/dds4ccm/impl/ndds/Updater_T.cpp:
* connectors/dds4ccm/impl/ndds/Updater_T.h:
Fixed bugs in the updater
* connectors/ami4ccm/examples/Hello/AMI/AMI.idl
* connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp
* connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h
* connectors/ami4ccm/examples/Hello/descriptors/Plan.cdp
* connectors/ami4ccm/examples/Hello/descriptors/run_test.pl
* connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.idl
* connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.mpc
* connectors/ami4ccm/examples/Hello/Sender/Hello_Sender.idl
* connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp
* connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.h
Merged a revised ami4ccm example that has local interfaces for the
reply handler, which reduces the footprint of ami4ccm and also
simplifies the code
13 files changed, 152 insertions, 164 deletions
diff --git a/CIAO/ChangeLog b/CIAO/ChangeLog index 0bd5c0259c0..67af82945f9 100644 --- a/CIAO/ChangeLog +++ b/CIAO/ChangeLog @@ -1,3 +1,23 @@ +Thu Dec 10 08:21:16 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl> + + * connectors/dds4ccm/impl/ndds/Updater_T.cpp: + * connectors/dds4ccm/impl/ndds/Updater_T.h: + Fixed bugs in the updater + + * connectors/ami4ccm/examples/Hello/AMI/AMI.idl + * connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp + * connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h + * connectors/ami4ccm/examples/Hello/descriptors/Plan.cdp + * connectors/ami4ccm/examples/Hello/descriptors/run_test.pl + * connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.idl + * connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.mpc + * connectors/ami4ccm/examples/Hello/Sender/Hello_Sender.idl + * connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp + * connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.h + Merged a revised ami4ccm example that has local interfaces for the + reply handler, which reduces the footprint of ami4ccm and also + simplifies the code + Thu Dec 10 08:06:08 UTC 2009 Marcel Smit <msmit@remedy.nl> * connectors/dds4ccm/tests/State_Connection_Test/Base/State_Connection_Test_Base.mpc: diff --git a/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI.idl b/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI.idl index e264aea4b8c..b409eb8c21d 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI.idl +++ b/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI.idl @@ -18,9 +18,6 @@ module Hello_AMI_AMI //uses the interface of the Receiver ('server') uses Hello::MyFoo my_foo_receiver; - - //uses the callback interface of the sender - uses Hello_AMI::AMI_MyFooCallback callback_my_foo; }; home AMIHome manages AMI diff --git a/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp b/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp index f243f9a2786..21dfe0dba2b 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp +++ b/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.cpp @@ -1,33 +1,6 @@ // -*- C++ -*- -// // $Id$ -// **** Code generated by the The ACE ORB (TAO) IDL Compiler v1.7.1 **** -// TAO and the TAO IDL Compiler have been developed by: -// Center for Distributed Object Computing -// Washington University -// St. Louis, MO -// USA -// http://www.cs.wustl.edu/~schmidt/doc-center.html -// and -// Distributed Object Computing Laboratory -// University of California at Irvine -// Irvine, CA -// USA -// http://doc.ece.uci.edu/ -// and -// Institute for Software Integrated Systems -// Vanderbilt Universityaaa -// Nashville, TN -// USA -// http://www.isis.vanderbilt.edu/ -// -// Information about TAO is available at: -// http://www.cs.wustl.edu/~schmidt/TAO.html - -// TAO_IDL - Generated from -// be/be_codegen.cpp:1278 - #include "AMI_exec.h" #include "ciao/Logger/Log_Macros.h" #include "AMI_MyFoo_i.h" @@ -69,11 +42,10 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl //============================================================ // Facet Executor Implementation Class: AMI_MyFoo_exec_i //============================================================ - AMI_MyFoo_exec_i::AMI_MyFoo_exec_i ( - ::Hello_AMI::AMI_MyFooCallback_ptr foo_callback, - ::Hello::MyFoo_ptr receiver_foo) - : foo_callback_ (::Hello_AMI::AMI_MyFooCallback::_duplicate (foo_callback)) + AMI_MyFoo_exec_i::AMI_MyFoo_exec_i () { + // @@TODO: This is all sorts of wrong. We should be using the container ORB. + //initialize AMI client int argc = 2; ACE_TCHAR **argv = new ACE_TCHAR *[argc]; @@ -82,12 +54,6 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, ACE_TEXT ("AMI_foo_client")); - ami_foo_server_ = ::Hello::MyFoo::_duplicate (receiver_foo); - - if (CORBA::is_nil (ami_foo_server_.in ())) - { - printf ("Server is NIL\n"); - } // Activate POA to handle the call back. CORBA::Object_var poa_object = orb->resolve_initial_references("RootPOA"); @@ -109,17 +75,35 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl AMI_MyFoo_exec_i::~AMI_MyFoo_exec_i (void) { } - + + void + AMI_MyFoo_exec_i::provide_receiver (::Hello::MyFoo_ptr receiver_foo) + { + ami_foo_server_ = ::Hello::MyFoo::_duplicate (receiver_foo); + + if (CORBA::is_nil (ami_foo_server_.in ())) + { + printf ("Server is NIL\n"); + throw CORBA::BAD_PARAM (); + } + } + // Operations from ::CCM_AMI::AMI_ami_foo - + void AMI_MyFoo_exec_i::sendc_foo ( - ::Hello_AMI::AMI_MyFooCallback_ptr /*ami_handler*/, + ::Hello_AMI::AMI_MyFooCallback_ptr ami_handler, const char * in_str) { + if (CORBA::is_nil (ami_foo_server_.in ())) + { + printf ("AMI(FOO) error: ami_foo_server_ reference is nil\n"); + return; + } + printf ("AMI (FOO) :\tsendc_foo <%s>\n", in_str); ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler* handler = - new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (foo_callback_); + new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (ami_handler); //Create a reply handler the CORBA-way Hello::AMI_MyFooHandler_var the_handler_var = handler->_this (); printf ("AMI (FOO) :\tSending string <%s> to AMI CORBA server\n", in_str); @@ -129,12 +113,12 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl void AMI_MyFoo_exec_i::sendc_hello ( - ::Hello_AMI::AMI_MyFooCallback_ptr /*ami_handler*/) + ::Hello_AMI::AMI_MyFooCallback_ptr ami_handler) { printf ("AMI (FOO) :\tsendc_hello\n"); ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler* handler = - new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (foo_callback_); + new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (ami_handler); //Create a reply handler the CORBA-way Hello::AMI_MyFooHandler_var the_handler_var = handler->_this (); printf ("AMI (FOO) :\tCalling AMI CORBA server\n"); @@ -144,11 +128,11 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl void AMI_MyFoo_exec_i::sendc_get_rw_attrib ( - ::Hello_AMI::AMI_MyFooCallback_ptr /*ami_handler*/) + ::Hello_AMI::AMI_MyFooCallback_ptr ami_handler) { printf ("AMI (FOO) :\tsendc_get_rw_attrib\n"); ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler* handler = - new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (foo_callback_); + new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (ami_handler); //Create a reply handler the CORBA-way Hello::AMI_MyFooHandler_var the_handler_var = handler->_this (); ami_foo_server_->sendc_get_rw_attrib (the_handler_var.in ()); @@ -157,12 +141,12 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl void AMI_MyFoo_exec_i::sendc_set_rw_attrib ( - ::Hello_AMI::AMI_MyFooCallback_ptr /*ami_handler*/, + ::Hello_AMI::AMI_MyFooCallback_ptr ami_handler, CORBA::Short rw_attrib) { printf ("AMI (FOO) :\tsendc_set_rw_attrib\n"); ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler* handler = - new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (foo_callback_); + new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (ami_handler); //Create a reply handler the CORBA-way Hello::AMI_MyFooHandler_var the_handler_var = handler->_this (); printf ("AMI (FOO) : \tSet rw_attrib <%d>\n", rw_attrib); @@ -172,11 +156,11 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl void AMI_MyFoo_exec_i::sendc_get_ro_attrib ( - ::Hello_AMI::AMI_MyFooCallback_ptr /*ami_handler*/) + ::Hello_AMI::AMI_MyFooCallback_ptr ami_handler) { printf ("AMI (FOO) :\tsendc_get_ro_attrib\n"); ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler* handler = - new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (foo_callback_); + new ::CCM_CORBA_AMI_MyFoo_Impl::AMI_MyFoo_reply_handler (ami_handler); //Create a reply handler the CORBA-way Hello::AMI_MyFooHandler_var the_handler_var = handler->_this (); ami_foo_server_->sendc_get_ro_attrib (the_handler_var.in ()); @@ -187,11 +171,13 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl //============================================================ AMI_exec_i::AMI_exec_i (void) + : myfoo_ (0) { } AMI_exec_i::~AMI_exec_i (void) { + delete myfoo_; } // Supported operations and attributes. @@ -203,10 +189,8 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl ::Hello_AMI::CCM_AMI_MyFoo_ptr AMI_exec_i::get_perform_asynch_my_foo (void) { - ::Hello_AMI::AMI_MyFooCallback_var foo_callback = - this->context_->get_connection_callback_my_foo (); - return new AMI_MyFoo_exec_i (foo_callback.in (), - receiver_foo_.in ()); + this->myfoo_ = new AMI_MyFoo_exec_i (); + return this->myfoo_; } // Operations from Components::SessionComponent. @@ -226,14 +210,15 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl void AMI_exec_i::configuration_complete (void) { - /* Your code here. */ + receiver_foo_ = + this->context_->get_connection_my_foo_receiver (); + + this->myfoo_->provide_receiver (receiver_foo_.in ()); } void AMI_exec_i::ccm_activate (void) { - receiver_foo_ = - this->context_->get_connection_my_foo_receiver (); ::CCM_CORBA_AMI_MyFoo_Impl::CORBA_MyFoo_server* foo_srv = new ::CCM_CORBA_AMI_MyFoo_Impl::CORBA_MyFoo_server (receiver_foo_.in ()); printf ("AMI :\tStarting MyFoo CORBA server thread.\n"); diff --git a/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h b/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h index 2afed3b025f..32b8207f526 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h +++ b/CIAO/connectors/ami4ccm/examples/Hello/AMI/AMI_exec.h @@ -59,10 +59,12 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl public virtual ::CORBA::LocalObject { public: - AMI_MyFoo_exec_i (::Hello_AMI::AMI_MyFooCallback_ptr foo_callback, - ::Hello::MyFoo_ptr receiver_foo); + AMI_MyFoo_exec_i (); virtual ~AMI_MyFoo_exec_i (void); + + void provide_receiver (::Hello::MyFoo_ptr receiver_foo); + virtual void sendc_foo ( ::Hello_AMI::AMI_MyFooCallback_ptr ami_handler, @@ -85,7 +87,6 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl private: Hello::MyFoo_var ami_foo_server_; - ::Hello_AMI::AMI_MyFooCallback_ptr foo_callback_; }; class AMI_exec_i @@ -121,6 +122,8 @@ namespace CIAO_Hello_AMI_AMI_AMI_Impl ::Hello_AMI_AMI::CCM_AMI_Context_var context_; ::Hello_AMI::AMI_MyFooCallback_var callback_foo_; ::Hello::MyFoo_var receiver_foo_; + + AMI_MyFoo_exec_i *myfoo_; }; extern "C" AMI_EXEC_Export ::Components::EnterpriseComponent_ptr diff --git a/CIAO/connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.idl b/CIAO/connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.idl index cf356190ca7..34ed31d82ce 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.idl +++ b/CIAO/connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.idl @@ -9,37 +9,37 @@ module Hello_AMI { // callback interface from AMI-component to Sender component - interface AMI_MyFooCallback : ::Messaging::ReplyHandler - { - void foo (in long ami_return_val, in string answer); - void foo_excep (in Messaging::ExceptionHolder excep_holder); + local interface AMI_MyFooCallback : ::Messaging::ReplyHandler + { + void foo (in long ami_return_val, in string answer); + void foo_excep (in Messaging::ExceptionHolder excep_holder); - void hello (in long ami_return_val); - void hello_excep (in Messaging::ExceptionHolder excep_holder); + void hello (in long ami_return_val); + void hello_excep (in Messaging::ExceptionHolder excep_holder); - void get_rw_attrib (in short ami_return_val); - void get_rw_attrib_excep (in Messaging::ExceptionHolder excep_holder); + void get_rw_attrib (in short ami_return_val); + void get_rw_attrib_excep (in Messaging::ExceptionHolder excep_holder); - void set_rw_attrib (); - void set_rw_attrib_excep (in Messaging::ExceptionHolder excep_holder); + void set_rw_attrib (); + void set_rw_attrib_excep (in Messaging::ExceptionHolder excep_holder); - void get_ro_attrib (in short ami_return_val); - void get_ro_attrib_excep (in Messaging::ExceptionHolder excep_holder); - }; + void get_ro_attrib (in short ami_return_val); + void get_ro_attrib_excep (in Messaging::ExceptionHolder excep_holder); + }; // AMI component. Sender calls AMI-component and AMI-component calls Receiver // using the AMI_foo interface. // Example of a global reply handler - interface AMI_MyFoo - { - void sendc_foo (in AMI_MyFooCallback ami_handler, in string in_str); - void sendc_hello (in AMI_MyFooCallback ami_handler); + local interface AMI_MyFoo + { + void sendc_foo (in AMI_MyFooCallback ami_handler, in string in_str); + void sendc_hello (in AMI_MyFooCallback ami_handler); - //asynch method for handling attributes - void sendc_get_rw_attrib (in AMI_MyFooCallback ami_handler); - void sendc_set_rw_attrib (in AMI_MyFooCallback ami_handler, in short rw_attrib); - void sendc_get_ro_attrib (in AMI_MyFooCallback ami_handler); - }; + //asynch method for handling attributes + void sendc_get_rw_attrib (in AMI_MyFooCallback ami_handler); + void sendc_set_rw_attrib (in AMI_MyFooCallback ami_handler, in short rw_attrib); + void sendc_get_ro_attrib (in AMI_MyFooCallback ami_handler); + }; }; #endif /* HELLO_BASE_IDL */ diff --git a/CIAO/connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.mpc b/CIAO/connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.mpc index 9e57b95951a..06c0bae38ec 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.mpc +++ b/CIAO/connectors/ami4ccm/examples/Hello/Hello_Base/Hello_Base.mpc @@ -1,7 +1,7 @@ // $Id$ // This file is generated with "generate_component_mpc.pl -n Hello_Base" -project(AMI_Hello_idl_gen) : componentidldefaults, ami { +project(AMI_Hello_idl_gen) : componentidldefaults { custom_only = 1 idlflags += -Wb,stub_export_macro=HELLO_STUB_Export \ -Wb,stub_export_include=Hello_stub_export.h \ @@ -11,7 +11,7 @@ project(AMI_Hello_idl_gen) : componentidldefaults, ami { -Wb,exec_export_include=Hello_exec_export.h -I.. IDL_Files { - Hello.idl + Hello_Base.idl } } @@ -23,11 +23,11 @@ project(AMI_Hello_lem_gen) : ciaoidldefaults { -Wb,export_include=Hello_exec_export.h -I.. -SS IDL_Files { - HelloE.idl + Hello_BaseE.idl } } -project(AMI_Hello_Base_idl_gen) : componentidldefaults { +project(AMI_Hello_Base_idl_gen) : componentidldefaults, ami { custom_only = 1 idlflags += -Wb,stub_export_macro=HELLO_BASE_STUB_Export \ -Wb,stub_export_include=Hello_Base_stub_export.h \ @@ -37,7 +37,7 @@ project(AMI_Hello_Base_idl_gen) : componentidldefaults { -Wb,exec_export_include=Hello_Base_exec_export.h -I.. IDL_Files { - Hello_Base.idl + Hello.idl } } @@ -49,7 +49,7 @@ project(AMI_Hello_Base_lem_gen) : ciaoidldefaults { -Wb,export_include=Hello_Base_exec_export.h -I.. -SS IDL_Files { - Hello_BaseE.idl + HelloE.idl } } diff --git a/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender.idl b/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender.idl index 766847fced3..6af31bce82b 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender.idl +++ b/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender.idl @@ -13,14 +13,11 @@ module Hello_AMI { component Sender { - // for asynch invocation. + // for asynch invocation. @@implied uses Hello_AMI::AMI_MyFoo run_asynch_my_foo; // for synchronous invocation uses Hello::MyFoo run_my_foo; - - //provides the callback function/exception for the AMI component. - provides Hello_AMI::AMI_MyFooCallback the_my_foo_callback; }; home SenderHome manages Sender diff --git a/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp b/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp index 22272db56d5..960f80fb361 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp +++ b/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.cpp @@ -190,17 +190,17 @@ namespace CIAO_Hello_AMI_Sender_Impl else { printf ("Sender (ASYNCH) :\tInvoke Asynchronous calls\n"); - my_foo_ami_->sendc_foo (0, "Do something asynchronous"); - my_foo_ami_->sendc_hello (0); - my_foo_ami_->sendc_get_rw_attrib(0); - my_foo_ami_->sendc_set_rw_attrib(0, 15); - my_foo_ami_->sendc_get_ro_attrib(0); + my_foo_ami_->sendc_foo (new MyFoo_callback_exec_i (), "Do something asynchronous"); + my_foo_ami_->sendc_hello (new MyFoo_callback_exec_i ()); + my_foo_ami_->sendc_get_rw_attrib(new MyFoo_callback_exec_i ()); + my_foo_ami_->sendc_set_rw_attrib(new MyFoo_callback_exec_i (), 15); + my_foo_ami_->sendc_get_ro_attrib(new MyFoo_callback_exec_i ()); printf ("Sender (ASYNCH) :\tInvoked Asynchronous calls\n"); } } printf ("Sender (ASYNCH) :\tInvoke Asynchronous calls to test except handling\n"); - my_foo_ami_->sendc_foo (0, ""); - my_foo_ami_->sendc_set_rw_attrib(0, 0); + my_foo_ami_->sendc_foo (new MyFoo_callback_exec_i (), ""); + my_foo_ami_->sendc_set_rw_attrib(new MyFoo_callback_exec_i (), 0); printf ("Sender (ASYNCH) :\tInvoked Asynchronous call.\n"); return 0; } @@ -281,18 +281,6 @@ namespace CIAO_Hello_AMI_Sender_Impl // Component attributes. // Port operations. - - ::Hello_AMI::CCM_AMI_MyFooCallback_ptr - Sender_exec_i::get_the_my_foo_callback () - { - if (CORBA::is_nil (global_foo_callback_)) - { - global_foo_callback_ = new MyFoo_callback_exec_i (); - } - - return global_foo_callback_; - } - // Operations from Components::SessionComponent. void diff --git a/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.h b/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.h index 976a4c5981c..25d88d09451 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.h +++ b/CIAO/connectors/ami4ccm/examples/Hello/Sender/Hello_Sender_exec.h @@ -140,11 +140,7 @@ namespace CIAO_Hello_AMI_Sender_Impl // Component attributes. // Port operations. - - virtual ::Hello_AMI::CCM_AMI_MyFooCallback_ptr - get_the_my_foo_callback (void); - // Operations from Components::SessionComponent. - + virtual void set_session_context ( ::Components::SessionContext_ptr ctx); diff --git a/CIAO/connectors/ami4ccm/examples/Hello/descriptors/Plan.cdp b/CIAO/connectors/ami4ccm/examples/Hello/descriptors/Plan.cdp index 72f2cd3c627..3f8b39ff7aa 100644 --- a/CIAO/connectors/ami4ccm/examples/Hello/descriptors/Plan.cdp +++ b/CIAO/connectors/ami4ccm/examples/Hello/descriptors/Plan.cdp @@ -194,7 +194,7 @@ <instance xmi:id="Hello.ComponentImplementations.HelloImplementation.Hello.AMI"> <name>Hello.ComponentImplementations.HelloImplementation.Hello.AMI</name> - <node>AMI</node> + <node>Sender</node> <source/> <implementation xmi:idref="Hello_AMIHomeImplementation"/> <configProperty> @@ -213,31 +213,15 @@ <connection> <name>run_asynch_foo_connection</name> <internalEndpoint> - <portName>perform_asynch_my_foo</portName> - <provider>true</provider> - <kind>Facet</kind> - <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.AMI" /> - </internalEndpoint> - <internalEndpoint> <portName>run_asynch_my_foo</portName> <provider>false</provider> <kind>SimplexReceptacle</kind> <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Sender" /> </internalEndpoint> - </connection> - - <connection> - <name>foo_callback_connection</name> <internalEndpoint> - <portName>the_my_foo_callback</portName> + <portName>perform_asynch_my_foo</portName> <provider>true</provider> - <kind>Facet</kind> - <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.Sender" /> - </internalEndpoint> - <internalEndpoint> - <portName>callback_my_foo</portName> - <provider>false</provider> - <kind>SimplexReceptacle</kind> + <kind>LocalFacet</kind> <instance xmi:idref="Hello.ComponentImplementations.HelloImplementation.Hello.AMI" /> </internalEndpoint> </connection> diff --git a/CIAO/connectors/ami4ccm/examples/Hello/descriptors/run_test.pl b/CIAO/connectors/ami4ccm/examples/Hello/descriptors/run_test.pl index 05bead4e165..be9fb1da6c2 100755 --- a/CIAO/connectors/ami4ccm/examples/Hello/descriptors/run_test.pl +++ b/CIAO/connectors/ami4ccm/examples/Hello/descriptors/run_test.pl @@ -44,9 +44,6 @@ $status = 0; $cdp_file = "Plan.cdp"; PerlACE::add_lib_path ('../lib'); -$ENV{"DANCE_TRACE_ENABLE"} = 0; -$ENV{"CIAO_TRACE_ENABLE"} = 0; - sub create_targets { # naming service diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.cpp b/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.cpp index 506c65b42e7..c704ffb22e7 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.cpp +++ b/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.cpp @@ -182,6 +182,18 @@ CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::delete_one ( { hnd = this->impl_->lookup_instance (an_instance); } + else + { + // Check explicitly if the instance handle matches the instance, this + // is not checked by RTI DDS + DDS_InstanceHandle_t const instance_handle = + this->impl_->lookup_instance (an_instance); + + if (!DDS_InstanceHandle_equals (&hnd, &instance_handle)) + { + throw CCM_DDS::InternalError (::DDS_RETCODE_BAD_PARAMETER, 0); + } + } if (DDS_InstanceHandle_equals (&hnd, &::DDS_HANDLE_NIL)) { throw CCM_DDS::NonExistent (0); @@ -197,7 +209,7 @@ CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::create_many ( CIAO_TRACE ("CIAO::DDS4CCM::RTI::Updater_T::create_many"); // Check for existance of instances - this->check_existence (data, true); + this->check_already_created (data); Coherent_Changes_Guard guard (this->impl_->get_publisher(), this->is_coherent_write_); @@ -210,32 +222,39 @@ CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::create_many ( template <typename DDS_TYPE, typename CCM_TYPE> void -CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::check_existence ( - const typename CCM_TYPE::seq_type& data, - bool existent) +CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::check_existent ( + const typename CCM_TYPE::seq_type& data) { ::CCM_DDS::NonExistent exception; for (typename CCM_TYPE::seq_type::size_type index = 0; index < data.length (); index++) { DDS_InstanceHandle_t const hnd = this->impl_->lookup_instance (data[index]); - bool failed = false; - if (existent) - { - if (::DDS_InstanceHandle_equals (&hnd, &::DDS_HANDLE_NIL)) - { - failed = true; - } - } - else + if (::DDS_InstanceHandle_equals (&hnd, &::DDS_HANDLE_NIL)) { - if (!::DDS_InstanceHandle_equals (&hnd, &::DDS_HANDLE_NIL)) - { - failed = true; - } + CORBA::ULong const length = exception.indexes.length (); + exception.indexes.length (length + 1); + exception.indexes[length] = index; } - if (failed) + } + + if (exception.indexes.length () > 0) + { + throw exception; + } +} + +template <typename DDS_TYPE, typename CCM_TYPE> +void +CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::check_already_created ( + const typename CCM_TYPE::seq_type& data) +{ + ::CCM_DDS::AlreadyCreated exception; + for (typename CCM_TYPE::seq_type::size_type index = 0; index < data.length (); index++) + { + DDS_InstanceHandle_t const hnd = this->impl_->lookup_instance (data[index]); + if (!::DDS_InstanceHandle_equals (&hnd, &::DDS_HANDLE_NIL)) { - CORBA::ULong length = exception.indexes.length (); + CORBA::ULong const length = exception.indexes.length (); exception.indexes.length (length + 1); exception.indexes[length] = index; } @@ -255,7 +274,7 @@ CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::update_many ( CIAO_TRACE ("CIAO::DDS4CCM::RTI::Updater_T::update_many"); // Check for existance of instances - this->check_existence (data, true); + this->check_existent (data); Coherent_Changes_Guard guard (this->impl_->get_publisher(), this->is_coherent_write_); @@ -273,7 +292,7 @@ CIAO::DDS4CCM::RTI::Updater_T<DDS_TYPE, CCM_TYPE>::delete_many ( CIAO_TRACE ("CIAO::DDS4CCM::RTI::Updater_T::delete_many"); // Check for existance of instances - this->check_existence (data, true); + this->check_existent (data); Coherent_Changes_Guard guard (this->impl_->get_publisher(), this->is_coherent_write_); diff --git a/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.h b/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.h index 47e46e9f30a..d3039e4a7fe 100644 --- a/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.h +++ b/CIAO/connectors/dds4ccm/impl/ndds/Updater_T.h @@ -71,9 +71,11 @@ namespace CIAO const ::DDS::InstanceHandle_t & instance_handle, ::CCM_DDS::DataNumber_t index); - void check_existence ( - const typename CCM_TYPE::seq_type& data, - bool existent); + void check_existent ( + const typename CCM_TYPE::seq_type& data); + + void check_already_created ( + const typename CCM_TYPE::seq_type& data); bool is_global_scope_; bool is_coherent_write_; |