diff options
author | msmit <msmit@remedy.nl> | 2009-09-02 12:07:06 +0000 |
---|---|---|
committer | msmit <msmit@remedy.nl> | 2009-09-02 12:07:06 +0000 |
commit | 92d0357cdaf2f970fb167f2c34304b7ea8fcb7ec (patch) | |
tree | 41513a6a4cf82da6d9d8c939cbdcc72666735abb | |
parent | f1bc0dea796cbbaf3441ebdc627f2ec082d979d2 (diff) | |
download | ATCD-92d0357cdaf2f970fb167f2c34304b7ea8fcb7ec.tar.gz |
Wed Sep 2 12:09:58 UTC 2009 Marcel Smit <msmit@remedy.nl>
* connectors/AMI_CCM/AMI/AMI_MyFoo_i.cpp:
* connectors/AMI_CCM/AMI/AMI_exec.h:
* connectors/AMI_CCM/AMI/AMI_exec.cpp:
* connectors/AMI_CCM/Hello_Base/Hello_Base.idl:
* connectors/AMI_CCM/Sender/Hello_Sender_exec.cpp:
Changed to meet the spec.
-rw-r--r-- | modules/CIAO/ChangeLog | 9 | ||||
-rw-r--r-- | modules/CIAO/connectors/AMI_CCM/AMI/AMI_MyFoo_i.cpp | 2 | ||||
-rw-r--r-- | modules/CIAO/connectors/AMI_CCM/AMI/AMI_exec.cpp | 27 | ||||
-rw-r--r-- | modules/CIAO/connectors/AMI_CCM/AMI/AMI_exec.h | 4 | ||||
-rw-r--r-- | modules/CIAO/connectors/AMI_CCM/Hello_Base/Hello_Base.idl | 6 | ||||
-rw-r--r-- | modules/CIAO/connectors/AMI_CCM/Sender/Hello_Sender_exec.cpp | 6 |
6 files changed, 35 insertions, 19 deletions
diff --git a/modules/CIAO/ChangeLog b/modules/CIAO/ChangeLog index 786afeba027..2961b1c20c4 100644 --- a/modules/CIAO/ChangeLog +++ b/modules/CIAO/ChangeLog @@ -1,3 +1,12 @@ +Wed Sep 2 12:09:58 UTC 2009 Marcel Smit <msmit@remedy.nl> + + * connectors/AMI_CCM/AMI/AMI_MyFoo_i.cpp: + * connectors/AMI_CCM/AMI/AMI_exec.h: + * connectors/AMI_CCM/AMI/AMI_exec.cpp: + * connectors/AMI_CCM/Hello_Base/Hello_Base.idl: + * connectors/AMI_CCM/Sender/Hello_Sender_exec.cpp: + Changed to meet the spec. + Wed Sep 2 07:33:20 UTC 2009 Marcel Smit <msmit@remedy.nl> * connectors/AMI_CCM/AMI4CCM-explanation.odt: diff --git a/modules/CIAO/connectors/AMI_CCM/AMI/AMI_MyFoo_i.cpp b/modules/CIAO/connectors/AMI_CCM/AMI/AMI_MyFoo_i.cpp index 7777d253840..5bab675fbfd 100644 --- a/modules/CIAO/connectors/AMI_CCM/AMI/AMI_MyFoo_i.cpp +++ b/modules/CIAO/connectors/AMI_CCM/AMI/AMI_MyFoo_i.cpp @@ -145,7 +145,7 @@ namespace CCM_CORBA_AMI_MyFoo_Impl { try { - printf ("AMI CORBA (FOO) :\tHello. Try calling the Receiver component\n", answer); + printf ("AMI CORBA (FOO) :\tHello. Try calling the Receiver component\n"); foo_receiver_->hello (answer); } catch (CCM_AMI::InternalError& ex) diff --git a/modules/CIAO/connectors/AMI_CCM/AMI/AMI_exec.cpp b/modules/CIAO/connectors/AMI_CCM/AMI/AMI_exec.cpp index d3ce7501db4..da6de6fbeb3 100644 --- a/modules/CIAO/connectors/AMI_CCM/AMI/AMI_exec.cpp +++ b/modules/CIAO/connectors/AMI_CCM/AMI/AMI_exec.cpp @@ -115,7 +115,6 @@ namespace CIAO_Hello_AMI_AMI_Impl void AMI_MyFoo_exec_i::sendc_foo ( - ::CCM_AMI::AMI_MyFoo_callback_ptr /*cb_handler */, const char * in_str) { printf ("AMI (FOO) :\tsendc_foo <%s>\n", in_str); @@ -129,8 +128,7 @@ namespace CIAO_Hello_AMI_AMI_Impl } void - AMI_MyFoo_exec_i::sendc_hello ( - ::CCM_AMI::AMI_MyFoo_callback_ptr /*cb_handler */) + AMI_MyFoo_exec_i::sendc_hello () { printf ("AMI (FOO) :\tsendc_hello\n"); @@ -192,16 +190,25 @@ namespace CIAO_Hello_AMI_AMI_Impl void AMI_MyInterface_exec_i::sendc_do_something_with_something ( - ::CCM_AMI::AMI_MyInterface_callback_ptr /* cb_handler */, + ::CCM_AMI::AMI_MyInterface_callback_ptr cb_handler, CORBA::Short something) { printf ("AMI (INTERFACE) :\tsendc_do_something_with_something <%d>\n", something); - ::CCM_CORBA_AMI_MyInterface_Impl::AMI_MyInterface_reply_handler* handler = - new ::CCM_CORBA_AMI_MyInterface_Impl::AMI_MyInterface_reply_handler (interface_callback_); - CCM_AMI::AMI_MyInterfaceHandler_var the_handler_var = handler->_this (); - printf ("AMI (INTERFACE) :\tSending short <%d> to AMI CORBA server\n", something); - ami_interface_server_->sendc_do_something_with_something (the_handler_var.in (), something); - printf ("AMI (INTERFACE) : \tInvoked sendc_do_something_with_something\n"); + if (CORBA::is_nil (cb_handler)) + { //treat it as an oneway CORBA invocation + printf ("AMI (INTERFACE) :\tONE WAY INVOCATION. Sending short <%d> to AMI CORBA server\n", something); + ami_interface_server_->sendc_do_something_with_something (0, something); + printf ("AMI (INTERFACE) : \tInvoked sendc_do_something_with_something\n"); + } + else + { + ::CCM_CORBA_AMI_MyInterface_Impl::AMI_MyInterface_reply_handler* handler = + new ::CCM_CORBA_AMI_MyInterface_Impl::AMI_MyInterface_reply_handler (cb_handler); + CCM_AMI::AMI_MyInterfaceHandler_var the_handler_var = handler->_this (); + printf ("AMI (INTERFACE) :\tSending short <%d> to AMI CORBA server\n", something); + ami_interface_server_->sendc_do_something_with_something (the_handler_var.in (), something); + printf ("AMI (INTERFACE) : \tInvoked sendc_do_something_with_something\n"); + } } //============================================================ diff --git a/modules/CIAO/connectors/AMI_CCM/AMI/AMI_exec.h b/modules/CIAO/connectors/AMI_CCM/AMI/AMI_exec.h index 3a0773a51aa..716a2d033ad 100644 --- a/modules/CIAO/connectors/AMI_CCM/AMI/AMI_exec.h +++ b/modules/CIAO/connectors/AMI_CCM/AMI/AMI_exec.h @@ -64,12 +64,10 @@ namespace CIAO_Hello_AMI_AMI_Impl virtual ~AMI_MyFoo_exec_i (void); virtual void sendc_foo ( - ::CCM_AMI::AMI_MyFoo_callback_ptr cb_handler, const char * in_str); virtual void - sendc_hello ( - ::CCM_AMI::AMI_MyFoo_callback_ptr cb_handler); + sendc_hello (); private: CCM_AMI::MyFoo_var ami_foo_server_; diff --git a/modules/CIAO/connectors/AMI_CCM/Hello_Base/Hello_Base.idl b/modules/CIAO/connectors/AMI_CCM/Hello_Base/Hello_Base.idl index dcba7e10497..e90daec3a18 100644 --- a/modules/CIAO/connectors/AMI_CCM/Hello_Base/Hello_Base.idl +++ b/modules/CIAO/connectors/AMI_CCM/Hello_Base/Hello_Base.idl @@ -17,13 +17,15 @@ module CCM_AMI // 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_MyFoo_callback cb_handler, in string in_str); - void sendc_hello (in AMI_MyFoo_callback cb_handler); + void sendc_foo (in string in_str); + void sendc_hello (); }; // callback interface from AMI-component to Sender component + // Example of a reply handler per request. interface AMI_MyInterface_callback { void do_something_with_something_callback_handler (in float result); diff --git a/modules/CIAO/connectors/AMI_CCM/Sender/Hello_Sender_exec.cpp b/modules/CIAO/connectors/AMI_CCM/Sender/Hello_Sender_exec.cpp index 56abd39c96a..03347fc85e0 100644 --- a/modules/CIAO/connectors/AMI_CCM/Sender/Hello_Sender_exec.cpp +++ b/modules/CIAO/connectors/AMI_CCM/Sender/Hello_Sender_exec.cpp @@ -130,13 +130,13 @@ namespace CIAO_Hello_AMI_Sender_Impl else { printf ("Sender (ASYNCH) :\tInvoke Asynchronous call\n"); - my_foo_ami_->sendc_foo (0, "Do something asynchronous"); - my_foo_ami_->sendc_hello (0); + my_foo_ami_->sendc_foo ("Do something asynchronous"); + my_foo_ami_->sendc_hello (); printf ("Sender (ASYNCH) :\tInvoked Asynchronous call\n"); } } printf ("Sender (ASYNCH) :\tInvoke Asynchronous call to test EXCEPTION HANDLING\n"); - my_foo_ami_->sendc_foo (0, ""); + my_foo_ami_->sendc_foo (""); printf ("Sender (ASYNCH) :\tInvoked Asynchronous call.\n"); return 0; } |