diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-04 17:03:52 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-08-04 17:03:52 +0000 |
commit | f9f0e9cbef284346dd4baf9484c65fba1c046fa1 (patch) | |
tree | cc581037c280c97ef1c233d0ce2d3bbb0b89a77f | |
parent | 6d27093d1ac6828621a28997610ac8d5a4fa9520 (diff) | |
download | ATCD-f9f0e9cbef284346dd4baf9484c65fba1c046fa1.tar.gz |
ChangeLogTag:Wed Aug 4 12:02:45 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
177 files changed, 8820 insertions, 2272 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c index 63159c26228..8366e2618c3 100644 --- a/TAO/ChangeLog-99c +++ b/TAO/ChangeLog-99c @@ -1,3 +1,338 @@ +Wed Aug 4 12:02:45 1999 Carlos O'Ryan <coryan@cs.wustl.edu> + + * Integrated the changes in the ami_phase4 branch, this includes + the support in the IDL compiler, request muxing over the same + connection, generation of ReplyHandlers, the AMI demo, support + for multiple threads waiting for a reply on the same connection, + etc. The changes are summarized below, most of them where done + by Alex and Michael, i contributed the demo. + + * tao/Reply_Dispatcher.cpp: + Optimized reply dispatching, there is no need to create a new + CORBA_Environment (which is an expensive operation) when there + is a TSS environment object available. + + * performance-tests/Latency/Makefile: + * performance-tests/Latency/ami-latency-client.cpp: + * performance-tests/Latency/ami-throughput-client.cpp: + * performance-tests/Latency/client-st-muxed.conf: + * performance-tests/Latency/client.cpp: + * performance-tests/Latency/st-client.cpp: + * performance-tests/Latency/test.idl: + * performance-tests/Latency/test_i.cpp: + * performance-tests/Latency/test_i.h: + To measure round-trip latencies in two-way asynchronous requests + we simply send the time-stamp as an argument for the request, + which is returned and used in the ReplyHandler to measure the + delay. + + * examples/Makefile: + * examples/AMI/Makefile: + * examples/AMI/FL_Callback/Makefile: + * examples/AMI/FL_Callback/README: + * examples/AMI/FL_Callback/test.idl: + * examples/AMI/FL_Callback/Peer_i.cpp: + * examples/AMI/FL_Callback/Peer_i.h: + * examples/AMI/FL_Callback/Peer_i.i: + * examples/AMI/FL_Callback/Progress_i.cpp: + * examples/AMI/FL_Callback/Progress_i.h: + * examples/AMI/FL_Callback/Progress_i.i: + * examples/AMI/FL_Callback/peer.conf: + * examples/AMI/FL_Callback/peer.cpp: + * examples/AMI/FL_Callback/progress.cpp: + * examples/AMI/FL_Callback/svc.conf: + New demo for asynchronous messaging, it uses a simple GUI to + display the progress in the clients as requests and replys are + sent asynchronously. + + * TAO_IDL/be/be_visitor_interface/ami_handler_stub_ch.cpp: + The _nil() methods where not generated properly. + + * TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp: + The "smart stubs" where not working for void functions without + out or inout arguments, thanks to Michael for helping me out + with this fix. + + * performance-test/Latency/Makefile + * performance-test/Latency/README + * performance-test/Latency/client-st-exclusive.conf + * performance-test/Latency/client-st-muxed.conf + * performance-test/Latency/client.cpp + * performance-test/Latency/server.conf + * performance-test/Latency/server.cpp + * performance-test/Latency/st-client.cpp : Test suite for AMI. + + * performance-test/Latency/ami-throughput-client.cpp : Added this test. + + * performance-test/Latency/client.exclusive.conf : Removed this + file. I have conf files for st and mt case separately now. + + * performance-test/Latency/Makefile : Added the st-client test and + AMI test. To compile AMI make AMI=1. But you cannot use the + testC.cpp generated by TAO IDL. You should use + test-handC.cpp. You should just copy this file onto testC.cpp. + + * performance-test/Latency/ami-latency-client.cpp : AMI test. + + * performance-test/Latency/st-client.cpp : Single threaded SMI + test. + + * performance-test/Latency/client-st-exclusive.conf : SMI + test. Wait on Reactor. + + * performance-test/Latency/client-mt-exclusive.conf : SMI wait on + leader follower. + + * tao/Invocation.cpp + * tao/Pluggable.cpp + * tao/Pluggable.h + * tao/Transport_Mux_Strategy.cpp + * tao/Transport_Mux_Strategy.h + + Removed the unnessary accessors for the reply_received + flag. Added comments about addressing the problem of "idling the + Transport after an asynchronous reply is received over an + exclusive connection. + + * tao/GIOP.h + * tao/Object_Adapter.cpp + * tao/Object_Adapter.h + * tao/Object_Adapter.i + * tao/Reply_Dispatcher.cpp + * tao/Stub.cpp : Merged the changes Carlos and Irfan did in the + main brach fixing the memory leaks and optimizing a few locks + here and there. + + * performance-tests/Latency/Makefile + * performance-tests/Latency/client.cpp + * performance-tests/Latency/test.idl + * performance-tests/Latency/test_i.cpp + * performance-tests/Latency/test_i.h + * performance-tests/Latency/client.exclusive.conf + * performance-tests/Latency/ami-latency-client.cpp + * performance-tests/Latency/client-st-muxed.conf : Latency test is + in place now. This should do for Throughput meaurement also. + + * tests/AMI/client.cpp: Cosmetic changes. + * tao/Reply_Dispatcher.cpp: Removed the unneccessary ACE_DEBUG's. + + * tests/AMI/README + * tests/AMI/client.conf + * tests/AMI/client.cpp + * tests/AMI/client.muxed.conf + * tests/AMI/run_test.pl + * tests/AMI/server.cpp + * tests/AMI/simple-client.cpp + * tests/AMI/test-handC.cpp + * tests/AMI/test.idl + * tests/AMI/test_i.cpp + * tests/AMI/test_i.h : Latest and the greates AMI test. Got it to + work with MT as well as ST configuration. MUXED as well as + EXCLUSIVE configuation. + run_test.pl is not set up yet. + There are some minor fixes needed for the TAO IDL compiler to + generate correct AMI code. Right now, once the TAO IDL compiler + generates the files, rewrite testC.cpp by test-handC.cpp which + has the hand crafted correct code for AMI. + + * tao/Client_Strategy_Factory.cpp + * tao/Client_Strategy_Factory.h + * tao/ORB_Core.cpp + * tao/Pluggable.cpp + * tao/Reply_Dispatcher.cpp + * tao/Reply_Dispatcher.h + * tao/Transport_Mux_Strategy.cpp + * tao/Transport_Mux_Strategy.h + * tao/Wait_Strategy.cpp + * tao/default_client.cpp + * tao/default_client.h : Changes are in for the Muxed Leader + Follower implementation. + + * tests/NestedUpcall/Simple/simple-client.cpp + * tests/MT_Client/simple-client.conf + * tests/MT_Client/client_muxed.conf : Added these files. + + * tests/NestedUpcall/Simple/client.cpp + * tests/NestedUpcall/Simple/server.cpp : cosmetic changes. + + * tao/ORB_Core.cpp + * tao/Reply_Dispatcher.cpp + * tao/Reply_Dispatcher.h + * tao/Wait_Strategy.cpp : Integrated Carlos's changes to the + leader follower model done in the main branch. + + * tao/Wait_Strategy.cpp: Added debug statements. + * tao/GIOP.cpp : Modifications to the dump message routine. + + * tao/IIOP_Connect.cpp + * tao/IIOP_Connect.h + * tao/ORB_Core.cpp + * tao/ORB_Core.h + * tao/Pluggable.cpp + * tao/Pluggable.h + * tao/Reply_Dispatcher.cpp + * tao/Reply_Dispatcher.h + * tao/UIOP_Connect.cpp + * tao/UIOP_Connect.h + * tao/Wait_Strategy.cpp + * tao/Wait_Strategy.h + Changes for the Muxed Leader Follower Wait Strategy. This is + leader follower will be created when MT connection handler and + MUXED transport is selected. + + * tao/GIOP.cpp + * tao/GIOP.h + * tao/IIOP_Connect.cpp + * tao/IIOP_Connect.h + * tao/UIOP_Connect.cpp + * tao/UIOP_Connect.h + Successfully finished implementing the Muxed Transport + implementation, but still single threaded. The cool thing is + that the NestedUpcall also works on the Muxed Transport + case. Needed to make some changes on the Server Connection + Handler also, so that it resets the message state before making + the upcall. We steal the CDR from there on the stack. + + * tao/Wait_Strategy.cpp + * tao/Wait_Strategy.h + * tao/default_client.cpp + Moved the Leader Follower implementation to Exclusive Leader + Follower class, leaving way for implementing the new Muxed + Leader Follower implementation. + + * tao/Invocation.cpp + * tao/Invocation.h + * tao/Pluggable.cpp + * tao/Pluggable.h + * tao/Reply_Dispatcher.cpp + * tao/Reply_Dispatcher.h + * tao/Wait_Strategy.cpp + * tao/Wait_Strategy.h + Terminating reactor event loop based on the reply_received flag + in the reply dispatcher. Reference to this + <reply_dispatcher::reply_received_> is passed to the wait + strategy from the Invocation class. + + * tao/Invocation.h: + * tao/Invocation.cpp: + Added destructors for the Synchronous Invocations classes. + + * TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_ch.cpp + * TAO_IDL/be_include/be_visitor_operation/ami_handler_thru_poa_collocated_ch.h: + Added these files to generate AMI Reply Handler code. + + * TAO_IDL/be/be_decl.cpp + * TAO_IDL/be/be_helper.cpp + * TAO_IDL/be/be_interface.cpp + * TAO_IDL/be/be_interface_fwd.cpp + * TAO_IDL/be/be_predefined_type.cpp + * TAO_IDL/be/be_sequence.cpp + * TAO_IDL/be/be_structure.cpp + * TAO_IDL/be/be_type.cpp + * TAO_IDL/be/be_union.cpp + * TAO_IDL/be/be_union_branch.cpp + * TAO_IDL/be/be_valuetype.cpp + * TAO_IDL/be/be_valuetype_fwd.cpp + * TAO_IDL/be/be_visitor_factory.cpp + * TAO_IDL/be/be_visitor_interface.cpp + * TAO_IDL/be/be_visitor_operation.cpp + * TAO_IDL/be/be_visitor_rettype.cpp + * TAO_IDL/be/be_visitor_scope.cpp + * TAO_IDL/be/be_visitor_argument/argument.cpp + * TAO_IDL/be/be_visitor_array/array_ch.cpp + * TAO_IDL/be/be_visitor_array/array_ci.cpp + * TAO_IDL/be/be_visitor_array/array_cs.cpp + * TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp + * TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp + * TAO_IDL/be/be_visitor_exception/ctor_assign.cpp + * TAO_IDL/be/be_visitor_exception/exception_ch.cpp + * TAO_IDL/be/be_visitor_exception/exception_ctor.cpp + * TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp + * TAO_IDL/be/be_visitor_interface/ami_handler_cs.cpp + * TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ch.cpp + * TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ci.cpp + * TAO_IDL/be/be_visitor_interface/ami_handler_servant_ch.cpp + * TAO_IDL/be/be_visitor_interface/ami_handler_servant_cs.cpp + * TAO_IDL/be/be_visitor_interface/ami_handler_stub_ch.cpp + * TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp + * TAO_IDL/be/be_visitor_interface/any_op_ch.cpp + * TAO_IDL/be/be_visitor_interface/any_op_cs.cpp + * TAO_IDL/be/be_visitor_interface/collocated_ami_handler_ch.cpp + * TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp + * TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp + * TAO_IDL/be/be_visitor_interface/interface.cpp + * TAO_IDL/be/be_visitor_interface/interface_ch.cpp + * TAO_IDL/be/be_visitor_interface/interface_ci.cpp + * TAO_IDL/be/be_visitor_interface/interface_cs.cpp + * TAO_IDL/be/be_visitor_interface/interface_ih.cpp + * TAO_IDL/be/be_visitor_interface/interface_is.cpp + * TAO_IDL/be/be_visitor_interface/interface_sh.cpp + * TAO_IDL/be/be_visitor_interface/interface_ss.cpp + * TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp + * TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp + * TAO_IDL/be/be_visitor_interface/tie_sh.cpp + * TAO_IDL/be/be_visitor_interface/tie_si.cpp + * TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp + * TAO_IDL/be/be_visitor_operation/ami_arglist.cpp + * TAO_IDL/be/be_visitor_operation/ami_cs.cpp + * TAO_IDL/be/be_visitor_operation/ami_handler_operation_ch.cpp + * TAO_IDL/be/be_visitor_operation/ami_handler_operation_cs.cpp + * TAO_IDL/be/be_visitor_operation/argument.cpp + * TAO_IDL/be/be_visitor_operation/argument_marshal.cpp + * TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp + * TAO_IDL/be/be_visitor_operation/operation_ami_cs.cpp + * TAO_IDL/be/be_visitor_operation/operation_cs.cpp + * TAO_IDL/be/be_visitor_operation/operation_is.cpp + * TAO_IDL/be/be_visitor_operation/operation_ss.cpp + * TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp + * TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp + * TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp + * TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp + * TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp + * TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp + * TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp + * TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp + * TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp + * TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp + * TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp + * TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp + * TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp + * TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp + * TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp + * TAO_IDL/be/be_visitor_union/union_ch.cpp + * TAO_IDL/be/be_visitor_union/union_ci.cpp + * TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp + * TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp + * TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp + * TAO_IDL/be/be_visitor_union_branch/public_ci.cpp + * TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp + * TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp + * TAO_IDL/be/be_visitor_valuetype/field_cs.cpp + * TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp + * TAO_IDL/be/be_visitor_valuetype/valuetype.cpp + * TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp + * TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp + * TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp + * TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp + * TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp + * TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ch.cpp + * TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ci.cpp + * TAO_IDL/be_include/be_codegen.h + * TAO_IDL/be_include/be_decl.h + * TAO_IDL/be_include/be_helper.h + * TAO_IDL/be_include/be_interface.h + * TAO_IDL/be_include/be_visitor_interface.h + * TAO_IDL/be_include/be_visitor_operation.h: + Edited all the files to generate AMI Handler code, I also + changed "fullname ()" methods to "full_name ()" to + be more consistent. The code generation for AMI + Handlers uses a strategy on the be_interface node. + This strategy hides all the differences betwenn + the name generations. + + * tao/PollableC.cpp: + Fixed the the usage of env instead of ACE_TRY_ENV. + Wed Aug 04 02:10:59 1999 Nanbor Wang <nanbor@cs.wustl.edu> * performance-tests/Cubit/TAO/IDL_Cubit/Cubit_Client.{h,cpp}: @@ -13,7 +348,7 @@ Wed Aug 04 02:10:59 1999 Nanbor Wang <nanbor@cs.wustl.edu> for suggesting this. * performance-tests/Cubit/TAO/IDL_Cubit/README: Added - docuemntation on how to use the new collocation test. + documentation on how to use the new collocation test. * performance-tests/Cubit/TAO/IDL_Cubit/{client,server}.dsp: * performance-tests/Cubit/TAO/IDL_Cubit/collocation_test.dsp: diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp index 92d7efb4790..4e90c3acbe8 100644 --- a/TAO/TAO_IDL/be/be_decl.cpp +++ b/TAO/TAO_IDL/be/be_decl.cpp @@ -40,12 +40,9 @@ be_decl::be_decl (void) cli_hdr_cdr_op_gen_ (I_FALSE), cli_stub_cdr_op_gen_ (I_FALSE), cli_inline_cdr_op_gen_ (I_FALSE), - fullname_ (0), - ami_handler_fullname_ (0), - flatname_ (0), - ami_handler_flatname_ (0), + full_name_ (0), + flat_name_ (0), repoID_ (0), - ami_handler_repoID_ (0), prefix_ (0), size_type_ (be_decl::SIZE_UNKNOWN), has_constructor_ (I_FALSE) @@ -69,12 +66,9 @@ be_decl::be_decl (AST_Decl::NodeType type, cli_stub_any_op_gen_ (I_FALSE), cli_hdr_cdr_op_gen_ (I_FALSE), cli_stub_cdr_op_gen_ (I_FALSE), - fullname_ (0), - ami_handler_fullname_ (0), - flatname_ (0), - ami_handler_flatname_ (0), + full_name_ (0), + flat_name_ (0), repoID_ (0), - ami_handler_repoID_ (0), prefix_ (0), size_type_ (be_decl::SIZE_UNKNOWN), has_constructor_ (I_FALSE) @@ -84,36 +78,21 @@ be_decl::be_decl (AST_Decl::NodeType type, //destructor be_decl::~be_decl (void) { - if (this->fullname_ != 0) + if (this->full_name_ != 0) { - delete[] this->fullname_; - this->fullname_ = 0; + delete[] this->full_name_; + this->full_name_ = 0; } - if (this->ami_handler_fullname_ != 0) + if (this->flat_name_ != 0) { - delete[] this->ami_handler_fullname_; - this->ami_handler_fullname_ = 0; - } - if (this->flatname_ != 0) - { - delete[] this->flatname_; - this->flatname_ = 0; - } - if (this->ami_handler_flatname_ != 0) - { - delete[] this->ami_handler_flatname_; - this->ami_handler_flatname_ = 0; + delete[] this->flat_name_; + this->flat_name_ = 0; } if (this->repoID_ != 0) { delete[] this->repoID_; this->repoID_ = 0; } - if (this->ami_handler_repoID_ != 0) - { - delete[] this->ami_handler_repoID_; - this->ami_handler_repoID_ = 0; - } if (this->prefix_ != 0) { delete[] this->prefix_; @@ -149,30 +128,19 @@ be_decl::size_type (be_decl::SIZE_TYPE st) } const char* -be_decl::fullname (void) -{ - if (!this->fullname_) - compute_fullname (); - - return this->fullname_; -} - -const char* -be_decl::ami_handler_fullname (void) +be_decl::full_name (void) { - if (!this->ami_handler_fullname_) - compute_ami_handler_name (this->fullname (), - this->ami_handler_fullname_); + if (!this->full_name_) + compute_full_name (); - return this->ami_handler_fullname_; + return this->full_name_; } - // compute stringified fully scoped name void -be_decl::compute_fullname (void) +be_decl::compute_full_name (void) { - if (fullname_) + if (full_name_) return; else { @@ -204,19 +172,19 @@ be_decl::compute_fullname (void) } delete i; - this->fullname_ = new char [namelen+1]; - this->fullname_[0] = '\0'; + this->full_name_ = new char [namelen+1]; + this->full_name_[0] = '\0'; first = I_TRUE; second = I_FALSE; i = new UTL_IdListActiveIterator (this->name ()); while (!(i->is_done ())) { if (!first) - ACE_OS::strcat (this->fullname_, "::"); + ACE_OS::strcat (this->full_name_, "::"); else if (second) first = second = I_FALSE; // print the identifier - ACE_OS::strcat (this->fullname_, i->item ()->get_string ()); + ACE_OS::strcat (this->full_name_, i->item ()->get_string ()); if (first) { if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0) @@ -232,30 +200,81 @@ be_decl::compute_fullname (void) return; } -const char* -be_decl::flatname (void) +void +be_decl::compute_full_name (const char *prefix, + const char *suffix, + char *&name) { - if (!this->flatname_) - this->compute_flatname (); + if (prefix == 0 || suffix == 0) + return; + + ACE_CString prefix_str (prefix); + ACE_CString suffix_str (suffix); + + ACE_CString result_str; - return this->flatname_; + // Get parent. + if (this->defined_in () == 0) + { + // Global scope. + + // Prefix. + result_str = prefix_str; + + // Local name. + result_str += ACE_CString (this->local_name ()->get_string ()); + + // Suffix. + result_str += suffix_str; + } + else + { + // Get scope name. + be_decl *parent = be_scope::narrow_from_scope (this->defined_in ())->decl (); + if (parent == 0) + { + ACE_ERROR ((LM_ERROR, + "(%N:%l) be_decl::" + "compute_flat_name - " + "scope name is nil\n")); + } + + // Parent name. + result_str = ACE_CString (parent->full_name ()); + + // _ + if (ACE_OS::strcmp (parent->full_name (), "") != 0) + result_str += ACE_CString ("::"); + + // Prefix. + result_str += prefix_str; + + // Local name. + result_str += ACE_CString (this->local_name ()->get_string ()); + + // Suffix. + result_str += suffix_str; + } + + name = result_str.rep (); } + const char* -be_decl::ami_handler_flatname (void) +be_decl::flat_name (void) { - if (!this->ami_handler_flatname_) - this->compute_flatname ("AMI_","_Handler"); + if (!this->flat_name_) + this->compute_flat_name (); - return this->ami_handler_flatname_; + return this->flat_name_; } // compute stringified flattened fully scoped name void -be_decl::compute_flatname (void) +be_decl::compute_flat_name (void) { - if (flatname_) + if (flat_name_) return; else { @@ -288,19 +307,19 @@ be_decl::compute_flatname (void) } delete i; - this->flatname_ = new char [namelen+1]; - this->flatname_[0] = '\0'; + this->flat_name_ = new char [namelen+1]; + this->flat_name_[0] = '\0'; first = I_TRUE; second = I_FALSE; i = new UTL_IdListActiveIterator (this->name ()); while (!(i->is_done ())) { if (!first) - ACE_OS::strcat (this->flatname_, "_"); + ACE_OS::strcat (this->flat_name_, "_"); else if (second) first = second = I_FALSE; // print the identifier - ACE_OS::strcat (this->flatname_, i->item ()->get_string ()); + ACE_OS::strcat (this->flat_name_, i->item ()->get_string ()); if (first) { if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0) @@ -318,11 +337,13 @@ be_decl::compute_flatname (void) -char * -be_decl::compute_flatname (const char *prefix, const char *suffix) +void +be_decl::compute_flat_name (const char *prefix, + const char *suffix, + char *&name) { if (prefix == 0 || suffix == 0) - return 0; + return; ACE_CString prefix_str (prefix); ACE_CString suffix_str (suffix); @@ -349,22 +370,21 @@ be_decl::compute_flatname (const char *prefix, const char *suffix) be_decl *parent = be_scope::narrow_from_scope (this->defined_in ())->decl (); if (parent == 0) { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_decl::" - "compute_flat_name - " - "scope name is nil\n"), - 0); + ACE_ERROR ((LM_ERROR, + "(%N:%l) be_decl::" + "compute_flat_name - " + "scope name is nil\n")); } // Parent name. - result_str = ACE_CString (parent->fullname ()); + result_str = ACE_CString (parent->full_name ()); // _ - if (ACE_OS::strcmp (parent->fullname (), "") != 0) + if (ACE_OS::strcmp (parent->full_name (), "") != 0) result_str += ACE_CString ("_"); // Prefix. - result_str += ACE_CString ("AMI_"); + result_str += prefix_str; // Local name. result_str += ACE_CString (this->local_name ()->get_string ()); @@ -373,8 +393,7 @@ be_decl::compute_flatname (const char *prefix, const char *suffix) result_str += suffix_str; } - this->ami_handler_flatname_ = result_str.rep (); - return this->ami_handler_flatname_; + name = result_str.rep (); } const char * @@ -387,16 +406,6 @@ be_decl::repoID (void) } -const char * -be_decl::ami_handler_repoID (void) -{ - if (!this->ami_handler_repoID_) - this->compute_repoID ("AMI_","_Handler"); - - return this->ami_handler_repoID_; -} - - // compute stringified repository ID void be_decl::compute_repoID (void) @@ -472,12 +481,14 @@ be_decl::compute_repoID (void) // Apply the prefix and suffix to the local name and compute the // repoID. Both the parameters should be non-null. -char * -be_decl::compute_repoID (const char *prefix, const char *suffix) +void +be_decl::compute_repoID (const char *prefix, + const char *suffix, + char *&name) { // Prefix and suffix should be valid. if (prefix == 0 || suffix == 0) - return 0; + return; // First prepare the result without IDL: and :1.0 strings. @@ -607,56 +618,7 @@ be_decl::compute_repoID (const char *prefix, const char *suffix) delete result; result = 0; - this->ami_handler_repoID_ = repoID.rep (); - - return this->ami_handler_repoID_; -} - - -int -be_decl::compute_ami_handler_name (const char *name, - char *&ami_handler_name) -{ - int name_length = ACE_OS::strlen (name); - int ami_handler_length = ACE_OS::strlen ("AMI__HANDLER"); - - ACE_NEW_RETURN (ami_handler_name, - char[name_length + ami_handler_length+1], - -1); - - // copy it in - ACE_OS::strcpy (ami_handler_name, name); - - const char *interface_name = 0; - int i = ACE_OS::strlen (name); - for (;i >= 1; i--) - { - if (name[i-1] == ':' && name[i] == ':') - { - interface_name = &name[i+1]; - break; - } - else if (i >= 3) - if (name[i-3] == 'P' && - name[i-2] == 'O' && - name[i-1] == 'A' && - name[i] == '_') - { - interface_name = &name[i+1]; - break; - } - } - - if (interface_name == 0) - interface_name = name; - - ACE_OS::strcpy(&ami_handler_name[name_length-ACE_OS::strlen(interface_name)],"AMI_"); - ACE_OS::strcpy(&ami_handler_name[name_length-ACE_OS::strlen(interface_name)+4], - interface_name); - ACE_OS::strcpy(&ami_handler_name[name_length+4], - "_Handler"); - - return 0; + name = repoID.rep (); } @@ -954,7 +916,7 @@ be_decl::is_child (be_decl *node) if (!bd) return 0; - if (!ACE_OS::strcmp (bd->fullname (), node->fullname ())) + if (!ACE_OS::strcmp (bd->full_name (), node->full_name ())) return 1; // true } return 0; // not a child diff --git a/TAO/TAO_IDL/be/be_helper.cpp b/TAO/TAO_IDL/be/be_helper.cpp index c4ec5e1918a..5d8df5c6d4b 100644 --- a/TAO/TAO_IDL/be/be_helper.cpp +++ b/TAO/TAO_IDL/be/be_helper.cpp @@ -185,13 +185,13 @@ TAO_OutStream::nl (void) // macro generation int -TAO_OutStream::gen_ifdef_macro (const char *flatname, const char *suffix) +TAO_OutStream::gen_ifdef_macro (const char *flat_name, const char *suffix) { static char macro [NAMEBUFSIZE]; TAO_CodeGen *cg = TAO_CODEGEN::instance (); ACE_OS::memset (macro, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (macro, "_%s_", cg->upcase (flatname)); + ACE_OS::sprintf (macro, "_%s_", cg->upcase (flat_name)); if (suffix) { //ACE_OS::sprintf (macro, "%s_%s_", macro, cg->upcase (suffix)); diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index c6312cdf8a6..16ccaa22c00 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -15,7 +15,8 @@ // = AUTHOR // Copyright 1994-1995 by Sun Microsystems, Inc. // and -// Aniruddha Gokhale +// Aniruddha Gokhale, +// Michael Kircher // // ============================================================================ @@ -32,36 +33,25 @@ ACE_RCSID(be, be_interface, "$Id$") // default constructor be_interface::be_interface (void) - : full_skel_name_ (0), - ami_handler_full_skel_name_ (0), - skel_count_ (0), - full_coll_name_ (0), - cached_coll_name_type_ (-1), - ami_handler_full_coll_name_ (0), - local_coll_name_ (0), - ami_handler_local_coll_name_ (0), - ami_handler_local_name_ (0), - in_mult_inheritance_ (-1) + : skel_count_ (0), + in_mult_inheritance_ (-1), + strategy_ (new be_interface_default_strategy (this)) { this->size_type (be_decl::VARIABLE); // always the case this->has_constructor (I_TRUE); // always the case } // constructor used to build the AST -be_interface::be_interface (UTL_ScopedName *n, AST_Interface **ih, long nih, +be_interface::be_interface (UTL_ScopedName *n, + AST_Interface **ih, + long nih, UTL_StrList *p) : AST_Interface (n, ih, nih, p), AST_Decl (AST_Decl::NT_interface, n, p), UTL_Scope (AST_Decl::NT_interface), - full_skel_name_ (0), - ami_handler_full_skel_name_ (0), skel_count_ (0), - full_coll_name_ (0), - ami_handler_full_coll_name_ (0), - local_coll_name_ (0), - ami_handler_local_coll_name_ (0), - ami_handler_local_name_ (0), - in_mult_inheritance_ (-1) + in_mult_inheritance_ (-1), + strategy_ (new be_interface_default_strategy (this)) { this->size_type (be_decl::VARIABLE); // always the case this->has_constructor (I_TRUE); // always the case @@ -69,272 +59,83 @@ be_interface::be_interface (UTL_ScopedName *n, AST_Interface **ih, long nih, be_interface::~be_interface (void) { - if (this->full_skel_name_ != 0) - { - delete[] this->full_skel_name_; - this->full_skel_name_ = 0; - } - if (this->ami_handler_full_skel_name_ != 0) - { - delete[] this->ami_handler_full_skel_name_; - this->ami_handler_full_skel_name_ = 0; - } - if (this->full_coll_name_ != 0) - { - delete[] this->full_coll_name_; - this->full_coll_name_ = 0; - } - if (this->ami_handler_full_coll_name_ != 0) - { - delete[] this->ami_handler_full_coll_name_; - this->ami_handler_full_coll_name_ = 0; - } - if (this->local_coll_name_ != 0) - { - delete[] this->local_coll_name_; - this->local_coll_name_ = 0; - } - if (this->ami_handler_local_coll_name_ != 0) - { - delete[] this->ami_handler_local_coll_name_; - this->ami_handler_local_coll_name_ = 0; - } - if (this->ami_handler_local_name_ != 0) - { - delete[] this->ami_handler_local_name_; - this->ami_handler_local_name_ = 0; - } + // We know that it cannot be 0, but.. + if (!this->strategy_) + delete this->strategy_; } -// compute stringified fully qualified collocated class name. -void -be_interface::compute_coll_name (int type) +be_interface_type_strategy * +be_interface::set_strategy (be_interface_type_strategy *new_strategy) { - if (type == this->cached_coll_name_type_ && this->full_coll_name_ != 0) - return; - else - { - this->cached_coll_name_type_ = type; - delete this->full_coll_name_; - delete this->local_coll_name_; - } - - static const char *collocated_names[] = { "_tao_thru_poa_collocated_", - "_tao_direct_collocated_" }; - const char poa[] = "POA_"; - // Reserve enough room for the "POA_" prefix, the "_tao_collocated_" - // prefix and the local name and the (optional) "::" - const char *collocated = collocated_names[type]; - - int namelen = ACE_OS::strlen (collocated) + sizeof (poa) + 1; - - UTL_IdListActiveIterator *i; - ACE_NEW (i, UTL_IdListActiveIterator (this->name ())); - while (!i->is_done ()) - { - // reserve 2 characters for "::". - namelen += ACE_OS::strlen (i->item ()->get_string ()) + 2; - i->next (); - } - delete i; + be_interface_type_strategy *old = this->strategy_; - ACE_NEW (this->full_coll_name_, - char[namelen+1]); - this->full_coll_name_[0] = 0; // null terminate the string... - - // Iterate again.... - ACE_NEW (i, UTL_IdListActiveIterator (this->name ())); + if (new_strategy != 0) + this->strategy_ = new_strategy; - // Only the first component get the "POA_" preffix. - int poa_added = 0; - while (!i->is_done ()) - { - const char* item = i->item ()->get_string (); + return old; +} - // Increase right away, so we can test for the final component - // in the loop. - i->next (); - // We add the POA_ preffix only if the first component is not - // the global scope... - if (ACE_OS::strcmp (item, "") != 0) - { - if (!i->is_done ()) - { - // We only add the POA_ preffix if there are more than - // two components in the name, in other words, if the - // class is inside some scope. - if (!poa_added) - { - ACE_OS::strcat (this->full_coll_name_, poa); - poa_added = 1; - } - ACE_OS::strcat (this->full_coll_name_, item); - ACE_OS::strcat (this->full_coll_name_, "::"); - } - else - { - ACE_OS::strcat (this->full_coll_name_, collocated); - ACE_OS::strcat (this->full_coll_name_, item); - } - } - } - delete i; - - // Compute the local name for the collocated class. - int localen = ACE_OS::strlen (collocated) + 1; - localen += ACE_OS::strlen (this->local_name ()->get_string ()); - ACE_NEW (this->local_coll_name_, char[localen]); - ACE_OS::strcpy(this->local_coll_name_, collocated); - ACE_OS::strcat(this->local_coll_name_, - this->local_name ()->get_string ()); +const char * +be_interface::local_name (void) const +{ + // return the local name + return this->strategy_->local_name (); } const char * -be_interface::full_coll_name (int type) +be_interface::full_name (void) const { - this->compute_coll_name (type); - - return this->full_coll_name_; + // return the stringified full name + return this->strategy_->full_name (); } -const char* -be_interface::local_coll_name (int type) const +const char * +be_interface::flat_name (void) const { - ACE_const_cast (be_interface*, this)->compute_coll_name (type); - - return this->local_coll_name_; + // return the flattened full scoped name. + return this->strategy_->flat_name (); } - -const char* -be_interface::ami_handler_full_coll_name (void) +const char * +be_interface::repoID (void) const { - if (this->ami_handler_full_coll_name_ == 0) - { - // @@ Michael: We need to check this one. I am just passing 1 - // for the time being. (Alex). - compute_ami_handler_name (this->full_coll_name(1), - this->ami_handler_full_coll_name_); - } - - return this->ami_handler_full_coll_name_; + // retrieve the repository ID. + return this->strategy_->repoID (); } -const char* -be_interface::ami_handler_local_coll_name (void) +const char * +be_interface::full_skel_name (void) const { - if (this->ami_handler_local_coll_name_ == 0) - { - // @@ Michael: We need to check this one. I am just passing 1 - // for the time being. (Alex). - compute_ami_handler_name (this->local_coll_name(1), - this->ami_handler_local_coll_name_); - } - - return this->ami_handler_local_coll_name_; + // retrieve the fully scoped skel class name. + return this->strategy_->full_skel_name (); } -const char* -be_interface::ami_handler_local_name (void) +const char * +be_interface::full_coll_name (int type) const { - if (this->ami_handler_local_name_ == 0) - compute_ami_handler_name (this->local_name()->get_string (), - this->ami_handler_local_name_); - - return this->ami_handler_local_name_; + // retrieve the fully qualified collocated class name + return this->strategy_->full_coll_name (type); } -// Generate collocated local and full names for the arbitrary local -// name under the scope of this interface. Usefull to generate AMI -// Handlers. -int -be_interface::compute_coll_names (const char *local_name, - char *&coll_local_name, - char *&coll_full_name) - +const char * +be_interface::local_coll_name (int type) const { - const char collocated[] = "_tao_collocated_"; - const char poa[] = "POA_"; - - // Reserve enough room for the "POA_" prefix, the "_tao_collocated_" - // prefix and the local name and the (optional) "::" - int namelen = sizeof (collocated) + sizeof (poa); - - UTL_IdListActiveIterator *i; - ACE_NEW_RETURN (i, UTL_IdListActiveIterator (this->name ()), -1); - while (!i->is_done ()) - { - // reserve 2 characters for "::". - namelen += ACE_OS::strlen (i->item ()->get_string ()) + 2; - i->next (); - } - delete i; - - ACE_NEW_RETURN (coll_full_name, - char[namelen+1], - -1); - coll_full_name[0] = 0; // null terminate the string... - - // Iterate again.... - ACE_NEW_RETURN (i, UTL_IdListActiveIterator (this->name ()), -1); - - // Only the first component get the "POA_" preffix. - int poa_added = 0; - while (!i->is_done ()) - { - const char* item = i->item ()->get_string (); - - // Increase right away, so we can test for the final component - // in the loop. - i->next (); - - // We add the POA_ preffix only if the first component is not - // the global scope... - if (ACE_OS::strcmp (item, "") != 0) - { - if (!i->is_done ()) - { - // We only add the POA_ preffix if there are more than - // two components in the name, in other words, if the - // class is inside some scope. - if (!poa_added) - { - ACE_OS::strcat (coll_full_name, poa); - poa_added = 1; - } - ACE_OS::strcat (coll_full_name, item); - ACE_OS::strcat (coll_full_name, "::"); - } - else - { - ACE_OS::strcat (coll_full_name, collocated); - ACE_OS::strcat (coll_full_name, item); - } - } - } - delete i; - - // Compute the local name for the collocated class. - int localen = sizeof (collocated); - localen += ACE_OS::strlen (local_name); - ACE_NEW_RETURN (coll_local_name, char[localen], -1); - ACE_OS::strcpy(coll_local_name, collocated); - ACE_OS::strcat(coll_local_name, - local_name); - - return 0; + // retrieve the fully qualified collocated class name. + return this->strategy_->local_coll_name (type); } -// compute stringified fully scoped skel name -void -be_interface::compute_fullskelname (void) +const char * +be_interface::relative_skel_name (const char *skel_name) { - this->compute_fullskelname (this->full_skel_name_, "POA_"); + // relative skeleton name + return this->strategy_->relative_skel_name (skel_name); } + void -be_interface::compute_fullskelname (char *&skelname, const char *prefix) +be_interface::compute_full_skel_name (const char *prefix, + char *&skelname) { if (skelname) return; @@ -369,7 +170,7 @@ be_interface::compute_fullskelname (char *&skelname, const char *prefix) } delete i; - skelname = new char [namelen+1]; + ACE_NEW (skelname, char [namelen+1]); skelname[0] = '\0'; first = I_TRUE; second = I_FALSE; @@ -398,24 +199,90 @@ be_interface::compute_fullskelname (char *&skelname, const char *prefix) return; } -// retrieve the fully scoped skeleton name const char* -be_interface::full_skel_name (void) +be_interface::relative_name (const char *localname, + const char *othername) { - if (!this->full_skel_name_) - compute_fullskelname (); + // some compilers do not like generating a fully scoped name for a + // type that was defined in the same enclosing scope in which it was + // defined. We have to emit just the partial name, relative to our + // "localname" - return this->full_skel_name_; -} + // The tricky part here is that it is not enough to check if the + // typename we are using was defined in the current scope. But we + // need to ensure that it was not defined in any of our ancestor + // scopes as well. If that is the case, then we can generate a fully + // scoped name for that type, else we use the ACE_NESTED_CLASS macro -const char* -be_interface::ami_handler_full_skel_name (void) -{ - if (this->ami_handler_full_skel_name_ == 0) - compute_ami_handler_name (this->full_skel_name(), - this->ami_handler_full_skel_name_); + // thus we need some sort of relative name to be generated + + static char macro [NAMEBUFSIZE]; + // UNUSED: be_decl *def_scope = 0; // our defining scope + char // hold the fully scoped name + def_name [NAMEBUFSIZE], + use_name [NAMEBUFSIZE]; + char // these point to the curr and next component in the scope + *def_curr = def_name, + *def_next, + *use_curr = use_name, + *use_next; + + ACE_OS::memset (macro, '\0', NAMEBUFSIZE); + ACE_OS::memset (def_name, '\0', NAMEBUFSIZE); + ACE_OS::memset (use_name, '\0', NAMEBUFSIZE); + + // traverse every component of the def_scope and use_scope beginning at the + // root and proceeding towards the leaf trying to see if the components + // match. Continue until there is a match and keep accumulating the path + // traversed. This forms the first argument to the ACE_NESTED_CLASS + // macro. Whenever there is no match, the remaining components of the + // def_scope form the second argument + + ACE_OS::strcpy (def_name, localname); + ACE_OS::strcpy (use_name, othername); + + while (def_curr && use_curr) + { + // find the first occurrence of a :: and advance the next pointers accordingly + def_next = ACE_OS::strstr (def_curr, "::"); + use_next = ACE_OS::strstr (use_curr, "::"); + + if (def_next) + *def_next = 0; + + if (use_next) + *use_next = 0; + + if (!ACE_OS::strcmp (def_curr, use_curr)) + { + // they have same prefix, append to arg1 + def_curr = (def_next ? (def_next+2) : 0); // skip the :: + use_curr = (use_next ? (use_next+2) : 0); // skip the :: + } + else + { + // we had overwritten a ':' by a '\0' for string comparison. We + // revert back because we want the rest of the relative name to be + // used + if (def_next) + *def_next = ':'; + + if (use_next) + *use_next = ':'; - return this->ami_handler_full_skel_name_; + // no match. This is the end of the first argument. Get out + // of the loop as no more comparisons are necessary + break; + } + } + + // start the 2nd argument of the macro + + // copy the remaining def_name (if any left) + if (def_curr) + ACE_OS::strcat (macro, def_curr); + + return macro; } @@ -461,13 +328,13 @@ be_interface::gen_copy_ctors_helper (be_interface* node, be_interface* base, TAO { if(first) { - *os << idl_global->impl_class_prefix () << base->flatname () << idl_global->impl_class_suffix () << " (t)" + *os << idl_global->impl_class_prefix () << base->flat_name () << idl_global->impl_class_suffix () << " (t)" << ", " << base->full_skel_name () << " (t)"; first = 0; } else { - *os << ", " << idl_global->impl_class_prefix () << base->flatname () << idl_global->impl_class_suffix () << " (t)" + *os << ", " << idl_global->impl_class_prefix () << base->flat_name () << idl_global->impl_class_suffix () << " (t)" << ", " << base->full_skel_name () << " (t)"; ; } @@ -500,12 +367,12 @@ be_interface::gen_def_ctors_helper (be_interface* node, be_interface* base, TAO_ { if(first) { - *os << idl_global->impl_class_prefix () << base->flatname () << idl_global->impl_class_suffix () << " ()"; + *os << idl_global->impl_class_prefix () << base->flat_name () << idl_global->impl_class_suffix () << " ()"; first = 0; } else { - *os << ", " << idl_global->impl_class_prefix () << base->flatname () << idl_global->impl_class_suffix () << " ()"; + *os << ", " << idl_global->impl_class_prefix () << base->flat_name () << idl_global->impl_class_suffix () << " ()"; } } @@ -532,7 +399,7 @@ be_interface::gen_var_defn (char* interface_name) // Decide which name to use. if (interface_name == 0) - interface_name = this->local_name ()->get_string (); + interface_name = (char *) this->local_name (); // Buffer with name of the var class. ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); @@ -627,8 +494,8 @@ be_interface::gen_var_impl (char *interface_local_name, // arguments. Let us then use the name in this node. if (interface_local_name == 0 || interface_full_name == 0) { - interface_local_name = local_name ()->get_string (); - interface_full_name = (char *) this->fullname (); + interface_local_name = (char *) local_name (); + interface_full_name = (char *) this->full_name (); } ACE_OS::memset (fname, '\0', NAMEBUFSIZE); @@ -816,7 +683,7 @@ be_interface::gen_out_defn (char *interface_name) // Decide which name to use. if (interface_name == 0) - interface_name = this->local_name ()->get_string (); + interface_name = (char *) this->local_name (); // Create the buffer with the name of the out class. ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); @@ -888,8 +755,8 @@ be_interface::gen_out_impl (char *interface_local_name, // arguments. Let us then use the name in this node. if (interface_local_name == 0 || interface_full_name == 0) { - interface_local_name = local_name ()->get_string (); - interface_full_name = (char *) this->fullname (); + interface_local_name = (char *) local_name (); + interface_full_name = (char *) this->full_name (); } ACE_OS::memset (fname, '\0', NAMEBUFSIZE); @@ -1018,9 +885,9 @@ be_interface::gen_out_impl (char *interface_local_name, // helper. int -be_interface::gen_operation_table (void) +be_interface::gen_operation_table () { - TAO_OutStream *ss; // output stream. + TAO_OutStream *os; // output stream. TAO_NL nl; // end line. // Retrieve the singleton instance of the CodeGen. @@ -1031,19 +898,21 @@ be_interface::gen_operation_table (void) switch (cg->lookup_strategy ()) { case TAO_CodeGen::TAO_DYNAMIC_HASH: + // Init the outstream appropriately. - ss = cg->server_skeletons (); + + os = this->strategy_->get_out_stream (); // start from current indentation level. - ss->indent (); + os->indent (); // Start the table generation. - *ss << "static const TAO_operation_db_entry " << this->flatname () << + *os << "static const TAO_operation_db_entry " << this->flat_name () << "_operations [] = {\n"; - ss->incr_indent (0); + os->incr_indent (0); // Traverse the graph. - if (this->traverse_inheritance_graph (be_interface::gen_optable_helper, ss) == -1) + if (this->traverse_inheritance_graph (be_interface::gen_optable_helper, os) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_interface::gen_operation_table - " @@ -1051,34 +920,34 @@ be_interface::gen_operation_table (void) } // generate the skeleton for the is_a method. - ss->indent (); - *ss << "{\"_is_a\", &" << this->full_skel_name () << "::_is_a_skel},\n"; + os->indent (); + *os << "{\"_is_a\", &" << this->full_skel_name () << "::_is_a_skel},\n"; this->skel_count_++; - ss->indent (); - *ss << "{\"_non_existent\", &" << this->full_skel_name () << "::_non_existent_skel}\n"; + os->indent (); + *os << "{\"_non_existent\", &" << this->full_skel_name () << "::_non_existent_skel}\n"; this->skel_count_++; - ss->decr_indent (); - *ss << "};" << nl << nl; + os->decr_indent (); + *os << "};" << nl << nl; // XXXASG - this code should be based on using different strategies for // demux - for next release - *ss << "static const CORBA::Long _tao_" << this->flatname () + *os << "static const CORBA::Long _tao_" << this->flat_name () << "_optable_size = sizeof (ACE_Hash_Map_Entry<const char *," << " TAO_Skeleton>) * (" << (3*this->skel_count_) << ");" << be_nl; - *ss << "static char _tao_" << this->flatname () << "_optable_pool " - << "[_tao_" << this->flatname () << "_optable_size];" << be_nl; - *ss << "static ACE_Static_Allocator_Base _tao_" << this->flatname () - << "_allocator (_tao_" << this->flatname () << "_optable_pool, " - << "_tao_" << this->flatname () << "_optable_size);" << be_nl; - *ss << "static TAO_Dynamic_Hash_OpTable tao_" - << this->flatname () << "_optable " << "(" << be_idt << be_idt_nl - << this->flatname () << "_operations," << be_nl + *os << "static char _tao_" << this->flat_name () << "_optable_pool " + << "[_tao_" << this->flat_name () << "_optable_size];" << be_nl; + *os << "static ACE_Static_Allocator_Base _tao_" << this->flat_name () + << "_allocator (_tao_" << this->flat_name () << "_optable_pool, " + << "_tao_" << this->flat_name () << "_optable_size);" << be_nl; + *os << "static TAO_Dynamic_Hash_OpTable tao_" + << this->flat_name () << "_optable " << "(" << be_idt << be_idt_nl + << this->flat_name () << "_operations," << be_nl << this->skel_count_ << "," << be_nl << 2*this->skel_count_ << "," << be_nl - << "&_tao_" << this->flatname () << "_allocator" << be_uidt_nl + << "&_tao_" << this->flat_name () << "_allocator" << be_uidt_nl << ");" << be_uidt_nl; break; @@ -1097,13 +966,13 @@ be_interface::gen_operation_table (void) char *temp_file = 0; ACE_NEW_RETURN (temp_file, char [ACE_OS::strlen (idl_global->temp_dir ()) + - ACE_OS::strlen (this->flatname ()) + + ACE_OS::strlen (this->flat_name ()) + ACE_OS::strlen (".gperf") + 1], -1); ACE_OS::sprintf (temp_file, "%s%s.gperf", idl_global->temp_dir (), - this->flatname ()); + this->flat_name ()); // Save this file name with the codegen singleton. cg->gperf_input_filename (temp_file); @@ -1116,8 +985,8 @@ be_interface::gen_operation_table (void) TAO_OUTSTREAM_FACTORY::instance (); // Get a new instance for the temp file. - ss = factory->make_outstream (); - if (ss == 0) + os = factory->make_outstream (); + if (os == 0) ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ss", "::", @@ -1126,10 +995,10 @@ be_interface::gen_operation_table (void) -1); // Store the outstream with the codegen singleton. - cg->gperf_input_stream (ss); + cg->gperf_input_stream (os); // Open the temp file. - if (ss->open (temp_file, + if (os->open (temp_file, TAO_OutStream::TAO_GPERF_INPUT) == -1) ACE_ERROR_RETURN ((LM_ERROR, "be_visitor_interface_ss", @@ -1139,24 +1008,24 @@ be_interface::gen_operation_table (void) -1); // Add the gperf input header. - this->gen_gperf_input_header (ss); + this->gen_gperf_input_header (os); // Traverse the graph. - if (this->traverse_inheritance_graph (be_interface::gen_optable_helper, ss) == -1) + if (this->traverse_inheritance_graph (be_interface::gen_optable_helper, os) == -1) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_interface::gen_operation_table - " "inheritance graph traversal failed\n"), -1); // Generate the skeleton for the is_a method. - ss->indent (); - *ss << "_is_a" << ", &" + os->indent (); + *os << "_is_a" << ", &" << this->full_skel_name () << "::_is_a_skel\n"; this->skel_count_++; - ss->indent (); - *ss << "_non_existent, &" + os->indent (); + *os << "_non_existent, &" << this->full_skel_name () << "::_non_existent_skel\n"; this->skel_count_++; @@ -1179,12 +1048,14 @@ be_interface::gen_operation_table (void) return 0; } + + // Output the header (type declaration and %%) to the gperf's input // file. void -be_interface::gen_gperf_input_header (TAO_OutStream *ss) +be_interface::gen_gperf_input_header (TAO_OutStream *os) { - *ss << "class TAO_operation_db_entry {\n" + *os << "class TAO_operation_db_entry {\n" << "public:\n" << "\tchar *opname_;" << "\n" << "\tTAO_Skeleton skel_ptr_;" << "\n" @@ -1203,7 +1074,7 @@ be_interface::gen_optable_entries (be_interface *derived) { UTL_ScopeActiveIterator *si; AST_Decl *d; - TAO_OutStream *ss; // output stream + TAO_OutStream *os; // output stream // retrieve a singleton instance of the code generator TAO_CodeGen *cg = TAO_CODEGEN::instance (); @@ -1212,7 +1083,8 @@ be_interface::gen_optable_entries (be_interface *derived) { case TAO_CodeGen::TAO_DYNAMIC_HASH: // Init the outstream. - ss = cg->server_skeletons (); + + os = this->strategy_->get_out_stream (); // The major stuff. if (this->nmembers () > 0) @@ -1231,10 +1103,10 @@ be_interface::gen_optable_entries (be_interface *derived) if (d->node_type () == AST_Decl::NT_op) { // Start from current indentation level - ss->indent (); + os->indent (); // we are an operation node - *ss << "{\"" << d->original_local_name () << "\", &" + *os << "{\"" << d->original_local_name () << "\", &" << derived->full_skel_name () << "::" << d->local_name () << "_skel},\n"; @@ -1245,11 +1117,11 @@ be_interface::gen_optable_entries (be_interface *derived) AST_Attribute *attr; // Start from current indentation level. - ss->indent (); + os->indent (); // Generate only the "get" entry if we are // readonly. - *ss << "{\"_get_" << d->original_local_name () + *os << "{\"_get_" << d->original_local_name () << "\", &" << derived->full_skel_name () << "::_get_" << d->local_name () << "_skel},\n"; @@ -1262,8 +1134,8 @@ be_interface::gen_optable_entries (be_interface *derived) if (!attr->readonly ()) { // the set method - ss->indent (); // start from current indentation level - *ss << "{\"_set_" << d->original_local_name () + os->indent (); // start from current indentation level + *os << "{\"_set_" << d->original_local_name () << "\", &" << derived->full_skel_name () << "::_set_" << d->local_name () << "_skel},\n"; derived->skel_count_++; @@ -1280,7 +1152,7 @@ be_interface::gen_optable_entries (be_interface *derived) case TAO_CodeGen::TAO_PERFECT_HASH: // We call GPERF for all these three strategies. // Init the outstream. - ss = cg->gperf_input_stream (); + os = cg->gperf_input_stream (); if (this->nmembers () > 0) { @@ -1303,11 +1175,11 @@ be_interface::gen_optable_entries (be_interface *derived) // // Start from current indentation level - ss->indent (); + os->indent (); // We are an operation node. We use the original // operation name, not the one with _cxx_ in it. - *ss << d->original_local_name () << ",\t&" + *os << d->original_local_name () << ",\t&" << derived->full_skel_name () << "::" << d->local_name () << "_skel" << "\n"; @@ -1318,10 +1190,10 @@ be_interface::gen_optable_entries (be_interface *derived) AST_Attribute *attr; // Start from current indentation level - ss->indent (); + os->indent (); // Generate only the "get" entry if we are readonly - *ss << "_get_" << d->original_local_name () << ",\t&" + *os << "_get_" << d->original_local_name () << ",\t&" << derived->full_skel_name () << "::_get_" << d->local_name () << "_skel\n"; derived->skel_count_++; @@ -1333,8 +1205,8 @@ be_interface::gen_optable_entries (be_interface *derived) if (!attr->readonly ()) { // the set method - ss->indent (); // start from current indentation level - *ss << "_set_" << d->original_local_name () << ",\t&" + os->indent (); // start from current indentation level + *os << "_set_" << d->original_local_name () << ",\t&" << derived->full_skel_name () << "::_set_" << d->local_name () << "_skel\n"; derived->skel_count_++; @@ -1357,12 +1229,14 @@ be_interface::gen_optable_entries (be_interface *derived) return 0; } + + // template method that traverses the inheritance graph in a breadth-first // style. The actual work on each element in the inheritance graph is carried // out by the function passed as argument int be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen, - TAO_OutStream *os) + TAO_OutStream *os) { long i; // loop index ACE_Unbounded_Queue <be_interface*> queue; // Queue data structure needed for @@ -1449,7 +1323,7 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen, be_interface **temp; // queue element (void) q_iter.next (temp); - if (!ACE_OS::strcmp (parent->fullname (), (*temp)->fullname ())) + if (!ACE_OS::strcmp (parent->full_name (), (*temp)->full_name ())) { // we exist in this queue and cannot be inserted found = 1; @@ -1467,7 +1341,7 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen, be_interface **temp; // queue element (void) del_q_iter.next (temp); - if (!ACE_OS::strcmp (parent->fullname (), (*temp)->fullname ())) + if (!ACE_OS::strcmp (parent->full_name (), (*temp)->full_name ())) { // we exist in this del_queue and cannot be inserted found = 1; @@ -1492,6 +1366,7 @@ be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen, return 0; } + // helpers passed to the template method int @@ -1511,6 +1386,8 @@ be_interface::gen_optable_helper (be_interface *derived, return 0; } + + // Run GPERF and get the correct lookup and other operations // depending on which strategy we are using. Returns 0 on sucess, -1 // on error. @@ -1589,13 +1466,10 @@ be_interface::gen_gperf_things (void) void be_interface::gen_perfect_hash_class_definition (void) { - // Codegen singleton. - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - // Outstream. - TAO_OutStream *ss = cg->server_skeletons (); + TAO_OutStream *os = this->strategy_->get_out_stream (); - *ss << "class " << "TAO_" << this->flatname () << "_Perfect_Hash_OpTable" + *os << "class " << "TAO_" << this->flat_name () << "_Perfect_Hash_OpTable" << " : public TAO_Perfect_Hash_OpTable" << be_nl << "{" @@ -1617,13 +1491,10 @@ be_interface::gen_perfect_hash_class_definition (void) void be_interface::gen_binary_search_class_definition (void) { - // Codegen singleton. - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - // Outstream. - TAO_OutStream *ss = cg->server_skeletons (); + TAO_OutStream *os = this->strategy_->get_out_stream (); - *ss << "class " << "TAO_" << this->flatname () << "_Binary_Search_OpTable" + *os << "class " << "TAO_" << this->flat_name () << "_Binary_Search_OpTable" << " : public TAO_Binary_Search_OpTable" << be_nl << "{" @@ -1641,13 +1512,10 @@ be_interface::gen_binary_search_class_definition (void) void be_interface::gen_linear_search_class_definition (void) { - // Codegen singleton. - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - // Outstream. - TAO_OutStream *ss = cg->server_skeletons (); + TAO_OutStream *ss = this->strategy_->get_out_stream (); - *ss << "class " << "TAO_" << this->flatname () << "_Linear_Search_OpTable" + *ss << "class " << "TAO_" << this->flat_name () << "_Linear_Search_OpTable" << " : public TAO_Linear_Search_OpTable" << be_nl << "{" @@ -1703,8 +1571,11 @@ be_interface::gen_gperf_lookup_methods (void) // again with ACE_OS::open with WRITE + APPEND option.. After this, // remember to update the file offset to the correct location. - ACE_HANDLE output = ACE_OS::open (idl_global->be_get_server_skeleton_fname (), + ACE_HANDLE output = ACE_OS::open (this->strategy_->get_out_stream_fname (), O_WRONLY | O_APPEND); + + //ACE_HANDLE output = ACE_OS::open (idl_global->be_get_server_skeleton_fname (), + // O_WRONLY | O_APPEND); if (output == ACE_INVALID_HANDLE) ACE_ERROR_RETURN ((LM_ERROR, "%p:File open failed on server skeleton file\n"), @@ -1735,7 +1606,7 @@ be_interface::gen_gperf_lookup_methods (void) " " "-N lookup", idl_global->gperf_path (), - this->flatname ()); + this->flat_name ()); break; // Binary search methods from GPERF. Everythis and the -B flag. @@ -1758,7 +1629,7 @@ be_interface::gen_gperf_lookup_methods (void) " " "-N lookup", idl_global->gperf_path (), - this->flatname ()); + this->flat_name ()); break; // Linear search methods from GPERF. Everything and the -z flag. @@ -1781,7 +1652,7 @@ be_interface::gen_gperf_lookup_methods (void) " " "-N lookup", idl_global->gperf_path (), - this->flatname ()); + this->flat_name ()); break; default: @@ -1804,7 +1675,7 @@ be_interface::gen_gperf_lookup_methods (void) -1); // Adjust the file offset to the EOF for the server skeleton file. - ACE_OS::fseek (cg->server_skeletons ()->file (), 0, SEEK_END); + ACE_OS::fseek (this->strategy_->get_out_stream()->file (), 0, SEEK_END); return 0; } @@ -1813,15 +1684,12 @@ be_interface::gen_gperf_lookup_methods (void) void be_interface::gen_perfect_hash_instance () { - // Codegen singleton. - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - // Outstream. - TAO_OutStream *ss = cg->server_skeletons (); + TAO_OutStream *os = this->strategy_->get_out_stream (); - *ss << "static TAO_" << this->flatname () << "_Perfect_Hash_OpTable" + *os << "static TAO_" << this->flat_name () << "_Perfect_Hash_OpTable" << " " - << "tao_" << this->flatname () << "_optable" + << "tao_" << this->flat_name () << "_optable" << ";\n" << be_nl; } @@ -1829,34 +1697,30 @@ be_interface::gen_perfect_hash_instance () void be_interface::gen_binary_search_instance () { - // Codegen singleton. - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - // Outstream. - TAO_OutStream *ss = cg->server_skeletons (); + TAO_OutStream *os = this->strategy_->get_out_stream (); - *ss << "static TAO_" << this->flatname () << "_Binary_Search_OpTable" + *os << "static TAO_" << this->flat_name () << "_Binary_Search_OpTable" << " " - << "tao_" << this->flatname () << "_optable" + << "tao_" << this->flat_name () << "_optable" << ";\n" << be_nl; } + // Create an instance of this perfect hash table. void be_interface::gen_linear_search_instance () { - // Codegen singleton. - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - // Outstream. - TAO_OutStream *ss = cg->server_skeletons (); + TAO_OutStream *os = this->strategy_->get_out_stream (); - *ss << "static TAO_" << this->flatname () << "_Linear_Search_OpTable" + *os << "static TAO_" << this->flat_name () << "_Linear_Search_OpTable" << " " - << "tao_" << this->flatname () << "_optable" + << "tao_" << this->flat_name () << "_optable" << ";\n" << be_nl; } + int be_interface::is_a_helper (be_interface * /*derived*/, be_interface *bi, @@ -1870,6 +1734,8 @@ be_interface::is_a_helper (be_interface * /*derived*/, return 0; } + + int be_interface::downcast_helper (be_interface * /* derived */, be_interface *base, @@ -1882,6 +1748,7 @@ be_interface::downcast_helper (be_interface * /* derived */, return 0; } + int be_interface::gen_skel_helper (be_interface *derived, be_interface *ancestor, @@ -2115,107 +1982,503 @@ be_interface::in_mult_inheritance_helper (be_interface *derived, return 0; } -// return the relative skeleton name (needed due to NT compiler insanity) + +int +be_interface::accept (be_visitor *visitor) +{ + return visitor->visit_interface (this); +} + +// **************************************************************** + +be_interface_type_strategy::be_interface_type_strategy (be_interface *node) + : local_name_(0), + full_name_(0), + flat_name_(0), + repoID_(0), + full_skel_name_(0), + full_coll_name_(0), + local_coll_name_(0), + relative_skel_name_(0), + node_ (node) +{ +} + +be_interface_type_strategy::~be_interface_type_strategy () +{ + if (this->local_name_ != 0) + delete [] this->local_name_; + if (this->full_name_ != 0) + delete [] this->full_name_; + if (this->flat_name_ != 0) + delete [] this->flat_name_; + if (this->repoID_ != 0) + delete [] this->repoID_; + if (this->full_skel_name_ != 0) + delete [] this->full_skel_name_; + if (this->full_coll_name_ != 0) + delete [] this->full_coll_name_; + if (this->local_coll_name_ != 0) + delete [] this->local_coll_name_; + if (this->relative_skel_name_ != 0) + delete [] this->relative_skel_name_; +} + +// Interface Type Strategy Base Class + const char * -be_interface::relative_skel_name (const char *skelname) +be_interface_type_strategy::relative_skel_name (const char *skel_name) +// relative skeleton name { return be_interface::relative_name (this->full_skel_name (), - skelname); + skel_name); } -const char* -be_interface::relative_name (const char *localname, - const char *othername) + + +// compute stringified fully qualified collocated class name. +void +be_interface_type_strategy::compute_coll_names (int type, + const char *prefix, + const char *suffix) { - // some compilers do not like generating a fully scoped name for a - // type that was defined in the same enclosing scope in which it was - // defined. We have to emit just the partial name, relative to our - // "localname" +// @@ not thread safe. + static int cached_type = -1; + if (type == cached_type && this->full_coll_name_ != 0) + return; + else + { + cached_type = type; + delete this->full_coll_name_; + delete this->local_coll_name_; + } - // The tricky part here is that it is not enough to check if the - // typename we are using was defined in the current scope. But we - // need to ensure that it was not defined in any of our ancestor - // scopes as well. If that is the case, then we can generate a fully - // scoped name for that type, else we use the ACE_NESTED_CLASS macro + static const char *collocated_names[] = { "_tao_thru_poa_collocated_", + "_tao_direct_collocated_" }; + const char poa[] = "POA_"; + // Reserve enough room for the "POA_" prefix, the "_tao_collocated_" + // prefix and the local name and the (optional) "::" + const char *collocated = collocated_names[type]; - // thus we need some sort of relative name to be generated + int name_len = ACE_OS::strlen (collocated) + + sizeof (poa) + + 1; - static char macro [NAMEBUFSIZE]; - // UNUSED: be_decl *def_scope = 0; // our defining scope - char // hold the fully scoped name - def_name [NAMEBUFSIZE], - use_name [NAMEBUFSIZE]; - char // these point to the curr and next component in the scope - *def_curr = def_name, - *def_next, - *use_curr = use_name, - *use_next; + if (prefix) + name_len += ACE_OS::strlen (prefix); - ACE_OS::memset (macro, '\0', NAMEBUFSIZE); - ACE_OS::memset (def_name, '\0', NAMEBUFSIZE); - ACE_OS::memset (use_name, '\0', NAMEBUFSIZE); + if (suffix) + name_len += ACE_OS::strlen (suffix); - // traverse every component of the def_scope and use_scope beginning at the - // root and proceeding towards the leaf trying to see if the components - // match. Continue until there is a match and keep accumulating the path - // traversed. This forms the first argument to the ACE_NESTED_CLASS - // macro. Whenever there is no match, the remaining components of the - // def_scope form the second argument + { + UTL_IdListActiveIterator *i; + ACE_NEW (i, UTL_IdListActiveIterator (node_->name ())); + while (!i->is_done ()) + { + // reserve 2 characters for "::". + name_len += ACE_OS::strlen (i->item ()->get_string ()) + 2; + i->next (); + } + delete i; + } - ACE_OS::strcpy (def_name, localname); - ACE_OS::strcpy (use_name, othername); + ACE_NEW (this->full_coll_name_, + char[name_len+1]); + this->full_coll_name_[0] = 0; // null terminate the string... - while (def_curr && use_curr) - { - // find the first occurrence of a :: and advance the next pointers accordingly - def_next = ACE_OS::strstr (def_curr, "::"); - use_next = ACE_OS::strstr (use_curr, "::"); + // Iterate again.... + UTL_IdListActiveIterator *i; + ACE_NEW (i, UTL_IdListActiveIterator (node_->name ())); - if (def_next) - *def_next = 0; + // Only the first component get the "POA_" preffix. + int poa_added = 0; + while (!i->is_done ()) + { + const char* item = i->item ()->get_string (); - if (use_next) - *use_next = 0; + // Increase right away, so we can test for the final component + // in the loop. + i->next (); - if (!ACE_OS::strcmp (def_curr, use_curr)) + // We add the POA_ preffix only if the first component is not + // the global scope... + if (ACE_OS::strcmp (item, "") != 0) { - // they have same prefix, append to arg1 - def_curr = (def_next ? (def_next+2) : 0); // skip the :: - use_curr = (use_next ? (use_next+2) : 0); // skip the :: + if (!i->is_done ()) + { + // We only add the POA_ preffix if there are more than + // two components in the name, in other words, if the + // class is inside some scope. + if (!poa_added) + { + ACE_OS::strcat (this->full_coll_name_, poa); + poa_added = 1; + } + ACE_OS::strcat (this->full_coll_name_, item); + ACE_OS::strcat (this->full_coll_name_, "::"); + } + else + { + ACE_OS::strcat (this->full_coll_name_, collocated); + + if (prefix) + ACE_OS::strcat (this->full_coll_name_, prefix); + + ACE_OS::strcat (this->full_coll_name_, item); + + if (suffix) + ACE_OS::strcat (this->full_coll_name_, suffix); + } } - else - { - // we had overwritten a ':' by a '\0' for string comparison. We - // revert back because we want the rest of the relative name to be - // used - if (def_next) - *def_next = ':'; + } + delete i; - if (use_next) - *use_next = ':'; + // Compute the local name for the collocated class. + int local_len = ACE_OS::strlen (collocated) + + ACE_OS::strlen (node_->AST_Interface::local_name ()->get_string ()) + + 1; + if (prefix) + local_len += ACE_OS::strlen (prefix); - // no match. This is the end of the first argument. Get out - // of the loop as no more comparisons are necessary + if (suffix) + local_len += ACE_OS::strlen (suffix); + + ACE_NEW (this->local_coll_name_, char[local_len]); + + ACE_OS::strcpy(this->local_coll_name_, collocated); + + if (prefix) + ACE_OS::strcat (this->local_coll_name_, prefix); + + ACE_OS::strcat(this->local_coll_name_, + node_->AST_Interface::local_name ()->get_string ()); + + if (suffix) + ACE_OS::strcat (this->local_coll_name_, suffix); +} + + +void +be_interface_type_strategy::compute_names (const char *name, + const char *prefix, + const char *suffix, + char *&new_name) +{ + if (!prefix || !suffix) + return; + + int name_length = ACE_OS::strlen (name) + + ACE_OS::strlen (prefix) + + ACE_OS::strlen (suffix); + + ACE_NEW (new_name, + char[name_length + 1]); + + // copy it in + ACE_OS::strcpy (new_name, name); + + const char *interface_name = 0; + int i = ACE_OS::strlen (name); + for (;i >= 1; i--) + { + if (name[i-1] == ':' && name[i] == ':') + { + interface_name = &name[i+1]; break; } + else if (i >= 3) + if (name[i-3] == 'P' && + name[i-2] == 'O' && + name[i-1] == 'A' && + name[i] == '_') + { + interface_name = &name[i+1]; + break; + } + } + + if (interface_name == 0) + interface_name = name; + + ACE_OS::strcpy(&new_name[name_length - + ACE_OS::strlen(prefix) - + ACE_OS::strlen(interface_name) - + ACE_OS::strlen(suffix)],prefix); + + ACE_OS::strcpy(&new_name[name_length - + ACE_OS::strlen(interface_name) - + ACE_OS::strlen(suffix)],interface_name); + + ACE_OS::strcpy(&new_name[name_length - + ACE_OS::strlen(suffix)],suffix); +} + +// **************************************************************** +// AMI Hander Strategy + +be_interface_ami_handler_strategy::be_interface_ami_handler_strategy (be_interface *node) + : be_interface_type_strategy (node), + prefix_("AMI_"), + suffix_("_Handler") +{ +} + +be_interface_ami_handler_strategy::~be_interface_ami_handler_strategy () +{ +} + +const char * +be_interface_ami_handler_strategy::full_name (void) +{ + if (!this->full_name_) + this->compute_names (node_->be_decl::full_name (), + prefix_, + suffix_, + this->full_name_); + + return this->full_name_; +} + +const char * +be_interface_ami_handler_strategy::local_name (void) +{ + if (!this->local_name_) + this->compute_names (node_->AST_Interface::local_name()->get_string (), + prefix_, + suffix_, + this->local_name_); + + return this->local_name_; +} + +const char * +be_interface_ami_handler_strategy::flat_name (void) +{ + if (!this->flat_name_) + node_->compute_flat_name (prefix_, + suffix_, + this->flat_name_); + + return this->flat_name_; +} + +const char * +be_interface_ami_handler_strategy::repoID (void) +{ + if (!this->repoID_) + node_->compute_repoID (prefix_, + suffix_, + this->repoID_); + + return this->repoID_; +} + +const char * +be_interface_ami_handler_strategy::full_skel_name (void) +{ + if (this->full_skel_name_ == 0) + { + char *temp = 0; + + // the following method is inherited from the base class + node_->compute_full_skel_name ("POA_", temp); + + // we are now responsible for the memory of temp + + this->compute_names (temp, + prefix_, + suffix_, + this->full_skel_name_); + + delete temp; + } + + return this->full_skel_name_; +} + + +const char * +be_interface_ami_handler_strategy::full_coll_name (int type) +{ + if (this->full_coll_name_ == 0) + { + this->compute_coll_names (type, + prefix_, + suffix_); } - // start the 2nd argument of the macro + return this->full_coll_name_; +} - // copy the remaining def_name (if any left) - if (def_curr) - ACE_OS::strcat (macro, def_curr); +const char * +be_interface_ami_handler_strategy::local_coll_name (int type) +{ + if (this->local_coll_name_ == 0) + { + compute_coll_names (type, + prefix_, + suffix_); + } - return macro; + return this->local_coll_name_; } -int -be_interface::accept (be_visitor *visitor) +TAO_OutStream * +be_interface_ami_handler_strategy::get_out_stream () { - return visitor->visit_interface (this); + // Codegen singleton. + TAO_CodeGen *cg = TAO_CODEGEN::instance (); + + // Outstream. + return cg->client_stubs (); +} + +const char * +be_interface_ami_handler_strategy::get_out_stream_fname () +{ + return idl_global->be_get_client_stub_fname (); +} + +// **************************************************************** +// Default Strategy + +be_interface_default_strategy::be_interface_default_strategy (be_interface *node) + : be_interface_type_strategy (node) +{ +} + +be_interface_default_strategy::~be_interface_default_strategy () +{ +} + +const char * +be_interface_default_strategy::full_name (void) +{ + if (!this->full_name_) + { + int len = ACE_OS::strlen (node_->be_decl::full_name ()); + + ACE_NEW_RETURN (this->full_name_, + char[len + 1], + 0); + + ACE_OS::strcpy (this->full_name_, + node_->be_decl::full_name ()); + } + + return this->full_name_; +} + +const char * +be_interface_default_strategy::local_name (void) +{ + if (!this->local_name_) + { + int len = ACE_OS::strlen (node_->AST_Interface::local_name()->get_string ()); + + ACE_NEW_RETURN (this->local_name_, + char[len + 1], + 0); + + ACE_OS::strcpy (this->local_name_, + node_->AST_Interface::local_name()->get_string ()); + } + + return this->local_name_; +} + +const char * +be_interface_default_strategy::flat_name (void) +{ + if (!this->flat_name_) + { + int len = ACE_OS::strlen (node_->be_decl::flat_name ()); + + ACE_NEW_RETURN (this->flat_name_, + char[len + 1], + 0); + + ACE_OS::strcpy (this->flat_name_, + node_->be_decl::flat_name ()); + } + + + return this->flat_name_; } +const char * +be_interface_default_strategy::repoID (void) +{ + if (!this->repoID_) + { + int len = ACE_OS::strlen (node_->be_decl::repoID ()); + + ACE_NEW_RETURN (this->repoID_, + char[len + 1], + 0); + + ACE_OS::strcpy (this->repoID_, + node_->be_decl::repoID ()); + } + return this->repoID_; +} + +const char * +be_interface_default_strategy::full_skel_name (void) +{ + if (this->full_skel_name_ == 0) + { + // the following method is inherited from the base class + node_->compute_full_skel_name ("POA_", + this->full_skel_name_); + } + + return this->full_skel_name_; +} + + +const char * +be_interface_default_strategy::full_coll_name (int type) +{ + if (this->full_coll_name_ == 0) + { + this->compute_coll_names (type, + 0, // prefix + 0); // suffix + } + + return this->full_coll_name_; +} + +const char * +be_interface_default_strategy::local_coll_name (int type) +{ + if (this->local_coll_name_ == 0) + { + this->compute_coll_names (type, + 0, // prefix + 0); // suffix + } + + return this->local_coll_name_; +} + +TAO_OutStream * +be_interface_default_strategy::get_out_stream () +{ + // Codegen singleton. + TAO_CodeGen *cg = TAO_CODEGEN::instance (); + + // Outstream. + return cg->server_skeletons (); +} + +const char * +be_interface_default_strategy::get_out_stream_fname () +{ + return idl_global->be_get_server_skeleton_fname (); +} // Narrowing IMPL_NARROW_METHODS3 (be_interface, AST_Interface, be_scope, be_type) diff --git a/TAO/TAO_IDL/be/be_interface_fwd.cpp b/TAO/TAO_IDL/be/be_interface_fwd.cpp index 94d1d430f60..61e1f97642c 100644 --- a/TAO/TAO_IDL/be/be_interface_fwd.cpp +++ b/TAO/TAO_IDL/be/be_interface_fwd.cpp @@ -137,7 +137,7 @@ be_interface_fwd::gen_var_impl (char *, char *) char lname [NAMEBUFSIZE]; // local _var names ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", this->fullname ()); + ACE_OS::sprintf (fname, "%s_var", this->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ()); @@ -377,7 +377,7 @@ be_interface_fwd::gen_out_impl (char *, char *) char lname [NAMEBUFSIZE]; // local _out names ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", this->fullname ()); + ACE_OS::sprintf (fname, "%s_out", this->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ()); diff --git a/TAO/TAO_IDL/be/be_predefined_type.cpp b/TAO/TAO_IDL/be/be_predefined_type.cpp index b7232df5407..ca2b12b9053 100644 --- a/TAO/TAO_IDL/be/be_predefined_type.cpp +++ b/TAO/TAO_IDL/be/be_predefined_type.cpp @@ -151,13 +151,13 @@ be_predefined_type::be_predefined_type (AST_PredefinedType::PredefinedType t, compute_repoID (); // computes the fully scoped name - compute_fullname (); + compute_full_name (); // computes the fully scoped typecode name compute_tc_name (); // compute the flattened fully scoped name - compute_flatname (); + compute_flat_name (); } diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp index 29c9979a175..a8414a82a4a 100644 --- a/TAO/TAO_IDL/be/be_sequence.cpp +++ b/TAO/TAO_IDL/be/be_sequence.cpp @@ -108,9 +108,9 @@ be_sequence::gen_name (void) // append the size (if any) if (!this->unbounded_) { - ACE_OS::sprintf (namebuf, - "%s_%lu", - namebuf, + ACE_OS::sprintf (namebuf, + "%s_%lu", + namebuf, this->max_size ()->ev ()->u.ulval); } return ACE_OS::strdup (namebuf); @@ -280,11 +280,11 @@ be_sequence::instance_name () if (this->unbounded ()) ACE_OS::sprintf (namebuf, "_TAO_Unbounded_Object_Sequence_%s", - this->flatname()); + this->flat_name()); else ACE_OS::sprintf (namebuf, "_TAO_Bounded_Object_Sequence_%s_%lu", - this->flatname(), + this->flat_name(), this->max_size ()->ev()->u.ulval); break; case be_sequence::MNG_STRING: // sequence of strings @@ -294,7 +294,7 @@ be_sequence::instance_name () else ACE_OS::sprintf (namebuf, "_TAO_Bounded_String_Sequence_%s", - this->flatname()); + this->flat_name()); break; default: // not a managed type if (this->unbounded ()) @@ -310,16 +310,15 @@ be_sequence::instance_name () else ACE_OS::sprintf (namebuf, "_TAO_Unbounded_Sequence_%s", - this->flatname()); - // or prim_type->flatname ()); + this->flat_name()); + // or prim_type->flat_name ()); // ACE_DEBUG ((LM_DEBUG, "testing.... %d, %d = <%s>\n", // predef, predef->pt (), namebuf)); } else ACE_OS::sprintf (namebuf, "_TAO_Bounded_Sequence_%s_%lu", - this->flatname(), - //prim_type->flatname (), + this->flat_name(), this->max_size()->ev()->u.ulval); break; } @@ -350,7 +349,7 @@ be_sequence::in_recursion (be_type *node) 0); } - if (!ACE_OS::strcmp (node->fullname (), type->fullname ())) + if (!ACE_OS::strcmp (node->full_name (), type->full_name ())) // they match return 1; else diff --git a/TAO/TAO_IDL/be/be_structure.cpp b/TAO/TAO_IDL/be/be_structure.cpp index bf21e4b9dd9..0a5c98736a0 100644 --- a/TAO/TAO_IDL/be/be_structure.cpp +++ b/TAO/TAO_IDL/be/be_structure.cpp @@ -169,7 +169,7 @@ be_structure::gen_var_impl (char *, char *) char lname [NAMEBUFSIZE]; // local _var names ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", this->fullname ()); + ACE_OS::sprintf (fname, "%s_var", this->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ()); @@ -452,7 +452,7 @@ be_structure::gen_out_impl (char *, char *) char lname [NAMEBUFSIZE]; // local _out names ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", this->fullname ()); + ACE_OS::sprintf (fname, "%s_out", this->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ()); diff --git a/TAO/TAO_IDL/be/be_type.cpp b/TAO/TAO_IDL/be/be_type.cpp index 4e1199c3210..080bc5356a9 100644 --- a/TAO/TAO_IDL/be/be_type.cpp +++ b/TAO/TAO_IDL/be/be_type.cpp @@ -219,8 +219,8 @@ be_type::nested_type_name (be_decl *use_scope, const char *suffix, const char *p if (def_scope && def_scope->node_type () != AST_Decl::NT_root && use_scope) // if both scopes exist and that we are not in the root scope { - ACE_OS::strcpy (def_name, def_scope->fullname ()); - ACE_OS::strcpy (use_name, use_scope->fullname ()); + ACE_OS::strcpy (def_name, def_scope->full_name ()); + ACE_OS::strcpy (use_name, use_scope->full_name ()); // find the first occurrence of a :: and advance the next pointers accordingly def_next = ACE_OS::strstr (def_curr, "::"); @@ -323,10 +323,10 @@ be_type::nested_type_name (be_decl *use_scope, const char *suffix, const char *p } // end of if the root prefixes match } - // otherwise just emit our fullname + // otherwise just emit our full_name if (prefix) ACE_OS::strcat (this->nested_type_name_, prefix); - ACE_OS::strcat (this->nested_type_name_, this->fullname ()); + ACE_OS::strcat (this->nested_type_name_, this->full_name ()); if (suffix) ACE_OS::strcat (this->nested_type_name_, suffix); diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp index 7f015666adf..de051fbc7f4 100644 --- a/TAO/TAO_IDL/be/be_union.cpp +++ b/TAO/TAO_IDL/be/be_union.cpp @@ -230,7 +230,7 @@ be_union::gen_var_impl (char *, char *) char lname [NAMEBUFSIZE]; // local _var names ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", this->fullname ()); + ACE_OS::sprintf (fname, "%s_var", this->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ()); @@ -513,7 +513,7 @@ be_union::gen_out_impl (char *, char *) char lname [NAMEBUFSIZE]; // local _out names ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", this->fullname ()); + ACE_OS::sprintf (fname, "%s_out", this->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ()); diff --git a/TAO/TAO_IDL/be/be_union_branch.cpp b/TAO/TAO_IDL/be/be_union_branch.cpp index 0d185d6164e..99f83a6b669 100644 --- a/TAO/TAO_IDL/be/be_union_branch.cpp +++ b/TAO/TAO_IDL/be/be_union_branch.cpp @@ -95,7 +95,8 @@ be_union_branch::gen_label_value (TAO_OutStream *os, unsigned long index) // we must prefix the enum value with something... be_decl* decl = scope->decl (); - *os << decl->fullname () << "::" << e->n (); + + *os << decl->full_name () << "::" << e->n (); return 0; } @@ -113,7 +114,7 @@ be_union_branch::gen_default_label_value (TAO_OutStream *os, "computing default value failed\n"), -1); } - + switch (bu->udisc_type ()) { case AST_Expression::EV_short: @@ -158,7 +159,6 @@ be_union_branch::gen_default_label_value (TAO_OutStream *os, "bad or unimplemented discriminant type\n"), -1); } - return 0; } diff --git a/TAO/TAO_IDL/be/be_valuetype.cpp b/TAO/TAO_IDL/be/be_valuetype.cpp index 3917f91400f..bdabc209e5c 100644 --- a/TAO/TAO_IDL/be/be_valuetype.cpp +++ b/TAO/TAO_IDL/be/be_valuetype.cpp @@ -101,7 +101,7 @@ be_valuetype::set_abstract_valuetype () void be_valuetype::compute_fullobvskelname (void) { - this->compute_fullskelname (this->full_obv_skel_name_, "OBV_"); + this->compute_full_skel_name ("OBV_", this->full_obv_skel_name_); } @@ -126,7 +126,7 @@ be_valuetype::gen_var_defn (char *) char namebuf [NAMEBUFSIZE]; // names ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ()); + ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()); // retrieve a singleton instance of the code generator TAO_CodeGen *cg = TAO_CODEGEN::instance (); @@ -213,10 +213,10 @@ be_valuetype::gen_var_impl (char *, char *) char lname [NAMEBUFSIZE]; // local _var names ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", this->fullname ()); + ACE_OS::sprintf (fname, "%s_var", this->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ()); + ACE_OS::sprintf (lname, "%s_var", local_name ()); // retrieve a singleton instance of the code generator TAO_CodeGen *cg = TAO_CODEGEN::instance (); @@ -407,7 +407,7 @@ be_valuetype::gen_out_defn (char *) char namebuf [NAMEBUFSIZE]; // to hold the _out name ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_out", local_name ()->get_string ()); + ACE_OS::sprintf (namebuf, "%s_out", local_name ()); // retrieve a singleton instance of the code generator TAO_CodeGen *cg = TAO_CODEGEN::instance (); @@ -465,10 +465,10 @@ be_valuetype::gen_out_impl (char *, char *) char lname [NAMEBUFSIZE]; // local _out names ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", this->fullname ()); + ACE_OS::sprintf (fname, "%s_out", this->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ()); + ACE_OS::sprintf (lname, "%s_out", local_name ()); // retrieve a singleton instance of the code generator TAO_CodeGen *cg = TAO_CODEGEN::instance (); diff --git a/TAO/TAO_IDL/be/be_valuetype_fwd.cpp b/TAO/TAO_IDL/be/be_valuetype_fwd.cpp index a6edfb1f3f5..5e8094a60a3 100644 --- a/TAO/TAO_IDL/be/be_valuetype_fwd.cpp +++ b/TAO/TAO_IDL/be/be_valuetype_fwd.cpp @@ -150,7 +150,7 @@ be_valuetype_fwd::gen_var_impl (char *, char *) char lname [NAMEBUFSIZE]; // local _var names ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", this->fullname ()); + ACE_OS::sprintf (fname, "%s_var", this->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ()); @@ -392,7 +392,7 @@ be_valuetype_fwd::gen_out_impl (char *, char *) char lname [NAMEBUFSIZE]; // local _out names ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", this->fullname ()); + ACE_OS::sprintf (fname, "%s_out", this->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ()); diff --git a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp index 22e77c1924a..bf19a07a4d6 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/argument.cpp @@ -64,7 +64,7 @@ be_visitor_args::type_name (be_type *node, const char *suffix) (this->ctx_->scope (), suffix)); break; default: // fullname for all other cases - ACE_OS::sprintf (namebuf, "%s", bt->fullname ()); + ACE_OS::sprintf (namebuf, "%s", bt->full_name ()); if (suffix) ACE_OS::strcat (namebuf, suffix); } diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp index da56bc26e3a..be8b5eb1e1c 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_ch.cpp @@ -64,7 +64,7 @@ int be_visitor_array_ch::visit_array (be_array *node) } // generate the ifdefined macro - os->gen_ifdef_macro (node->flatname ()); + os->gen_ifdef_macro (node->flat_name ()); // If we contain an anonymous sequence, // generate code for the sequence here. diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp index 2e89af77bc8..3db9a32cda1 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_ci.cpp @@ -126,8 +126,8 @@ be_visitor_array_ci::gen_var_impl (be_array *node) if (this->ctx_->tdef ()) { // typedefed node - ACE_OS::sprintf (nodename, "%s", node->fullname ()); - ACE_OS::sprintf (fname, "%s_var", node->fullname ()); + ACE_OS::sprintf (nodename, "%s", node->full_name ()); + ACE_OS::sprintf (fname, "%s_var", node->full_name ()); ACE_OS::sprintf (lname, "%s_var", node->local_name ()->get_string ()); } @@ -139,17 +139,17 @@ be_visitor_array_ci::gen_var_impl (be_array *node) if (node->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (nodename, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (nodename, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); - ACE_OS::sprintf (fname, "%s::_%s_var", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s_var", parent->full_name (), node->local_name ()->get_string ()); ACE_OS::sprintf (lname, "_%s_var", node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (nodename, "_%s", node->fullname ()); - ACE_OS::sprintf (fname, "_%s_var", node->fullname ()); + ACE_OS::sprintf (nodename, "_%s", node->full_name ()); + ACE_OS::sprintf (fname, "_%s_var", node->full_name ()); ACE_OS::sprintf (lname, "_%s_var", node->local_name ()->get_string ()); } @@ -335,8 +335,8 @@ be_visitor_array_ci::gen_out_impl (be_array *node) if (this->ctx_->tdef ()) { // typedefed node - ACE_OS::sprintf (nodename, "%s", node->fullname ()); - ACE_OS::sprintf (fname, "%s_out", node->fullname ()); + ACE_OS::sprintf (nodename, "%s", node->full_name ()); + ACE_OS::sprintf (fname, "%s_out", node->full_name ()); ACE_OS::sprintf (lname, "%s_out", node->local_name ()->get_string ()); } @@ -348,17 +348,17 @@ be_visitor_array_ci::gen_out_impl (be_array *node) if (node->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (nodename, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (nodename, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); - ACE_OS::sprintf (fname, "%s::_%s_out", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s_out", parent->full_name (), node->local_name ()->get_string ()); ACE_OS::sprintf (lname, "_%s_out", node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (nodename, "_%s", node->fullname ()); - ACE_OS::sprintf (fname, "_%s_out", node->fullname ()); + ACE_OS::sprintf (nodename, "_%s", node->full_name ()); + ACE_OS::sprintf (fname, "_%s_out", node->full_name ()); ACE_OS::sprintf (lname, "_%s_out", node->local_name ()->get_string ()); } @@ -469,8 +469,8 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) if (this->ctx_->tdef ()) { // typedefed node - ACE_OS::sprintf (nodename, "%s", node->fullname ()); - ACE_OS::sprintf (fname, "%s_forany", node->fullname ()); + ACE_OS::sprintf (nodename, "%s", node->full_name ()); + ACE_OS::sprintf (fname, "%s_forany", node->full_name ()); ACE_OS::sprintf (lname, "%s_forany", node->local_name ()->get_string ()); } @@ -482,17 +482,17 @@ be_visitor_array_ci::gen_forany_impl (be_array *node) if (node->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (nodename, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (nodename, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); - ACE_OS::sprintf (fname, "%s::_%s_forany", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s_forany", parent->full_name (), node->local_name ()->get_string ()); ACE_OS::sprintf (lname, "_%s_forany", node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (nodename, "_%s", node->fullname ()); - ACE_OS::sprintf (fname, "_%s_forany", node->fullname ()); + ACE_OS::sprintf (nodename, "_%s", node->full_name ()); + ACE_OS::sprintf (fname, "_%s_forany", node->full_name ()); ACE_OS::sprintf (lname, "_%s_forany", node->local_name ()->get_string ()); } diff --git a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp b/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp index 981355135c5..b2454bdd7af 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/array_cs.cpp @@ -72,7 +72,7 @@ int be_visitor_array_cs::visit_array (be_array *node) if (this->ctx_->tdef ()) { // typedefed node - ACE_OS::sprintf (fname, "%s", node->fullname ()); + ACE_OS::sprintf (fname, "%s", node->full_name ()); ACE_OS::sprintf (lname, "%s", node->local_name ()->get_string ()); } @@ -84,14 +84,14 @@ int be_visitor_array_cs::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); ACE_OS::sprintf (lname, "_%s", node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", node->fullname ()); + ACE_OS::sprintf (fname, "_%s", node->full_name ()); ACE_OS::sprintf (lname, "_%s", node->local_name ()->get_string ()); } diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp index 29fdc73c3a7..a596921dc4f 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ch.cpp @@ -59,7 +59,7 @@ be_visitor_array_cdr_op_ch::visit_array (be_array *node) { be_scope* scope = be_scope::narrow_from_scope (node->defined_in ()); be_decl* parent = scope->decl (); - *os << parent->fullname () + *os << parent->full_name () << "::_" << node->local_name () << "_forany &);" << be_nl; } @@ -73,7 +73,7 @@ be_visitor_array_cdr_op_ch::visit_array (be_array *node) { be_scope* scope = be_scope::narrow_from_scope (node->defined_in ()); be_decl* parent = scope->decl (); - *os << parent->fullname () + *os << parent->full_name () << "::_" << node->local_name () << "_forany &);" << be_nl; } diff --git a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp index deeea61de64..220a3c46cd0 100644 --- a/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_array/cdr_op_ci.cpp @@ -92,7 +92,7 @@ be_visitor_array_cdr_op_ci::visit_array (be_array *node) } // for anonymous arrays, the type name has a _ prepended. We compute the - // fullname with or without the underscore and use it later on. + // full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and // save the node's local name and full name in a buffer for quick use later @@ -101,7 +101,7 @@ be_visitor_array_cdr_op_ci::visit_array (be_array *node) if (this->ctx_->tdef ()) { // typedefed node - ACE_OS::sprintf (fname, "%s", node->fullname ()); + ACE_OS::sprintf (fname, "%s", node->full_name ()); } else { @@ -112,12 +112,12 @@ be_visitor_array_cdr_op_ci::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", node->fullname ()); + ACE_OS::sprintf (fname, "_%s", node->full_name ()); } } diff --git a/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp b/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp index 5c3bff6388f..78a6dcbff64 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/ctor_assign.cpp @@ -94,7 +94,7 @@ int be_visitor_exception_ctor_assign::visit_array (be_array *node) os->indent (); - if (ACE_OS::strcmp (bd->flatname (), node->flatname ())) + if (ACE_OS::strcmp (bd->flat_name (), node->flat_name ())) { // We are typedef'd. *os << node->name (); diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp index 34bc5134cc1..30c9a20f401 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ch.cpp @@ -50,7 +50,7 @@ int be_visitor_exception_ch::visit_exception (be_exception *node) { os = this->ctx_->stream (); - os->gen_ifdef_macro (node->flatname (), "_ptr"); + os->gen_ifdef_macro (node->flat_name (), "_ptr"); os->indent (); *os << "class " << node->local_name () << ";" << be_nl; @@ -59,7 +59,7 @@ int be_visitor_exception_ch::visit_exception (be_exception *node) << node->local_name () << "_ptr;" << be_nl; os->gen_endif (); - os->gen_ifdef_macro (node->flatname ()); + os->gen_ifdef_macro (node->flat_name ()); os->indent (); *os << "class " << idl_global->stub_export_macro () diff --git a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp b/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp index 6b3e59fdae6..f5647a4e9b1 100644 --- a/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp +++ b/TAO/TAO_IDL/be/be_visitor_exception/exception_ctor.cpp @@ -126,7 +126,7 @@ int be_visitor_exception_ctor::visit_array (be_array *node) if (this->ctx_->state () != TAO_CodeGen::TAO_EXCEPTION_CTOR_CH && !tdef) - *os << this->ctx_->scope ()->fullname () << "::"; + *os << this->ctx_->scope ()->full_name () << "::"; if (!tdef) *os << "_"; diff --git a/TAO/TAO_IDL/be/be_visitor_factory.cpp b/TAO/TAO_IDL/be/be_visitor_factory.cpp index e0ff7f482cf..acf59ff8878 100644 --- a/TAO/TAO_IDL/be/be_visitor_factory.cpp +++ b/TAO/TAO_IDL/be/be_visitor_factory.cpp @@ -125,19 +125,24 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_MODULE_CH: return new be_visitor_module_ch (new_ctx); + case TAO_CodeGen::TAO_MODULE_SH: return new be_visitor_module_sh (new_ctx); + case TAO_CodeGen::TAO_MODULE_IH: return new be_visitor_module_ih (new_ctx); + case TAO_CodeGen::TAO_MODULE_CI: case TAO_CodeGen::TAO_MODULE_CS: case TAO_CodeGen::TAO_MODULE_SI: case TAO_CodeGen::TAO_MODULE_SS: case TAO_CodeGen::TAO_MODULE_IS: return new be_visitor_module (new_ctx); + case TAO_CodeGen::TAO_MODULE_ANY_OP_CH: case TAO_CodeGen::TAO_MODULE_ANY_OP_CS: return new be_visitor_module_any_op (new_ctx); + case TAO_CodeGen::TAO_MODULE_CDR_OP_CH: case TAO_CodeGen::TAO_MODULE_CDR_OP_CI: case TAO_CodeGen::TAO_MODULE_CDR_OP_CS: @@ -145,6 +150,7 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_INTERFACE_CH: return new be_visitor_interface_ch (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_CI: return new be_visitor_interface_ci (new_ctx); @@ -152,27 +158,38 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx) return new be_visitor_interface_cs (new_ctx); case TAO_CodeGen::TAO_INTERFACE_SH: + case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CH: return new be_visitor_interface_sh (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_IH: return new be_visitor_interface_ih (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_SI: return new be_visitor_interface_si (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_SS: + case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CS: return new be_visitor_interface_ss (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_IS: return new be_visitor_interface_is (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH: + case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_CH: return new be_visitor_interface_thru_poa_collocated_sh (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS: + case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_CS: return new be_visitor_interface_thru_poa_collocated_ss (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH: + case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_DIRECT_COLLOCATED_CH: return new be_visitor_interface_direct_collocated_sh (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: + case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_DIRECT_COLLOCATED_CS: return new be_visitor_interface_direct_collocated_ss (new_ctx); - case TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_CH: - return new be_visitor_interface_collocated_ami_handler_ch (new_ctx); - case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: return new be_visitor_interface_any_op_ch (new_ctx); case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: @@ -189,7 +206,9 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx) return new be_visitor_interface_cdr_op_cs (new_ctx); case TAO_CodeGen::TAO_INTERFACE_FWD_CH: + //case TAO_CodeGen::TAO_AMI_HANDLER_FWD_CH: return new be_visitor_interface_fwd_ch (new_ctx); + case TAO_CodeGen::TAO_INTERFACE_FWD_CI: return new be_visitor_interface_fwd_ci (new_ctx); case TAO_CodeGen::TAO_INTERFACE_FWD_CDR_OP_CI: @@ -455,17 +474,22 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx) // noop. return new be_visitor_decl (new_ctx); + // @@ Michael: With the strategy we can use the default one. case TAO_CodeGen::TAO_AMI_HANDLER_FWD_CH: - return new be_visitor_interface_ami_handler_fwd_ch (new_ctx); + return new be_visitor_interface_ami_handler_fwd_ch (new_ctx); case TAO_CodeGen::TAO_AMI_HANDLER_FWD_CI: return new be_visitor_interface_ami_handler_fwd_ci (new_ctx); + // @@ Michael: We use 1:1 the server servant code, but + // use different operations. +#if 0 case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CH: return new be_visitor_interface_ami_handler_servant_ch (new_ctx); case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CS: return new be_visitor_interface_ami_handler_servant_cs (new_ctx); +#endif /* 0 */ case TAO_CodeGen::TAO_AMI_HANDLER_STUB_CH: return new be_visitor_interface_ami_handler_stub_ch (new_ctx); @@ -476,6 +500,12 @@ TAO_Common_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RESULT_ARG: return new be_visitor_args_ami_handler_result_arg (new_ctx); + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_THRU_POA_COLLOCATED_CH: + return new be_visitor_operation_ami_handler_thru_poa_collocated_ch(new_ctx); + + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_THRU_POA_COLLOCATED_CS: + return new be_visitor_operation_ami_handler_thru_poa_collocated_cs(new_ctx); + default: // an error delete new_ctx; @@ -530,10 +560,6 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx) return new be_visitor_operation_direct_collocated_sh (new_ctx); case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS: return new be_visitor_operation_direct_collocated_ss (new_ctx); - - case TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_OPERATION_CH: - return new be_visitor_operation_ami_handler_operation_ch (new_ctx); - case TAO_CodeGen::TAO_OPERATION_RETTYPE_CH: case TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS: return new be_visitor_operation_rettype (new_ctx); @@ -582,7 +608,6 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_OPERATION_ARG_PRE_INVOKE_CS: case TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS: case TAO_CodeGen::TAO_AMI_OPERATION_ARG_INVOKE_CS: - // @@ Michael case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_INVOKE_CS: case TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS: case TAO_CodeGen::TAO_OPERATION_ARG_PRE_UPCALL_SS: case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS: @@ -609,7 +634,6 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_ARGUMENT_INVOKE_CS: case TAO_CodeGen::TAO_AMI_ARGUMENT_INVOKE_CS: - // @@ Michael case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS: return new be_visitor_args_docall_cs (new_ctx); case TAO_CodeGen::TAO_ARGUMENT_POST_INVOKE_CS: @@ -720,9 +744,6 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS: return new be_visitor_operation_direct_collocated_ss (new_ctx); - case TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_OPERATION_CH: - return new be_visitor_operation_ami_handler_operation_ch (new_ctx); - case TAO_CodeGen::TAO_OPERATION_RETTYPE_CH: case TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS: return new be_visitor_operation_rettype (new_ctx); @@ -784,27 +805,23 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_OPERATION_ARG_POST_MARSHAL_SS: case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS: case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS: + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_CS: return new be_visitor_operation_argument (new_ctx); case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS: case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS: return new be_compiled_visitor_operation_argument_marshal (new_ctx); - case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_MARSHAL_CS: - case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS: - return new be_compiled_visitor_operation_ami_handler_argument_marshal (new_ctx); - - case TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS: - case TAO_CodeGen::TAO_AMI_OPERATION_ARG_INVOKE_CS: - // @@ Michael case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_INVOKE_CS: - return new be_compiled_visitor_operation_argument_invoke (new_ctx); - case TAO_CodeGen::TAO_OPERATION_TIE_SH: return new be_visitor_operation_tie_sh (new_ctx); case TAO_CodeGen::TAO_OPERATION_TIE_SI: return new be_visitor_operation_tie_si (new_ctx); + case TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS: + case TAO_CodeGen::TAO_AMI_OPERATION_ARG_INVOKE_CS: + return new be_compiled_visitor_operation_argument_invoke (new_ctx); + case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_CH: case TAO_CodeGen::TAO_ARGUMENT_ARGLIST_OTHERS: return new be_visitor_args_arglist (new_ctx); @@ -814,7 +831,6 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_ARGUMENT_INVOKE_CS: case TAO_CodeGen::TAO_AMI_ARGUMENT_INVOKE_CS: - // @@ Michael case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS: return new be_visitor_args_compiled_marshal_cs (new_ctx); case TAO_CodeGen::TAO_ARGUMENT_POST_INVOKE_CS: @@ -823,9 +839,6 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: return new be_compiled_visitor_args_vardecl_ss (new_ctx); - case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS: - return new be_compiled_visitor_args_ami_handler_vardecl_cs (new_ctx); - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: // this is a NO-OP return new be_visitor_decl (new_ctx); @@ -834,9 +847,6 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_ARGUMENT_COLLOCATED_UPCALL_SS: return new be_visitor_args_upcall_ss (new_ctx); - case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS: - return new be_visitor_args_ami_handler_upcall_cs (new_ctx); - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: // this is a NO-OP return new be_visitor_decl (new_ctx); @@ -845,10 +855,6 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_ARGUMENT_MARSHAL_SS: return new be_visitor_args_compiled_marshal_ss (new_ctx); - case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_DEMARSHAL_CS: - case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_MARSHAL_CS: - return new be_visitor_args_ami_handler_compiled_marshal_cs (new_ctx); - case TAO_CodeGen::TAO_ARGUMENT_POST_MARSHAL_SS: // this is a NO-OP return new be_visitor_decl (new_ctx); @@ -872,6 +878,17 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_ARGUMENT_AMI_ARGLIST_CS: return new be_visitor_args_ami_arglist (new_ctx); + case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS: + return new be_compiled_visitor_args_ami_handler_vardecl_cs (new_ctx); + + case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS: + case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_COLLOCATED_UPCALL_CS: + return new be_visitor_args_ami_handler_upcall_cs (new_ctx); + + case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_DEMARSHAL_CS: + case TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_MARSHAL_CS: + return new be_visitor_args_ami_handler_compiled_marshal_cs (new_ctx); + case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_OPERATION_CH: case TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CH: return new be_visitor_operation_ami_handler_operation_ch (new_ctx); @@ -879,6 +896,9 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CS: return new be_compiled_visitor_operation_ami_handler_operation_cs (new_ctx); + case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_OPERATION_CS: + return new be_compiled_visitor_operation_ami_handler_servant_operation_cs (new_ctx); + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH: case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CS: return new be_visitor_operation_ami_handler_arglist (new_ctx); @@ -893,6 +913,10 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_AMI_HANDLER_SKELETON_CS: return new be_compiled_visitor_operation_ami_handler_skeleton_cs (new_ctx); + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_MARSHAL_CS: + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS: + return new be_compiled_visitor_operation_ami_handler_argument_marshal (new_ctx); + default: // cannot handle it; delegate it to the common visitor factory delete new_ctx; diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp index 78aa5dbb7e0..21272a2a32b 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp @@ -87,7 +87,7 @@ be_visitor_field_cdr_op_ci::visit_array (be_array *node) } // for anonymous arrays, the type name has a _ prepended. We compute - // the fullname with or without the underscore and use it later on. + // the full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and // save the node's local name and full name in a buffer for quick @@ -105,18 +105,18 @@ be_visitor_field_cdr_op_ci::visit_array (be_array *node) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", node->fullname ()); + ACE_OS::sprintf (fname, "_%s", node->full_name ()); } } else { // typedefed node - ACE_OS::sprintf (fname, "%s", node->fullname ()); + ACE_OS::sprintf (fname, "%s", node->full_name ()); } // check what is the code generation substate. Are we generating @@ -766,7 +766,7 @@ be_visitor_cdr_op_field_decl::visit_array (be_array *node) } // for anonymous arrays, the type name has a _ prepended. We compute - // the fullname with or without the underscore and use it later on. + // the full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and ACE_OS::memset (fname, '\0', NAMEBUFSIZE); @@ -781,18 +781,18 @@ be_visitor_cdr_op_field_decl::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", node->fullname ()); + ACE_OS::sprintf (fname, "_%s", node->full_name ()); } } else { // typedefed node - ACE_OS::sprintf (fname, "%s", node->fullname ()); + ACE_OS::sprintf (fname, "%s", node->full_name ()); } // check what is the code generation substate. Are we generating code for diff --git a/TAO/TAO_IDL/be/be_visitor_interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface.cpp index 1ac9ed473ea..836a757e6e2 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface.cpp @@ -45,10 +45,13 @@ #include "be_visitor_interface/cdr_op_cs.cpp" #include "be_visitor_interface/ami_handler_fwd_ch.cpp" #include "be_visitor_interface/ami_handler_fwd_ci.cpp" -#include "be_visitor_interface/ami_handler_servant_ch.cpp" -#include "be_visitor_interface/ami_handler_servant_cs.cpp" #include "be_visitor_interface/ami_handler_stub_ch.cpp" #include "be_visitor_interface/ami_handler_stub_cs.cpp" + +#if 0 /* We are using normal servant code */ #include "be_visitor_interface/collocated_ami_handler_ch.cpp" +#include "be_visitor_interface/ami_handler_servant_ch.cpp" +#include "be_visitor_interface/ami_handler_servant_cs.cpp" +#endif /* 0 */ ACE_RCSID(be, be_visitor_interface, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_cs.cpp index 62eae6c6da5..dd167168c8c 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_cs.cpp @@ -67,9 +67,9 @@ be_visitor_ ami_handler_cs::visit_interface (be_interface *node) be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); if (parent != 0 && - parent->fullname () != 0 && - ACE_OS::strlen (parent->fullname ())) - scope_len = ACE_OS::strlen (parent->fullname ()) + ACE_OS::strlen ("::"); + parent->full_name () != 0 && + ACE_OS::strlen (parent->full_name ())) + scope_len = ACE_OS::strlen (parent->full_name ()) + ACE_OS::strlen ("::"); ACE_NEW_RETURN (full_name, char [scope_len + @@ -80,11 +80,11 @@ be_visitor_ ami_handler_cs::visit_interface (be_interface *node) -1); if (parent != 0 && - parent->fullname () != 0 && - ACE_OS::strlen (parent->fullname ())) + parent->full_name () != 0 && + ACE_OS::strlen (parent->full_name ())) ACE_OS::sprintf (full_name, "%s::AMI_%s_Handler", - parent->fullname (), + parent->full_name (), node->local_name ()->get_string ()); else ACE_OS::sprintf (full_name, diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ch.cpp index edd92eb656f..30ae6b541b2 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ch.cpp @@ -57,32 +57,15 @@ be_visitor_interface_ami_handler_fwd_ch::visit_interface (be_interface *node) os->indent (); // Generate forward declaration class. - *os << "class " - << "AMI_" << node->local_name () << "_Handler" << ";" + *os << "class " << node->local_name () << ";" << be_nl; - // Create a string "AMI_<interface name>_Handler". We can use - // this for defining all _Var, _out,etc. - char *interface_name = 0; - ACE_NEW_RETURN (interface_name, - char [ACE_OS::strlen ("AMI_") + - ACE_OS::strlen (node->flatname ()) + - ACE_OS::strlen ("_Handler") + - // end of string - 1], - 0); - ACE_OS::sprintf (interface_name, - "AMI_%s_Handler", - node->flatname ()); - // Generate the ifdefined macro for the _ptr type. - os->gen_ifdef_macro (interface_name, "_ptr"); + os->gen_ifdef_macro (node->flat_name (), "_ptr"); // Generate the _ptr declaration - *os << "typedef " - << "AMI_" << node->local_name () << "_Handler" - << " *" - << "AMI_" << node->local_name () << "_Handler" << "_ptr;" + *os << "typedef " << node->local_name () + << " *" << node->local_name () << "_ptr;" << be_nl; // Generate the endif. @@ -91,10 +74,10 @@ be_visitor_interface_ami_handler_fwd_ch::visit_interface (be_interface *node) // Generate the var class. // Enclose under an ifdef macro - os->gen_ifdef_macro (interface_name, "_var"); + os->gen_ifdef_macro (node->local_name (), "_var"); // Generate the _var declaration. - if (node->gen_var_defn (interface_name) == -1) + if (node->gen_var_defn ((char *) node->local_name ()) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_ami_handler_fwd_ch::" @@ -108,11 +91,11 @@ be_visitor_interface_ami_handler_fwd_ch::visit_interface (be_interface *node) // Generate the our class. // Enclose under an ifdef macro. - os->gen_ifdef_macro (interface_name, "_out"); + os->gen_ifdef_macro (node->local_name (), "_out"); // Generate the _out declaration - ORBOS/97-05-15 pg 16-20 // spec. - if (node->gen_out_defn (interface_name) == -1) + if (node->gen_out_defn ( (char *) node->local_name ()) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_ami_handler_fwd_ch::" diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ci.cpp index d4f94f6198a..21402995ebb 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_fwd_ci.cpp @@ -57,91 +57,29 @@ be_visitor_interface_ami_handler_fwd_ci::visit_interface (be_interface *node) os = this->ctx_->stream (); // Start from the current indentation level. - os->indent (); - - // Create the full name and local name for the AMI_<Interface - // name>_Handler interface. - char *full_name = 0; - char *local_name = 0; - - // Full name. - // If there exists a scope name for this, then generate - // "Scope::AMI_<Local Name>_Handler". - - size_t scope_len = 0; - - be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - - if (parent != 0 && - parent->fullname () != 0 && - ACE_OS::strlen (parent->fullname ())) - scope_len = ACE_OS::strlen (parent->fullname ()) + ACE_OS::strlen ("::"); - - ACE_NEW_RETURN (full_name, - char [scope_len + - ACE_OS::strlen ("AMI_") + - ACE_OS::strlen (node->local_name ()->get_string ()) + - ACE_OS::strlen ("_Handler") + - 1], - -1); - - if (parent != 0 && - parent->fullname () != 0 && - ACE_OS::strlen (parent->fullname ())) - ACE_OS::sprintf (full_name, - "%s::AMI_%s_Handler", - parent->fullname (), - node->local_name ()->get_string ()); - else - ACE_OS::sprintf (full_name, - "AMI_%s_Handler", - node->local_name ()->get_string ()); - - // Local name. - - ACE_NEW_RETURN (local_name, - char [ACE_OS::strlen ("AMI_") + - ACE_OS::strlen (node->local_name ()->get_string ()) + - ACE_OS::strlen ("_Handler") + - 1], - -1); - - ACE_OS::sprintf (local_name, - "AMI_%s_Handler", - node->local_name ()->get_string ()); - - // Generate the constructors and destructor. + os->indent (); // start from the current indentation level + // generate the constructors and destructor *os << "ACE_INLINE" << be_nl; - *os << full_name << "::" << local_name - << " (void) // default constructor" << be_nl; + *os << node->full_name () << "::" << node->local_name () << + " (void) // default constructor" << be_nl; *os << "{}" << be_nl << be_nl; *os << "ACE_INLINE" << be_nl; - *os << full_name << "::" << local_name - << " (TAO_Stub *objref, TAO_ServantBase *_tao_servant, " - << "CORBA::Boolean _tao_collocated) // constructor" - << be_nl - << " : CORBA_Object (objref, _tao_servant, _tao_collocated)" - << be_nl - << "{}" << be_nl << be_nl; + *os << node->full_name () << "::" << node->local_name () << + " (TAO_Stub *objref, TAO_ServantBase *_tao_servant, " + << "CORBA::Boolean _tao_collocated) // constructor" << be_nl; + *os << " : CORBA_Object (objref, _tao_servant, _tao_collocated)" << be_nl; + *os << "{}" << be_nl << be_nl; *os << "ACE_INLINE" << be_nl; - *os << full_name << "::~" << local_name - << " (void) // destructor" << be_nl - << "{}\n\n"; - - // _nil method. - *os << "ACE_INLINE " - << full_name << "_ptr" << be_nl - << full_name << "::_nil (void)" << be_nl - << "{" << be_idt_nl - << "return (" << full_name << "_ptr)0;" << be_uidt_nl - << "}" << be_nl << be_nl; - - // Generate the ifdefined macro for the _var type. - os->gen_ifdef_macro (full_name, "_var"); - if (node->gen_var_impl (full_name, local_name) == -1) + *os << node->full_name () << "::~" << node->local_name () << + " (void) // destructor" << be_nl; + *os << "{}\n\n"; + + // generate the ifdefined macro for the _var type + os->gen_ifdef_macro (node->flat_name (), "_var"); + if (node->gen_var_impl () == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_ci::" @@ -150,10 +88,9 @@ be_visitor_interface_ami_handler_fwd_ci::visit_interface (be_interface *node) } os->gen_endif (); - // Generate the ifdefined macro for the _out type. - os->gen_ifdef_macro (full_name, "_out"); - if (node->gen_out_impl (full_name, - local_name) == -1) + // generate the ifdefined macro for the _out type + os->gen_ifdef_macro (node->flat_name (), "_out"); + if (node->gen_out_impl () == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_interface_ci::" @@ -162,5 +99,6 @@ be_visitor_interface_ami_handler_fwd_ci::visit_interface (be_interface *node) } os->gen_endif (); + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_ch.cpp index 4b378825cff..7e49ffaaa6a 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_ch.cpp @@ -45,6 +45,9 @@ be_visitor_interface_ami_handler_servant_ch::~be_visitor_interface_ami_handler_s int be_visitor_interface_ami_handler_servant_ch::visit_interface (be_interface *node) { + be_interface_type_strategy *old_strategy = + node->set_strategy (new be_interface_ami_handler_strategy (node)); + // Output stream. TAO_OutStream *os; @@ -72,20 +75,20 @@ be_visitor_interface_ami_handler_servant_ch::visit_interface (be_interface *node { // we are outermost ACE_OS::sprintf (namebuf, - "POA_AMI_%s_Handler", - node->local_name ()->get_string ()); + "POA_%s", + node->local_name ()); } else { ACE_OS::sprintf (namebuf, - "AMI_%s_Handler", - node->local_name ()->get_string ()); + "%s", + node->local_name ()); } // AMI Handler object's name. ACE_OS::sprintf (ami_handler, - "AMI_%s_Handler", - node->local_name ()->get_string ()); + "%s", + node->local_name ()); *os << "class " << namebuf << ";" << be_nl; @@ -164,7 +167,7 @@ be_visitor_interface_ami_handler_servant_ch::visit_interface (be_interface *node << ");\n" << be_uidt_nl; // Print out the _this() method. - *os << ami_handler << " *_this (" << be_idt << be_idt_nl + *os << node->local_name () << " *_this (" << be_idt << be_idt_nl << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl << "TAO_default_environment ()" << be_uidt << be_uidt_nl @@ -202,20 +205,42 @@ be_visitor_interface_ami_handler_servant_ch::visit_interface (be_interface *node *os << be_uidt_nl << "};\n\n"; - // Generate the collocated class be_visitor_context ctx (*this->ctx_); - ctx.state (TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_CH); - be_visitor *visitor = tao_cg->make_visitor (&ctx); - if (!visitor || (node->accept (visitor) == -1)) + be_visitor *visitor = 0; + + // generate the collocated class + if (idl_global->gen_thru_poa_collocation ()) { - delete visitor; - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_ami_handler_servant_ch::" - "visit_interface - " - "codegen for collocated class failed\n"), - -1); + ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface_ami_handler_servant_ch::" + "visit_interface - " + "codegen for thru_poa_collocated class failed\n"), + -1); + } + } + + if (idl_global->gen_direct_collocation ()) + { + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface_ami_handler_servant_ch::" + "visit_interface - " + "codegen for direct_collocated class failed\n"), + -1); + } } + #if 0 // @@ Do this (Alex). // generate the TIE class. @@ -239,5 +264,7 @@ be_visitor_interface_ami_handler_servant_ch::visit_interface (be_interface *node ctx.stream (tao_cg->server_template_header ()); #endif /* 0 */ + delete node->set_strategy (old_strategy); + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_cs.cpp index 6c3be5f1597..e0e82be331a 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_servant_cs.cpp @@ -12,6 +12,7 @@ // // = DESCRIPTION // Visitor generating code for Interfaces in the server skeletons file. +// !!!!!!!!!!!!!!! NOT USED ANY MORE !!!!!!!!!!!!!!!!!!!! // // = AUTHOR // Aniruddha Gokhale @@ -43,18 +44,18 @@ be_visitor_interface_ami_handler_servant_cs::~be_visitor_interface_ami_handler_s int be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node) { - TAO_OutStream *os; // output stream + be_interface_type_strategy *old_strategy = + node->set_strategy (new be_interface_ami_handler_strategy (node)); + + TAO_OutStream *os = this->ctx_->stream (); // output stream if (node->srv_skel_gen () || node->imported ()) return 0; - os = this->ctx_->stream (); - // generate the skeleton class name os->indent (); // start with whatever indentation level we are at - /* @@ Michael if (node->gen_operation_table () == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -64,25 +65,23 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node -1); } - */ // constructor *os << "// skeleton constructor" << be_nl; // find if we are at the top scope or inside some module if (!node->is_nested ()) { // we are outermost. So the POA_ prefix is prepended to our name - *os << node->ami_handler_full_skel_name () << "::POA_" << node->ami_handler_local_name () << + *os << node->full_skel_name () << "::POA_" << node->local_name () << " (void)" << be_nl; } else { // the POA_ prefix is prepended to our outermost module name - *os << node->ami_handler_full_skel_name () << "::" << node->ami_handler_local_name () << + *os << node->full_skel_name () << "::" << node->local_name () << " (void)" << be_nl; } - *os << "{" << be_idt_nl - << "this->optable_ = &tao_" << node->flatname () + << "this->optable_ = &tao_" << node->flat_name () << "_optable;" << be_uidt_nl << "}\n\n"; @@ -91,19 +90,18 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node if (!node->is_nested ()) { // we are outermost. So the POA_ prefix is prepended to our name - *os << node->ami_handler_full_skel_name () << "::POA_" - << node->ami_handler_local_name () << " (" - << "const POA_" << node->ami_handler_local_name () << "& rhs)"; + *os << node->full_skel_name () << "::POA_" + << node->local_name () << " (" + << "const POA_" << node->local_name () << "& rhs)"; } else { // the POA_ prefix is prepended to our outermost module name - *os << node->ami_handler_full_skel_name () << "::" - << node->ami_handler_local_name () << " (const " - << node->ami_handler_local_name () << "& rhs)"; + *os << node->full_skel_name () << "::" + << node->local_name () << " (const " + << node->local_name () << "& rhs)"; } - *os << be_idt_nl - << ": "; + *os << be_idt_nl << ": "; if (node->traverse_inheritance_graph (be_interface::copy_ctor_helper, os) == -1) ACE_ERROR_RETURN ((LM_ERROR, @@ -111,20 +109,18 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node " copy ctor generation failed\n"), -1); *os << " TAO_ServantBase (rhs)" << be_uidt_nl << "{}\n" << be_nl; - *os << "// skeleton destructor" << be_nl; - if (!node->is_nested ()) { // we are outermost. So the POA_ prefix is prepended to our name - *os << node->ami_handler_full_skel_name () << "::~POA_" << node->ami_handler_local_name () << - " (void)" << be_nl; + *os << node->full_skel_name () << "::~POA_" << node->local_name () + << " (void)" << be_nl; } else { // the POA_ prefix is prepended to our outermost module name - *os << node->ami_handler_full_skel_name () << "::~" << node->ami_handler_local_name () << - " (void)" << be_nl; + *os << node->full_skel_name () << "::~" << node->local_name () + << " (void)" << be_nl; } *os << "{\n"; *os << "}\n\n"; @@ -145,7 +141,7 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node // generate code for the _is_a skeleton os->indent (); - *os << "void " << node->ami_handler_full_skel_name () + *os << "void " << node->full_skel_name () << "::_is_a_skel (" << be_idt << be_idt_nl << "CORBA::ServerRequest &_tao_server_request, " << be_nl << "void * _tao_object_reference," << be_nl @@ -154,8 +150,8 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node << ")" << be_uidt_nl; *os << "{" << be_idt_nl; *os << "TAO_InputCDR &_tao_in = _tao_server_request.incoming ();" << be_nl; - *os << node->ami_handler_full_skel_name () << " *_tao_impl = (" - << node->ami_handler_full_skel_name () << " *) _tao_object_reference;" << be_nl; + *os << node->full_skel_name () << " *_tao_impl = (" + << node->full_skel_name () << " *) _tao_object_reference;" << be_nl; *os << "CORBA::Boolean _tao_retval = 0;" << be_nl; *os << "CORBA::String_var value;" << be_nl; *os << "if (!((_tao_in >> value.out ())))" << be_idt_nl; @@ -172,7 +168,7 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node // generate code for the _non_existent skeleton os->indent (); - *os << "void " << node->ami_handler_full_skel_name () + *os << "void " << node->full_skel_name () << "::_non_existent_skel (" << be_idt << be_idt_nl << "CORBA::ServerRequest &_tao_server_request, " << be_nl << "void * _tao_object_reference," << be_nl @@ -180,8 +176,8 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl << ")" << be_uidt_nl; *os << "{" << be_idt_nl; - *os << node->ami_handler_full_skel_name () << " *_tao_impl = (" - << node->ami_handler_full_skel_name () << " *) _tao_object_reference;" << be_nl; + *os << node->full_skel_name () << " *_tao_impl = (" + << node->full_skel_name () << " *) _tao_object_reference;" << be_nl; *os << "CORBA::Boolean _tao_retval = _tao_impl->_non_existent (ACE_TRY_ENV);" << be_nl; *os << "ACE_CHECK;" << be_nl << be_nl; *os << "_tao_server_request.init_reply (ACE_TRY_ENV);" << be_nl; @@ -193,7 +189,7 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node os->indent (); - *os << "CORBA::Boolean " << node->ami_handler_full_skel_name () + *os << "CORBA::Boolean " << node->full_skel_name () << "::_is_a (" << be_idt << be_idt_nl << "const char* value," << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl @@ -208,7 +204,6 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node "traversal of inhertance graph failed\n"), -1); } - os->indent (); *os << "(!ACE_OS::strcmp ((char *)value, " << "CORBA::_tc_Object->id (ACE_TRY_ENV))))" @@ -217,14 +212,14 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node << "return 0;" << be_uidt << be_uidt << be_uidt_nl << "}\n\n"; + // the downcast method. os->indent (); - *os << "void* " << node->ami_handler_full_skel_name () + *os << "void* " << node->full_skel_name () << "::_downcast (" << be_idt << be_idt_nl << "const char* logical_type_id" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl; - if (node->traverse_inheritance_graph (be_interface::downcast_helper, os) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -233,19 +228,17 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node "traversal of inhertance graph failed\n"), -1); } - *os << "if (ACE_OS::strcmp (logical_type_id, " << "\"IDL:omg.org/CORBA/Object:1.0\") == 0)" << be_idt_nl << "return ACE_static_cast(PortableServer::Servant, this);" << be_uidt_nl; - *os << "return 0;" << be_uidt_nl << "}\n\n"; // now the dispatch method os->indent (); - *os << "void " << node->ami_handler_full_skel_name () << + *os << "void " << node->full_skel_name () << "::_dispatch (CORBA::ServerRequest &req, " << "void *context, CORBA::Environment &ACE_TRY_ENV)" << be_nl; *os << "{\n"; @@ -265,83 +258,113 @@ be_visitor_interface_ami_handler_servant_cs::visit_interface (be_interface *node *os << "else" << be_idt_nl; *os << "skel (req, this, context, ACE_TRY_ENV);" << be_uidt << be_uidt_nl; *os << "}\n\n"; - os->indent (); - *os << "const char* " << node->ami_handler_full_skel_name () + *os << "const char* " << node->full_skel_name () << "::_interface_repository_id (void) const" << be_nl; *os << "{\n"; os->incr_indent (); *os << "return \"" << node->repoID () << "\";\n"; os->decr_indent (); - *os << "}\n\n"; - - *os << "\n"; + *os << "}\n\n\n"; // the _this () operation - *os << node->name () << "*" << be_nl - << node->ami_handler_full_skel_name () + + *os << node->full_name () << "*" << be_nl + << node->full_skel_name () << "::_this (CORBA_Environment &ACE_TRY_ENV)" << be_nl << "{" << be_idt_nl << "TAO_Stub *stub = this->_create_stub (ACE_TRY_ENV);" << be_nl - << "ACE_CHECK_RETURN (0);" << be_nl - // << "if (ACE_TRY_ENV.exception () != 0)" << be_idt_nl - // << "return 0;" << be_uidt_nl - - // @@ Michael: We need to check this value being passed. I am - // passing 1 right now. (Alex). - << "return new " << node->full_coll_name (1) - << " (this, stub);" << be_uidt_nl; - - *os << "}\n\n"; + << "ACE_CHECK_RETURN (0);" << be_nl + << "return new " ; + if (idl_global->gen_direct_collocation ()) + *os << node->full_coll_name (be_interface::DIRECT); + else if (idl_global->gen_thru_poa_collocation ()) + *os << node->full_coll_name (be_interface::THRU_POA); + *os << " (this, stub);" << be_uidt_nl + << "}\n\n"; // the _create_collocated_objref method *os << "void*" << be_nl - << node->ami_handler_full_skel_name () + << node->full_skel_name () << "::_create_collocated_objref (const char* repository_id, " << "CORBA::ULong type, TAO_Stub *stub)" << be_nl << "{" << be_idt_nl << "if (!ACE_OS::strcmp (\"" << node->repoID () << "\", repository_id))" << be_idt_nl << "return ACE_static_cast (" << be_idt << be_idt_nl - << node->name () << "_ptr," << be_nl + // @@ Michael: I changed the following line from node->name + // to "node->local_name". This might be wrong, but right + // now I think it is right .. + << node->local_name () << "_ptr," << be_nl + << "new "; - // @@ Michael: We need to check this value being passed. I am - // passing 1 right now. (Alex). - << "new " << node->full_coll_name (1) - << " (this, stub)" << be_uidt_nl + if (idl_global->gen_direct_collocation ()) + *os << node->full_coll_name (be_interface::DIRECT); + else if (idl_global->gen_thru_poa_collocation ()) + *os << node->full_coll_name (be_interface::THRU_POA); + + *os << " (this, stub)" << be_uidt_nl << ");" << be_uidt << be_uidt_nl << "return 0;" << be_uidt_nl << "}" << be_nl << be_nl; - // @@ Michael - /* + + // generate the collocated class impl - be_visitor_context ctx (*this->ctx_); - ctx.state (TAO_CodeGen::TAO_INTERFACE_COLLOCATED_SS); - be_visitor *visitor = tao_cg->make_visitor (&ctx); - if (!visitor) + if (idl_global->gen_thru_poa_collocation ()) { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_ami_handler_servant_cs::" - "visit_interface - " - "Bad visitor for collocated class\n"), - -1); + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_CS); + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface::" + "ami_handler_servant_cs- " + "Bad visitor for thru_poa collocated class\n"), + -1); + } + + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface::" + "ami_handler_servant_cs - " + "codegen for thru_poa collocated class failed\n"), + -1); + } + delete visitor; } - if (node->accept (visitor) == -1) + if (idl_global->gen_direct_collocation ()) { - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_interface_ami_handler_servant_cs::" - "visit_interface - " - "codegen for collocated class failed\n"), - -1); + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_DIRECT_COLLOCATED_CS); + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface::" + "ami_handler_servant_cs - " + "Bad visitor for direct collocated class\n"), + -1); + } + + if (node->accept (visitor) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_interface::" + "ami_handler_servant_cs - " + "codegen for direct collocated class failed\n"), + -1); + } + delete visitor; } - delete visitor; *os << "\n\n"; - */ + delete node->set_strategy (old_strategy); return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_ch.cpp index f9e6bb9cc80..e0891ba4317 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_ch.cpp @@ -53,40 +53,14 @@ be_visitor_interface_ami_handler_stub_ch::visit_interface (be_interface *node) // Ifdef guard. - // Generate AMI_...name..._Handler string. - char *ifdef_string = 0; - ACE_NEW_RETURN (ifdef_string, - char [ACE_OS::strlen ("AMI_") + - ACE_OS::strlen (node->flatname ()) + - ACE_OS::strlen ("_Handler") + - // end of string - 1], - 0); - ACE_OS::sprintf (ifdef_string, - "AMI_%s_Handler", - node->flatname ()); - - os->gen_ifdef_macro (ifdef_string); - - // Prepare the local name for the class. - char *local_name = 0; - ACE_NEW_RETURN (local_name, - char [ACE_OS::strlen ("AMI_") + - ACE_OS::strlen (node->local_name ()->get_string ()) + - ACE_OS::strlen ("_Handler") + - // end of string - 1], - 0); - ACE_OS::sprintf (local_name, - "AMI_%s_Handler", - node->local_name ()->get_string ()); + os->gen_ifdef_macro (node->flat_name ()); // Now generate the class definition. os->indent (); *os << "class " << idl_global->stub_export_macro () << " " - << local_name; + << node->local_name (); // Node interface inherits from the Messaging::ReplyHandler // interface. @@ -101,29 +75,33 @@ be_visitor_interface_ami_handler_stub_ch::visit_interface (be_interface *node) // but we must protect against certain versions of g++ << "#if !defined(__GNUC__) || !defined (ACE_HAS_GNUG_PRE_2_8)" << be_idt_nl - << "typedef " << local_name << "_ptr _ptr_type;" << be_nl - << "typedef " << local_name << "_var _var_type;" << be_uidt_nl - << "#endif /* ! __GNUC__ || g++ >= 2.8 */\n" << be_idt_nl + << "typedef " << node->local_name () << "_ptr _ptr_type;" << be_nl + << "typedef " << node->local_name () << "_var _var_type;" << be_uidt_nl + << "#endif /* __GNUC__ */\n" << be_idt_nl // generate the static _duplicate, _narrow, and _nil operations << "// the static operations" << be_nl - << "static " << local_name << "_ptr " << "_duplicate (" - << local_name << "_ptr obj);" << be_nl - << "static " << local_name << "_ptr " + << "static " << node->local_name () << "_ptr " << "_duplicate (" + << node->local_name () << "_ptr obj);" << be_nl + << "static " << node->local_name () << "_ptr " << "_narrow (" << be_idt << be_idt_nl << "CORBA::Object_ptr obj," << be_nl << "CORBA::Environment &env = " << be_idt_nl << "TAO_default_environment ()" << be_uidt << be_uidt_nl << ");" << be_uidt_nl - << "static " << local_name << "_ptr " + << "static " << node->local_name () << "_ptr " << "_unchecked_narrow (" << be_idt << be_idt_nl << "CORBA::Object_ptr obj," << be_nl << "CORBA::Environment &env = " << be_idt_nl << "TAO_default_environment ()" << be_uidt << be_uidt_nl << ");" << be_uidt_nl - << "static " << local_name << "_ptr " << "_nil (void);\n\n"; + << "static " << node->local_name () + << "_ptr _nil (void)" << be_nl + << "{" << be_idt_nl + << "return (" << node->local_name () << "_ptr)0;" << be_uidt_nl + << "}\n\n"; // Visit the scope to generate the stubs for the call back // methods. @@ -151,21 +129,21 @@ be_visitor_interface_ami_handler_stub_ch::visit_interface (be_interface *node) // generate the "protected" constructor so that users cannot instantiate // us *os << "protected:" << be_idt_nl - << local_name << " (void);" << be_nl - << local_name + << node->local_name () << " (void);" << be_nl + << node->local_name () << " (TAO_Stub *objref, " << be_idt << be_idt_nl << "TAO_ServantBase *_tao_servant = 0, " << be_nl << "CORBA::Boolean _tao_collocated = 0" << be_uidt_nl << ");" << be_uidt_nl - << "virtual ~" << local_name << " (void);" << be_uidt_nl; + << "virtual ~" << node->local_name () << " (void);" << be_uidt_nl; // private copy constructor and assignment operator. These are not // allowed, hence they are private. *os << "private:\n"; os->incr_indent (); - *os << local_name << " (const " << local_name << " &);" + *os << node->local_name () << " (const " << node->local_name () << " &);" << be_nl - << "void operator= (const " << local_name << " &);\n"; + << "void operator= (const " << node->local_name () << " &);\n"; os->decr_indent (); *os << "};\n\n"; @@ -186,13 +164,6 @@ be_visitor_interface_ami_handler_stub_ch::visit_interface (be_interface *node) "TypeCode declaration failed\n"), -1); } - - - // Delete the heap allocated vars. - delete ifdef_string; - ifdef_string = 0; - delete local_name; - local_name = 0; } return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp index e75034bd185..d0918b18262 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/ami_handler_stub_cs.cpp @@ -43,6 +43,9 @@ be_visitor_interface_ami_handler_stub_cs::~be_visitor_interface_ami_handler_stub int be_visitor_interface_ami_handler_stub_cs::visit_interface (be_interface *node) { + be_interface_type_strategy *old_strategy = + node->set_strategy (new be_interface_ami_handler_strategy (node)); + // output stream. TAO_OutStream *os; @@ -67,29 +70,27 @@ be_visitor_interface_ami_handler_stub_cs::visit_interface (be_interface *node) be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); if (parent != 0 && - parent->fullname () != 0 && - ACE_OS::strlen (parent->fullname ())) - scope_len = ACE_OS::strlen (parent->fullname ()) + ACE_OS::strlen ("::"); + parent->full_name () != 0 && + ACE_OS::strlen (parent->full_name ())) + scope_len = ACE_OS::strlen (parent->full_name ()) + ACE_OS::strlen ("::"); ACE_NEW_RETURN (full_name, char [scope_len + - ACE_OS::strlen ("AMI_") + - ACE_OS::strlen (node->local_name ()->get_string ()) + - ACE_OS::strlen ("_Handler") + + ACE_OS::strlen (node->local_name ()) + 1], -1); if (parent != 0 && - parent->fullname () != 0 && - ACE_OS::strlen (parent->fullname ())) + parent->full_name () != 0 && + ACE_OS::strlen (parent->full_name ())) ACE_OS::sprintf (full_name, - "%s::AMI_%s_Handler", - parent->fullname (), - node->local_name ()->get_string ()); + "%s::%s", + parent->full_name (), + node->local_name ()); else ACE_OS::sprintf (full_name, - "AMI_%s_Handler", - node->local_name ()->get_string ()); + "%s", + node->local_name ()); // First generate the code for the static methods. @@ -103,7 +104,7 @@ be_visitor_interface_ami_handler_stub_cs::visit_interface (be_interface *node) << "if (CORBA::is_nil (obj))" << be_idt_nl << "return " << full_name << "::_nil ();" << be_uidt_nl << "if (!obj->_is_a (\"" - << node->compute_repoID ("AMI_", "_Handler") << "\", env))" + << node->repoID () << "\", env))" << be_idt_nl << "return " << full_name << "::_nil ();" << be_uidt_nl; @@ -114,48 +115,28 @@ be_visitor_interface_ami_handler_stub_cs::visit_interface (be_interface *node) // This may be necessary to work around a GCC compiler bug! // const char *skel_name = node->full_skel_name (); // unused at this time - // @@ Michael: We need to check this value being passed. I am - // passing 1 right now. (Alex). - const char *coll_name = node->full_coll_name (1); - assert (coll_name != 0); - + // the following full_name usage was node->name // The _unchecked_narrow method *os << full_name << "_ptr " << full_name << "::_unchecked_narrow (" << be_idt << be_idt_nl << "CORBA::Object_ptr obj," << be_nl - << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl + << "CORBA::Environment &" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl - << "ACE_UNUSED_ARG (ACE_TRY_ENV);" << be_nl << "if (CORBA::is_nil (obj))" << be_idt_nl << "return " << full_name << "::_nil ();" << be_uidt_nl; *os << "TAO_Stub* stub = obj->_stubobj ();" << be_nl << "stub->_incr_refcnt ();" << be_nl; - *os << "void* servant = 0;" << be_nl; - *os << "if (obj->_is_collocated () " - << "&& obj->_servant() != 0)" << be_idt_nl - << "servant = obj->_servant()->_downcast (\"" - << "IDL:omg.org/CORBA/Object:1.0\");" << be_uidt_nl; - - *os << "if (servant != 0)" << be_idt_nl << "{" << be_idt_nl - // The collocated object reference factory is not working right (yet) - << full_name << "_ptr retv = ACE_reinterpret_cast (" << be_idt << be_idt_nl - << full_name << "_ptr," << be_nl - << "ACE_reinterpret_cast (" << be_idt << be_idt_nl - << "PortableServer::Servant," << be_nl - << "servant" << be_uidt_nl - << ")" << be_uidt_nl - << "->_create_collocated_objref (" << be_idt << be_idt_nl - << "\"" << node->compute_repoID ("AMI_", "_Handler") << "\"," << be_nl - << "TAO_ORB_Core::ORB_CONTROL," << be_nl - << "stub" << be_uidt_nl - << ")" << be_uidt << be_uidt_nl - << ");" << be_uidt_nl + + *os << "if (obj->_is_collocated () && _TAO_collocation_" << node->flat_name () + << "_Stub_Factory_function_pointer != 0)" << be_idt_nl + << "{" << be_idt_nl + << node->local_name () << "_ptr retv = _TAO_collocation_" + << node->flat_name () + << "_Stub_Factory_function_pointer (obj);" << be_nl << "if (retv != 0)" << be_idt_nl - << "return retv;" << be_uidt - // So we are still using the old way to create collocated objref. - << be_uidt_nl + << "return retv;" << be_uidt << be_uidt_nl << "}" << be_uidt_nl; *os << "return new " << full_name << "(stub);" << be_uidt_nl @@ -194,7 +175,7 @@ be_visitor_interface_ami_handler_stub_cs::visit_interface (be_interface *node) // Current interface. *os << "(!ACE_OS::strcmp ((char *)value, " << "\"" - << node->compute_repoID ("AMI_", "_Handler") + << node->repoID () << "\"" << ")) ||" << be_nl; @@ -223,7 +204,7 @@ be_visitor_interface_ami_handler_stub_cs::visit_interface (be_interface *node) << "::_interface_repository_id (void) const" << be_nl << "{" << be_idt_nl - << "return \"" << node->compute_repoID ("AMI_", "_Handler") << "\";" << be_uidt_nl + << "return \"" << node->repoID () << "\";" << be_uidt_nl << "}\n\n"; // By using a visitor to declare and define the TypeCode, we have the @@ -246,5 +227,7 @@ be_visitor_interface_ami_handler_stub_cs::visit_interface (be_interface *node) delete full_name; full_name = 0; + delete node->set_strategy (old_strategy); + return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp index 637cea63343..95a34d1c4a9 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_ch.cpp @@ -53,12 +53,30 @@ be_visitor_interface_any_op_ch::visit_interface (be_interface *node) os->indent (); // Generate the stub factory function pointer declaration - *os << "extern " << idl_global->stub_export_macro () << " " << node->name () - << "_ptr (*_TAO_collocation_" << node->flatname () - << "_Stub_Factory_function_pointer) (" << be_idt << be_idt_nl + *os << "extern " << idl_global->stub_export_macro () << " " + << node->full_name () << "_ptr (*_TAO_collocation_" + << node->flat_name () << "_Stub_Factory_function_pointer) (" + << be_idt << be_idt_nl << "CORBA::Object_ptr obj" << be_uidt_nl << ");" << be_uidt_nl; + // @@ Michael: This might not be the right place .. + if (idl_global->ami_call_back () == I_TRUE) + { + // AMI Handler stuff + be_interface_type_strategy *old_strategy = + node->set_strategy (new be_interface_ami_handler_strategy (node)); + + // Generate the stub factory function pointer declaration + *os << "extern " << node->full_name () << "_ptr (*_TAO_collocation_" + << node->flat_name () << "_Stub_Factory_function_pointer) (" + << be_idt << be_idt_nl + << "CORBA::Object_ptr obj" << be_uidt_nl + << ");" << be_uidt_nl; + + delete node->set_strategy (old_strategy); + } + // generate the Any <<= and >>= operator declarations os->indent (); *os << "// Any operators for interface " << node->name () << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp index f3c758081c7..705f8a9c3a0 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/any_op_cs.cpp @@ -53,26 +53,45 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node) os->indent (); // Generate the stub factory function pointer definition. - *os << node->name () << "_ptr (*"; + *os << node->full_name () << "_ptr (*"; *os << "_TAO_collocation_" - << node->flatname () << "_Stub_Factory_function_pointer) (" + << node->flat_name () << "_Stub_Factory_function_pointer) (" << be_idt << be_idt_nl << "CORBA::Object_ptr obj" << be_uidt_nl << ") = 0;" << be_uidt_nl; + // @@ Michael: This might not be the right place .. + if (idl_global->ami_call_back () == I_TRUE) + { + // AMI Handler stuff + be_interface_type_strategy *old_strategy = + node->set_strategy (new be_interface_ami_handler_strategy (node)); + + os->indent (); + // Generate the stub factory function pointer definition. + *os << node->full_name () << "_ptr (*"; + + *os << "_TAO_collocation_" + << node->flat_name () << "_Stub_Factory_function_pointer) (" + << be_idt << be_idt_nl + << "CORBA::Object_ptr obj" << be_uidt_nl + << ") = 0;" << be_uidt_nl; + + delete node->set_strategy (old_strategy); + } // generate the Any <<= and >>= operator declarations // Any <<= and >>= operators os->indent (); *os << "void operator<<= (CORBA::Any &_tao_any, " - << node->name () << "_ptr _tao_elem)" << be_nl + << node->full_name () << "_ptr _tao_elem)" << be_nl << "{" << be_idt_nl << "CORBA::Object_ptr *_tao_obj_ptr = 0;" << be_nl << "ACE_TRY_NEW_ENV" << be_nl << "{" << be_idt_nl << "ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr);" << be_nl - << "*_tao_obj_ptr = " << node->name () + << "*_tao_obj_ptr = " << node->full_name () << "::_duplicate (_tao_elem);" << be_nl << "_tao_any.replace (" << node->tc_name () << ", " << "_tao_obj_ptr, 1, ACE_TRY_ENV);" << be_nl @@ -86,12 +105,12 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node) << "}\n" << be_nl; *os << "CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, " - << node->name () << "_ptr &_tao_elem)" << be_nl + << node->full_name () << "_ptr &_tao_elem)" << be_nl << "{" << be_idt_nl << "CORBA::Object_ptr *tmp = 0;" << be_nl << "ACE_TRY_NEW_ENV" << be_nl << "{" << be_idt_nl - << "_tao_elem = " << node->name () << "::_nil ();" << be_nl + << "_tao_elem = " << node->full_name () << "::_nil ();" << be_nl << "CORBA::TypeCode_var type = _tao_any.type ();" << be_nl << "if (!type->equal (" << node->tc_name () << ", ACE_TRY_ENV)) return 0; // not equal" << be_nl @@ -104,7 +123,7 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node) << ", &_tao_obj_var.out (), 0, ACE_TRY_ENV)" << be_nl << " == CORBA::TypeCode::TRAVERSE_CONTINUE)" << be_nl << "{" << be_idt_nl - << "_tao_elem = " << node->name () + << "_tao_elem = " << node->full_name () << "::_narrow (_tao_obj_var.in (), ACE_TRY_ENV);" << be_nl << "ACE_TRY_CHECK;" << be_nl << "*tmp = (CORBA::Object_ptr) _tao_elem; // any owns the object" @@ -127,18 +146,18 @@ be_visitor_interface_any_op_cs::visit_interface (be_interface *node) *os << "#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)" << be_idt_nl << "template class TAO_Object_Field_T<" - << node->name () << "," - << node->name () << "_var>;" << be_uidt_nl + << node->full_name () << "," + << node->full_name () << "_var>;" << be_uidt_nl << "template class TAO_Object_Manager<" - << node->name () << "," - << node->name () << "_var>;" << be_uidt_nl + << node->full_name () << "," + << node->full_name () << "_var>;" << be_uidt_nl << "#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)" << be_nl << "# pragma instantiate TAO_Object_Field_T<" - << node->name () << "," - << node->name () << "_var>" << be_uidt_nl + << node->full_name () << "," + << node->full_name () << "_var>" << be_uidt_nl << "# pragma instantiate TAO_Object_Manager<" - << node->name () << "," - << node->name () << "_var>" << be_uidt_nl + << node->full_name () << "," + << node->full_name () << "_var>" << be_uidt_nl << "#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */\n\n"; // all we have to do is to visit the scope and generate code diff --git a/TAO/TAO_IDL/be/be_visitor_interface/collocated_ami_handler_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/collocated_ami_handler_ch.cpp index 301472a8a1c..e83b4c52290 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/collocated_ami_handler_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/collocated_ami_handler_ch.cpp @@ -47,44 +47,19 @@ be_visitor_interface_collocated_ami_handler_ch::visit_interface (be_interface *n { TAO_OutStream *os = this->ctx_->stream (); - // Generate AMI_...name..._Handler string. - char *ifdef_string = 0; - ACE_NEW_RETURN (ifdef_string, - char [ACE_OS::strlen ("AMI_") + - ACE_OS::strlen (node->flatname ()) + - ACE_OS::strlen ("_Handler") + - // end of string - 1], - 0); - ACE_OS::sprintf (ifdef_string, - "AMI_%s_Handler", - node->flatname ()); - - os->gen_ifdef_macro (ifdef_string, "_collocated"); - - // Prepare the local name for the class. - char *local_name = 0; - ACE_NEW_RETURN (local_name, - char [ACE_OS::strlen ("AMI_") + - ACE_OS::strlen (node->local_name ()->get_string ()) + - ACE_OS::strlen ("_Handler") + - // end of string - 1], - 0); - ACE_OS::sprintf (local_name, - "AMI_%s_Handler", - node->local_name ()->get_string ()); - - // Get the coll names. - char *coll_local_name, *coll_full_name; - node->compute_coll_names (local_name, coll_local_name, coll_full_name); + os->gen_ifdef_macro (node->flat_name (), "_collocated"); // Output the class defn. os->indent (); - *os << "class " << idl_global->stub_export_macro () - << " " << coll_local_name; + *os << "class " << idl_global->stub_export_macro () << " "; + + if (idl_global->gen_direct_collocation ()) + *os << node->local_coll_name (be_interface::DIRECT); + else if (idl_global->gen_thru_poa_collocation ()) + *os << node->local_coll_name (be_interface::THRU_POA); + os->incr_indent (); - *os << " : public virtual " << local_name; + *os << " : public virtual " << node->local_name (); *os << "\n"; os->decr_indent (); @@ -92,7 +67,11 @@ be_visitor_interface_collocated_ami_handler_ch::visit_interface (be_interface *n *os << "public:\n"; os->incr_indent (); - *os << coll_local_name << " (\n"; + if (idl_global->gen_direct_collocation ()) + *os << node->local_coll_name (be_interface::DIRECT) << " (\n"; + else if (idl_global->gen_thru_poa_collocation ()) + *os << node->local_coll_name (be_interface::THRU_POA) << " (\n"; + os->incr_indent (0); os->incr_indent (); @@ -105,7 +84,7 @@ be_visitor_interface_collocated_ami_handler_ch::visit_interface (be_interface *n *os << "POA_"; } - *os << local_name << "_ptr " + *os << node->local_name () << "_ptr " << " servant," << be_nl; *os << "TAO_Stub *stub\n"; @@ -131,7 +110,7 @@ be_visitor_interface_collocated_ami_handler_ch::visit_interface (be_interface *n *os << "POA_"; } - *os << local_name + *os << node->local_name () << "_ptr _get_servant (void) const;" << be_nl << be_nl; // _non_existent method. @@ -160,15 +139,11 @@ be_visitor_interface_collocated_ami_handler_ch::visit_interface (be_interface *n // POA_ prefix that goes with it. *os << "POA_"; } - *os << local_name << "_ptr servant_;\n"; + *os << node->local_name () << "_ptr servant_;\n"; os->decr_indent (); *os << "};\n\n"; os->gen_endif (); - delete ifdef_string; - delete local_name; - delete coll_local_name; - delete coll_full_name; return 0; } diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp index 6f23f294d9b..970dae75a0e 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_sh.cpp @@ -46,7 +46,7 @@ int be_visitor_interface_direct_collocated_sh::visit_interface (be_interface *no { TAO_OutStream *os = this->ctx_->stream (); - os->gen_ifdef_macro (node->flatname (), "_direct_collocated"); + os->gen_ifdef_macro (node->flat_name (), "_direct_collocated"); // output the class defn os->indent (); diff --git a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp index 46e690ae815..153e94e3dd6 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/direct_collocated_ss.cpp @@ -44,10 +44,11 @@ be_visitor_interface_direct_collocated_ss::~be_visitor_interface_direct_collocat int be_visitor_interface_direct_collocated_ss::visit_interface (be_interface *node) { - TAO_OutStream *os = tao_cg->server_skeletons (); + TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); + os->indent (); *os << node->full_coll_name (be_interface::DIRECT) << "::" << node->local_coll_name (be_interface::DIRECT) << " (\n"; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp index b9b7d3ba804..f73d03f9417 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface.cpp @@ -430,23 +430,24 @@ be_visitor_interface::visit_operation (be_operation *node) case TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS: ctx.state (TAO_CodeGen::TAO_OPERATION_DIRECT_COLLOCATED_SS); break; - case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CH: ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_OPERATION_CH); break; - + case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CS: + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_OPERATION_CS); + break; case TAO_CodeGen::TAO_AMI_HANDLER_STUB_CH: ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CH); break; - - case TAO_CodeGen::TAO_AMI_HANDLER_STUB_CS: + case TAO_CodeGen::TAO_AMI_HANDLER_STUB_CS: ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CS); break; - - case TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_CH: - ctx.state (TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_OPERATION_CH); + case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_CS: + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_THRU_POA_COLLOCATED_CS); + break; + case TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_CH: + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_THRU_POA_COLLOCATED_CH); break; - case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CH: case TAO_CodeGen::TAO_INTERFACE_ANY_OP_CS: case TAO_CodeGen::TAO_INTERFACE_CDR_OP_CH: diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp index 7c2a402838b..cb88a9a04ad 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ch.cpp @@ -54,6 +54,9 @@ be_visitor_interface_ch::visit_interface (be_interface *node) if (idl_global->ami_call_back () == I_TRUE) { + be_interface_type_strategy *old_strategy = + node->set_strategy (new be_interface_ami_handler_strategy (node)); + // Set the context. be_visitor_context ctx (*this->ctx_); @@ -82,6 +85,8 @@ be_visitor_interface_ch::visit_interface (be_interface *node) -1); } delete visitor; + + delete node->set_strategy (old_strategy); } // Grab the stream. @@ -90,7 +95,7 @@ be_visitor_interface_ch::visit_interface (be_interface *node) // == STEP 1: generate the class name and class names we inherit == // generate the ifdefined macro for the _ptr type - os->gen_ifdef_macro (node->flatname (), "_ptr"); + os->gen_ifdef_macro (node->flat_name (), "_ptr"); // the following two are required to be under the ifdef macro to avoid @@ -106,7 +111,7 @@ be_visitor_interface_ch::visit_interface (be_interface *node) os->gen_endif (); // generate the ifdefined macro for the var type - os->gen_ifdef_macro (node->flatname (), "_var"); + os->gen_ifdef_macro (node->flat_name (), "_var"); // generate the _var declaration if (node->gen_var_defn () == -1) @@ -119,7 +124,7 @@ be_visitor_interface_ch::visit_interface (be_interface *node) os->gen_endif (); // generate the ifdef macro for the _out class - os->gen_ifdef_macro (node->flatname (), "_out"); + os->gen_ifdef_macro (node->flat_name (), "_out"); // generate the _out declaration - ORBOS/97-05-15 pg 16-20 spec if (node->gen_out_defn () == -1) @@ -133,7 +138,7 @@ be_visitor_interface_ch::visit_interface (be_interface *node) os->gen_endif (); // now the interface definition itself - os->gen_ifdef_macro (node->flatname ()); + os->gen_ifdef_macro (node->flat_name ()); // now generate the class definition *os << "class " << idl_global->stub_export_macro () @@ -247,14 +252,12 @@ be_visitor_interface_ch::visit_interface (be_interface *node) // private copy constructor and assignment operator. These are not // allowed, hence they are private. - *os << "private:\n"; - os->incr_indent (); + *os << "private:" << be_idt_nl; *os << node->local_name () << " (const " << node->local_name () << " &);" << be_nl - << "void operator= (const " << node->local_name () << " &);\n"; - - os->decr_indent (); + << "void operator= (const " << node->local_name () << " &);" << be_uidt_nl; *os << "};\n\n"; + os->gen_endif (); // by using a visitor to declare and define the TypeCode, we have the @@ -281,6 +284,10 @@ be_visitor_interface_ch::visit_interface (be_interface *node) { // = Generate the default stub code for Handler. + be_interface_type_strategy *old_strategy = + node->set_strategy (new be_interface_ami_handler_strategy (node)); + + // Set the context. be_visitor_context ctx (*this->ctx_); @@ -340,6 +347,8 @@ be_visitor_interface_ch::visit_interface (be_interface *node) -1); } delete visitor; + + delete node->set_strategy (old_strategy); } node->cli_hdr_gen (I_TRUE); diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp index c3f77bab5fc..2030f023947 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ci.cpp @@ -70,7 +70,7 @@ be_visitor_interface_ci::visit_interface (be_interface *node) *os << "{}\n\n"; // generate the ifdefined macro for the _var type - os->gen_ifdef_macro (node->flatname (), "_var"); + os->gen_ifdef_macro (node->flat_name (), "_var"); if (node->gen_var_impl () == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -81,7 +81,7 @@ be_visitor_interface_ci::visit_interface (be_interface *node) os->gen_endif (); // generate the ifdefined macro for the _out type - os->gen_ifdef_macro (node->flatname (), "_out"); + os->gen_ifdef_macro (node->flat_name (), "_out"); if (node->gen_out_impl () == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -105,6 +105,9 @@ be_visitor_interface_ci::visit_interface (be_interface *node) if (idl_global->ami_call_back () == I_TRUE) { + be_interface_type_strategy *old_strategy = + node->set_strategy (new be_interface_ami_handler_strategy (node)); + // Set the context. be_visitor_context ctx (*this->ctx_); @@ -133,6 +136,8 @@ be_visitor_interface_ci::visit_interface (be_interface *node) -1); } delete visitor; + + delete node->set_strategy (old_strategy); } return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp index ba5f7a2ba07..9539f64869a 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_cs.cpp @@ -55,21 +55,21 @@ be_visitor_interface_cs::visit_interface (be_interface *node) // first generate the code for the static methods // The _narrow method - *os << node->name () << "_ptr " << node->name () + *os << node->full_name () << "_ptr " << node->full_name () << "::_narrow (" << be_idt << be_idt_nl << "CORBA::Object_ptr obj," << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl << "if (CORBA::is_nil (obj))" << be_idt_nl - << "return " << node->name () << "::_nil ();" << be_uidt_nl + << "return " << node->full_name () << "::_nil ();" << be_uidt_nl << "CORBA::Boolean is_a = obj->_is_a (\"" << node->repoID () << "\", ACE_TRY_ENV);" << be_nl - << "ACE_CHECK_RETURN (" << node->name () << "::_nil ());" << be_nl + << "ACE_CHECK_RETURN (" << node->full_name () << "::_nil ());" << be_nl << "if (is_a == 0)" << be_idt_nl - << "return " << node->name () << "::_nil ();" << be_uidt_nl; + << "return " << node->full_name () << "::_nil ();" << be_uidt_nl; - *os << "return " << node->name () + *os << "return " << node->full_name () << "::_unchecked_narrow (obj, ACE_TRY_ENV);" << be_uidt_nl << "}" << be_nl << be_nl; @@ -79,35 +79,35 @@ be_visitor_interface_cs::visit_interface (be_interface *node) // assert (coll_name != 0); // The _unchecked_narrow method - *os << node->name () << "_ptr " << node->name () + *os << node->full_name () << "_ptr " << node->full_name () << "::_unchecked_narrow (" << be_idt << be_idt_nl << "CORBA::Object_ptr obj," << be_nl << "CORBA::Environment &" << be_uidt_nl << ")" << be_uidt_nl << "{" << be_idt_nl << "if (CORBA::is_nil (obj))" << be_idt_nl - << "return " << node->name () << "::_nil ();" << be_uidt_nl; + << "return " << node->full_name () << "::_nil ();" << be_uidt_nl; *os << "TAO_Stub* stub = obj->_stubobj ();" << be_nl << "stub->_incr_refcnt ();" << be_nl; - *os << "if (obj->_is_collocated () && _TAO_collocation_" << node->flatname () + *os << "if (obj->_is_collocated () && _TAO_collocation_" << node->flat_name () << "_Stub_Factory_function_pointer != 0)" << be_idt_nl << "{" << be_idt_nl << node->local_name () << "_ptr retv = _TAO_collocation_" - << node->flatname () + << node->flat_name () << "_Stub_Factory_function_pointer (obj);" << be_nl << "if (retv != 0)" << be_idt_nl << "return retv;" << be_uidt << be_uidt_nl << "}" << be_uidt_nl; - *os << "return new " << node->name () << "(stub);" << be_uidt_nl + *os << "return new " << node->full_name () << "(stub);" << be_uidt_nl << "}" << be_nl << be_nl; // The _duplicate method - *os << node->name () << "_ptr " << be_nl - << node->name () << "::_duplicate (" - << node->name () << "_ptr obj)" << be_nl + *os << node->full_name () << "_ptr " << be_nl + << node->full_name () << "::_duplicate (" + << node->full_name () << "_ptr obj)" << be_nl << "{" << be_idt_nl << "if (!CORBA::is_nil (obj))" << be_idt_nl << "obj->_incr_refcnt ();" << be_uidt_nl @@ -125,7 +125,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) // generate the is_a method os->indent (); - *os << "CORBA::Boolean " << node->name () << "::_is_a (" << + *os << "CORBA::Boolean " << node->full_name () << "::_is_a (" << "const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV)" << be_nl; *os << "{\n"; os->incr_indent (); @@ -149,7 +149,7 @@ be_visitor_interface_cs::visit_interface (be_interface *node) *os << "}\n\n"; os->indent (); - *os << "const char* " << node->name () + *os << "const char* " << node->full_name () << "::_interface_repository_id (void) const" << be_nl << "{" << be_idt_nl @@ -178,6 +178,10 @@ be_visitor_interface_cs::visit_interface (be_interface *node) // Generate code for the AMI Reply Handler. if (idl_global->ami_call_back () == I_TRUE) { + + be_interface_type_strategy *old_strategy = + node->set_strategy (new be_interface_ami_handler_strategy (node)); + // = Generate the default stub code for Handler. // Set the context. @@ -238,6 +242,8 @@ be_visitor_interface_cs::visit_interface (be_interface *node) -1); } delete visitor; + + delete node->set_strategy (old_strategy); } return 0; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp index 91d48ef2a02..f036c7609f0 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ih.cpp @@ -56,8 +56,7 @@ be_visitor_interface_ih::visit_interface (be_interface *node) os->indent (); // start with whatever indentation level we are at - - ACE_OS::sprintf (namebuf, "%s", node->flatname ()); + ACE_OS::sprintf (namebuf, "%s", node->flat_name ()); *os << "//Class " << idl_global->impl_class_prefix ()<<namebuf << idl_global->impl_class_suffix ()<< be_nl; // now generate the class definition @@ -73,12 +72,12 @@ be_visitor_interface_ih::visit_interface (be_interface *node) *os << "public virtual "; intf = be_interface::narrow_from_decl (node->inherits ()[0]); - *os << idl_global->impl_class_prefix () << intf->flatname () << idl_global->impl_class_suffix ();//intf->relative_skel_name (node->full_skel_name ()); + *os << idl_global->impl_class_prefix () << intf->flat_name () << idl_global->impl_class_suffix ();//intf->relative_skel_name (node->full_skel_name ()); for (i = 1; i < node->n_inherits (); i++) { *os << ", public virtual "; intf = be_interface::narrow_from_decl (node->inherits ()[i]); - *os << idl_global->impl_class_prefix () <<intf->flatname () << idl_global->impl_class_suffix ();//intf->relative_skel_name (node->full_skel_name ()); + *os << idl_global->impl_class_prefix () <<intf->flat_name () << idl_global->impl_class_suffix ();//intf->relative_skel_name (node->full_skel_name ()); } // end of for loop //inherit from the base skeleton file diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp index 6cb7079661e..a6ea15f5ec0 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_is.cpp @@ -56,7 +56,7 @@ be_visitor_interface_is::visit_interface (be_interface *node) // constructor *os << "// Implementation skeleton constructor" << be_nl; // find if we are at the top scope or inside some module - *os << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () <<"::" << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () << + *os << idl_global->impl_class_prefix () << node->flat_name () << idl_global->impl_class_suffix () <<"::" << idl_global->impl_class_prefix () << node->flat_name () << idl_global->impl_class_suffix () << " (void)" << be_idt_nl; @@ -72,7 +72,7 @@ be_visitor_interface_is::visit_interface (be_interface *node) os->indent (); *os << "// Implementation skeleton destructor" << be_nl; - *os << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () <<"::~" << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () << + *os << idl_global->impl_class_prefix () << node->flat_name () << idl_global->impl_class_suffix () <<"::~" << idl_global->impl_class_prefix () << node->flat_name () << idl_global->impl_class_suffix () << " (void)" << be_idt_nl; *os << "{" <<be_nl; @@ -82,9 +82,9 @@ be_visitor_interface_is::visit_interface (be_interface *node) { *os << "//Implementation Skeleton Copy Constructor" << be_nl; - *os <<idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () <<"::" - << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () << " (const " - << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () << "& t)"<< be_idt_nl; + *os <<idl_global->impl_class_prefix () << node->flat_name () << idl_global->impl_class_suffix () <<"::" + << idl_global->impl_class_prefix () << node->flat_name () << idl_global->impl_class_suffix () << " (const " + << idl_global->impl_class_prefix () << node->flat_name () << idl_global->impl_class_suffix () << "& t)"<< be_idt_nl; if(node->n_inherits () >0) { node->gen_copy_ctors(os); @@ -98,9 +98,9 @@ be_visitor_interface_is::visit_interface (be_interface *node) { *os << "//Implementation Skeleton Copy Assignment" << be_nl; - *os << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () << "& " - << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () << "::operator=(const " - << idl_global->impl_class_prefix () << node->flatname () << idl_global->impl_class_suffix () << "& t)" <<be_idt_nl + *os << idl_global->impl_class_prefix () << node->flat_name () << idl_global->impl_class_suffix () << "& " + << idl_global->impl_class_prefix () << node->flat_name () << idl_global->impl_class_suffix () << "::operator=(const " + << idl_global->impl_class_prefix () << node->flat_name () << idl_global->impl_class_suffix () << "& t)" <<be_idt_nl << "{" << be_idt_nl << "return *this;" << be_uidt_nl << "}" << be_nl << be_uidt_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp index 437ca6e9dac..bf0fce57413 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp @@ -62,11 +62,11 @@ be_visitor_interface_sh::visit_interface (be_interface *node) if (!node->is_nested ()) { // we are outermost - ACE_OS::sprintf (namebuf, "POA_%s", node->local_name ()->get_string ()); + ACE_OS::sprintf (namebuf, "POA_%s", node->local_name ()); } else { - ACE_OS::sprintf (namebuf, "%s", node->local_name ()->get_string ()); + ACE_OS::sprintf (namebuf, "%s", node->local_name ()); } *os << "class " << namebuf << ";" << be_nl; @@ -149,7 +149,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node) << ");\n" << be_uidt_nl; // Print out the _this() method. - *os << node->name () << " *_this (" << be_idt << be_idt_nl + *os << node->full_name () << " *_this (" << be_idt << be_idt_nl << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl << "TAO_default_environment ()" << be_uidt << be_uidt_nl @@ -180,16 +180,19 @@ be_visitor_interface_sh::visit_interface (be_interface *node) -1); } - *os << be_uidt_nl << "};\n\n"; + be_visitor_context ctx (*this->ctx_); be_visitor *visitor = 0; - + // generate the collocated class if (idl_global->gen_thru_poa_collocation ()) { - ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH); + if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CH) + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_CH); + else + ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SH); visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) { @@ -200,12 +203,17 @@ be_visitor_interface_sh::visit_interface (be_interface *node) "codegen for thru_poa_collocated class failed\n"), -1); } + delete visitor; + visitor = 0; } if (idl_global->gen_direct_collocation ()) { ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH); + if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CH) + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_DIRECT_COLLOCATED_CH); + else + ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SH); visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) { @@ -216,6 +224,8 @@ be_visitor_interface_sh::visit_interface (be_interface *node) "codegen for direct_collocated class failed\n"), -1); } + delete visitor; + visitor = 0; } // generate the TIE class. @@ -231,6 +241,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node) "codegen for TIE class failed\n"), -1); } + delete visitor; *os << "\n"; ctx.stream (tao_cg->server_template_header ()); diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp index 6e4104d487f..fb2d0243007 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp @@ -64,12 +64,12 @@ be_visitor_interface_ss::visit_interface (be_interface *node) } // Collocation function pointer initializer. - *os << node->name () << "_ptr _TAO_collocation_POA_" - << node->flatname () << "_Stub_Factory (" << be_idt << be_idt_nl + *os << node->full_name () << "_ptr _TAO_collocation_POA_" + << node->flat_name () << "_Stub_Factory (" << be_idt << be_idt_nl << "CORBA::Object_ptr obj" << be_uidt_nl - << ")\n"; + << ")" << be_uidt_nl; - *os << "{" << be_nl + *os << "{" << be_idt_nl << "TAO_Stub *stub = obj->_stubobj ();" << be_nl << be_nl << "switch (stub->servant_orb_var ()->orb_core" << " ()->get_collocation_strategy ())" << be_idt_nl @@ -101,28 +101,24 @@ be_visitor_interface_ss::visit_interface (be_interface *node) << "return 0;" << be_uidt_nl << "}\n\n"; - os->indent (); - - *os << "int _TAO_collocation_POA_" << node->flatname () + *os << "int _TAO_collocation_POA_" << node->flat_name () << "_Stub_Factory_Initializer" << " (long dummy)" << be_nl << "{" << be_idt_nl << "ACE_UNUSED_ARG (dummy);" << be_nl << be_nl - << "_TAO_collocation_" << node->flatname () + << "_TAO_collocation_" << node->flat_name () << "_Stub_Factory_function_pointer = " << be_idt_nl - << "_TAO_collocation_POA_" << node->flatname () + << "_TAO_collocation_POA_" << node->flat_name () << "_Stub_Factory;" << be_uidt_nl << be_nl - << "return 0;" << be_uidt_nl << "}\n\n"; + << "return 0;" << be_uidt_nl << "}" << be_nl << be_nl; - *os << "static int _TAO_collocation_POA_" << node->flatname () + *os << "static int _TAO_collocation_POA_" << node->flat_name () << "_Stub_Factory_Initializer_Scarecrow = " << be_idt_nl - << "_TAO_collocation_POA_" << node->flatname () - << "_Stub_Factory_Initializer (ACE_reinterpret_cast " - << "(long, _TAO_collocation_POA_" - << node->flatname () << "_Stub_Factory_Initializer));" - << be_uidt_nl; - - os->indent (); + << "_TAO_collocation_POA_" << node->flat_name () + << "_Stub_Factory_Initializer (" + << "ACE_reinterpret_cast (long, _TAO_collocation_POA_" + << node->flat_name () << "_Stub_Factory_Initializer));" + << be_uidt_nl << be_nl; // constructor *os << "// skeleton constructor" << be_nl; @@ -141,9 +137,9 @@ be_visitor_interface_ss::visit_interface (be_interface *node) } *os << "{" << be_idt_nl - << "this->optable_ = &tao_" << node->flatname () + << "this->optable_ = &tao_" << node->flat_name () << "_optable;" << be_uidt_nl - << "}\n\n"; + << "}" << be_nl << be_nl; *os << "// copy ctor" << be_nl; // find if we are at the top scope or inside some module @@ -169,7 +165,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) "be_visitor_interface_ss::visit_interface - " " copy ctor generation failed\n"), -1); *os << " TAO_ServantBase (rhs)" << be_uidt_nl - << "{}\n" << be_nl; + << "{}" << be_nl << be_nl; *os << "// skeleton destructor" << be_nl; @@ -185,7 +181,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << node->full_skel_name () << "::~" << node->local_name () << " (void)" << be_nl; } - *os << "{\n"; + *os << "{" << be_nl; *os << "}\n\n"; @@ -223,11 +219,10 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << "TAO_OutputCDR &_tao_out = _tao_server_request.outgoing ();" << be_nl; *os << "if (!((_tao_out << CORBA::Any::from_boolean (_tao_retval))))" << be_idt_nl; *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; // generate code for the _non_existent skeleton - os->indent (); *os << "void " << node->full_skel_name () << "::_non_existent_skel (" << be_idt << be_idt_nl << "CORBA::ServerRequest &_tao_server_request, " << be_nl @@ -247,7 +242,6 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt << be_uidt_nl; *os << "}\n\n"; - os->indent (); *os << "CORBA::Boolean " << node->full_skel_name () << "::_is_a (" << be_idt << be_idt_nl @@ -271,14 +265,14 @@ be_visitor_interface_ss::visit_interface (be_interface *node) << be_idt_nl << "return 1;" << be_uidt_nl << "else" << be_idt_nl << "return 0;" << be_uidt << be_uidt << be_uidt_nl - << "}\n\n"; + << "}" << be_nl << be_nl; // the downcast method. *os << "void* " << node->full_skel_name () << "::_downcast (" << be_idt << be_idt_nl << "const char* logical_type_id" << be_uidt_nl << ")" << be_uidt_nl - << "{" << be_idt_nl; + << "{\n" << be_idt; if (node->traverse_inheritance_graph (be_interface::downcast_helper, os) == -1) { @@ -289,21 +283,20 @@ be_visitor_interface_ss::visit_interface (be_interface *node) -1); } + os->indent (); *os << "if (ACE_OS::strcmp (logical_type_id, " << "\"IDL:omg.org/CORBA/Object:1.0\") == 0)" << be_idt_nl << "return ACE_static_cast(PortableServer::Servant, this);" << be_uidt_nl; *os << "return 0;" << be_uidt_nl - << "}\n\n"; - + << "}" << be_nl << be_nl; // now the dispatch method *os << "void " << node->full_skel_name () << "::_dispatch (CORBA::ServerRequest &req, " << "void *context, CORBA::Environment &ACE_TRY_ENV)" << be_nl; - *os << "{\n"; - os->incr_indent (); + *os << "{" << be_idt_nl; *os << "TAO_Skeleton skel; // pointer to skeleton for operation" << be_nl; *os << "const char *opname = req.operation (); // retrieve operation name" << be_nl; @@ -318,22 +311,17 @@ be_visitor_interface_ss::visit_interface (be_interface *node) *os << "}" << be_nl; *os << "else" << be_idt_nl; *os << "skel (req, this, context, ACE_TRY_ENV);" << be_uidt << be_uidt_nl; - *os << "}\n\n"; + *os << "}" << be_nl << be_nl; - os->indent (); *os << "const char* " << node->full_skel_name () << "::_interface_repository_id (void) const" << be_nl; - *os << "{\n"; - os->incr_indent (); - *os << "return \"" << node->repoID () << "\";\n"; - os->decr_indent (); - *os << "}\n\n"; - - *os << "\n"; + *os << "{" << be_idt_nl; + *os << "return \"" << node->repoID () << "\";" << be_uidt_nl; + *os << "}" << be_nl << be_nl; // the _this () operation - *os << node->name () << "*" << be_nl + *os << node->full_name () << "*" << be_nl << node->full_skel_name () << "::_this (CORBA_Environment &ACE_TRY_ENV)" << be_nl << "{" << be_idt_nl @@ -373,13 +361,14 @@ be_visitor_interface_ss::visit_interface (be_interface *node) // the _create_collocated_objref method. If the idl compiler does // not generate the type of collocated stub but the orb is asking // for it, simply return null so a remote stub will be used. - os->indent (); - // generate the collocated class impl if (idl_global->gen_thru_poa_collocation ()) { be_visitor_context ctx (*this->ctx_); - ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS); + if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CS) + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_CS); + else + ctx.state (TAO_CodeGen::TAO_INTERFACE_THRU_POA_COLLOCATED_SS); be_visitor *visitor = tao_cg->make_visitor (&ctx); if (!visitor) { @@ -404,7 +393,10 @@ be_visitor_interface_ss::visit_interface (be_interface *node) if (idl_global->gen_direct_collocation ()) { be_visitor_context ctx (*this->ctx_); - ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS); + if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_CS) + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_CS); + else + ctx.state (TAO_CodeGen::TAO_INTERFACE_DIRECT_COLLOCATED_SS); be_visitor *visitor = tao_cg->make_visitor (&ctx); if (!visitor) { diff --git a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp index fd104d55a66..91789cf9de9 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_sh.cpp @@ -46,14 +46,14 @@ int be_visitor_interface_thru_poa_collocated_sh::visit_interface (be_interface * { TAO_OutStream *os = this->ctx_->stream (); - os->gen_ifdef_macro (node->flatname (), "_thru_poa_collocated"); + os->gen_ifdef_macro (node->flat_name (), "_thru_poa_collocated"); // output the class defn os->indent (); *os << "class " << idl_global->skel_export_macro () << " " << node->local_coll_name (be_interface::THRU_POA); os->incr_indent (); - *os << " : public virtual " << node->name (); + *os << " : public virtual " << node->full_name (); // generate base classes if any if (node->n_inherits () > 0) diff --git a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp index d6d869d5553..94d0f2291b8 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/thru_poa_collocated_ss.cpp @@ -44,32 +44,26 @@ be_visitor_interface_thru_poa_collocated_ss::~be_visitor_interface_thru_poa_coll int be_visitor_interface_thru_poa_collocated_ss::visit_interface (be_interface *node) { - TAO_OutStream *os = tao_cg->server_skeletons (); + TAO_OutStream *os = this->ctx_->stream (); this->ctx_->node (node); + os->indent (); *os << node->full_coll_name (be_interface::THRU_POA) << "::" << node->local_coll_name (be_interface::THRU_POA) << " (" << be_idt_nl << "TAO_Stub *stub" << be_uidt_nl - << ")\n"; - os->decr_indent (0); - - os->incr_indent (); + << ")" << be_idt_nl; if (node->is_nested ()) { - be_decl* scope = - be_scope::narrow_from_scope (node->defined_in ())->decl (); + be_decl* scope = be_scope::narrow_from_scope (node->defined_in ())->decl (); - *os << ": ACE_NESTED_CLASS (" - << scope->name () << "," - << node->local_name () - << ") ()," << be_nl; + *os << ": ACE_NESTED_CLASS (" << scope->full_name () << "," + << node->local_name () << ") ()," << be_nl; } else { - *os << ": " << node->name () - << " ()," << be_nl; + *os << ": " << node->full_name () << " ()," << be_nl; } // @@ We should call the constructor for all base classes, since we @@ -85,13 +79,10 @@ int be_visitor_interface_thru_poa_collocated_ss::visit_interface (be_interface * -1); } - *os << " CORBA_Object (stub, 0, 1)\n"; - - os->decr_indent (); - *os << "{\n"; - *os << "}\n\n"; + *os << " CORBA_Object (stub, 0, 1)" << be_uidt_nl; - os->indent (); + *os << "{" << be_nl; + *os << "}" << be_nl << be_nl; // Generate _is_a implementation. *os << "CORBA::Boolean " << node->full_coll_name (be_interface::THRU_POA) << "::" @@ -119,9 +110,7 @@ int be_visitor_interface_thru_poa_collocated_ss::visit_interface (be_interface * << "\"" << node->repoID () << "\"" << be_uidt_nl << ")" << be_uidt << be_uidt_nl << ")->_is_a (logical_type_id, ACE_TRY_ENV);" << be_uidt << be_uidt_nl - << "}\n\n" << be_uidt_nl; - - os->indent (); + << "}" << be_uidt_nl << be_nl << be_nl; // Generate _non_existent implementation. *os << "CORBA::Boolean " << node->full_coll_name (be_interface::THRU_POA) << "::" @@ -148,7 +137,7 @@ int be_visitor_interface_thru_poa_collocated_ss::visit_interface (be_interface * << "\"" << node->repoID () << "\"" << be_uidt_nl << ")" << be_uidt << be_uidt_nl << ")->_non_existent (ACE_TRY_ENV);" << be_uidt << be_uidt_nl - << "}\n\n" << be_uidt_nl; + << "}" << be_uidt_nl << be_nl << be_nl; if (this->visit_scope (node) == -1) { @@ -176,7 +165,7 @@ be_visitor_interface_thru_poa_collocated_ss::collocated_ctor_helper (be_interfac { be_decl *scope; scope = be_scope::narrow_from_scope (base->defined_in ())->decl (); - *os << " ACE_NESTED_CLASS (POA_" << scope->name () << "," + *os << " ACE_NESTED_CLASS (POA_" << scope->full_name () << "," << base->local_coll_name (be_interface::THRU_POA) << ") (stub)," << be_nl; } else diff --git a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp index 0c568e4bfe5..0a0abe97cda 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_sh.cpp @@ -63,15 +63,15 @@ be_visitor_interface_tie_sh::visit_interface (be_interface *node) if (!node->is_nested ()) { // we are outermost - ACE_OS::sprintf (namebuf, "POA_%s", node->local_name ()->get_string ()); + ACE_OS::sprintf (namebuf, "POA_%s", node->local_name ()); ACE_OS::sprintf (tiename, "POA_%s_tie", - node->local_name ()->get_string ()); + node->local_name ()); } else { - ACE_OS::sprintf (namebuf, "%s", node->local_name ()->get_string ()); + ACE_OS::sprintf (namebuf, "%s", node->local_name ()); ACE_OS::sprintf (tiename, "%s_tie", - node->local_name ()->get_string ()); + node->local_name ()); } // now generate the class definition diff --git a/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp b/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp index 6b720a11366..3e48f8cd187 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/tie_si.cpp @@ -66,16 +66,16 @@ be_visitor_interface_tie_si::visit_interface (be_interface *node) if (!node->is_nested ()) { ACE_OS::sprintf (localskelname, "POA_%s", - node->local_name ()->get_string ()); + node->local_name ()); ACE_OS::sprintf (localtiename, "POA_%s_tie", - node->local_name ()->get_string ()); + node->local_name ()); } else { ACE_OS::sprintf (localskelname, "%s", - node->local_name ()->get_string ()); + node->local_name ()); ACE_OS::sprintf (localtiename, "%s_tie", - node->local_name ()->get_string ()); + node->local_name ()); } if (node->is_nested ()) diff --git a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp index 7591f4d83be..1ecae4bb0a5 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface_fwd/interface_fwd_ch.cpp @@ -55,7 +55,7 @@ be_visitor_interface_fwd_ch::visit_interface_fwd (be_interface_fwd *node) *os << "class " << node->local_name () << ";" << be_nl; // generate the ifdefined macro for the _ptr type - os->gen_ifdef_macro (node->flatname (), "_ptr"); + os->gen_ifdef_macro (node->flat_name (), "_ptr"); // generate the _ptr declaration *os << "typedef " << node->local_name () << " *" << node->local_name () @@ -64,7 +64,7 @@ be_visitor_interface_fwd_ch::visit_interface_fwd (be_interface_fwd *node) os->gen_endif (); // enclose under an ifdef macro - os->gen_ifdef_macro (node->flatname (), "_var"); + os->gen_ifdef_macro (node->flat_name (), "_var"); // generate the _var declaration if (node->gen_var_defn () == -1) @@ -78,7 +78,7 @@ be_visitor_interface_fwd_ch::visit_interface_fwd (be_interface_fwd *node) os->gen_endif (); // enclose under an ifdef macro - os->gen_ifdef_macro (node->flatname (), "_out"); + os->gen_ifdef_macro (node->flat_name (), "_out"); // generate the _out declaration - ORBOS/97-05-15 pg 16-20 spec if (node->gen_out_defn () == -1) diff --git a/TAO/TAO_IDL/be/be_visitor_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp index 3b4c8db91ac..04441aa4819 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp @@ -62,7 +62,10 @@ #include "be_visitor_operation/ami_handler_operation_ch.cpp" #include "be_visitor_operation/ami_handler_arglist.cpp" #include "be_visitor_operation/ami_handler_operation_cs.cpp" +#include "be_visitor_operation/ami_handler_servant_operation_cs.cpp" #include "be_visitor_operation/ami_handler_skeleton_cs.cpp" #include "be_visitor_operation/ami_handler_argument_marshal.cpp" +#include "be_visitor_operation/ami_handler_thru_poa_collocated_ch.cpp" +#include "be_visitor_operation/ami_handler_thru_poa_collocated_cs.cpp" ACE_RCSID(be, be_visitor_operation, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_arglist.cpp index 17283768469..fa0efac3f45 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_arglist.cpp @@ -61,13 +61,24 @@ be_visitor_operation_ami_arglist::visit_operation (be_operation *node) if (interface == 0) cerr << "Invalid interface"; - // AMI Handler argument. - *os << "AMI_" - << interface->fullname () - << "_Handler_ptr " - << "_tao_ami_handler" - << ",\n"; - // #endif /* TAO_IDL_HAS_AMI */ + // @@ Michael: This is not very nice, but we do not have + // a be_interface pointer and therefor no strategy. + { + char *full_name = 0; + + interface->compute_full_name ("AMI_", + "_Handler", + full_name); + // Genereate scope name. + // AMI Handler argument. + *os << full_name + << "_ptr " + << "_tao_ami_handler" + << ",\n"; + + delete full_name; + } + // all we do is hand over code generation to our scope if (this->visit_scope (node) == -1) diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp index 3f87f4430db..37d859136ef 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp @@ -85,7 +85,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node) -1); // Generate the scope::operation name. - *os << parent->fullname () + *os << parent->full_name () << "::" << "sendc_" << node->local_name ()->get_string (); @@ -376,7 +376,7 @@ be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () << + *os << node->flat_name () << "_paramdata [] = " << be_nl; *os << "{\n"; os->incr_indent (); @@ -397,7 +397,7 @@ be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node, } *os << "\n"; os->decr_indent (); - *os << "}; // " << node->flatname () << "_paramdata\n\n"; + *os << "}; // " << node->flat_name () << "_paramdata\n\n"; // Check if this operation raises any exceptions. In that case, we must // generate a list of exception typecodes. This is not valid for @@ -430,7 +430,7 @@ be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () + *os << node->flat_name () << "_calldata = " << be_nl << "{" << "\""; @@ -468,7 +468,7 @@ be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () << "_paramdata, "; + *os << node->flat_name () << "_paramdata, "; // insert exception list (if any) - node for attributes if (this->ctx_->attribute ()) @@ -478,7 +478,7 @@ be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node, if (node->exceptions ()) { *os << node->exceptions ()->length () - << ", _tao_" << node->flatname () << "_exceptiondata};\n\n"; + << ", _tao_" << node->flat_name () << "_exceptiondata};\n\n"; } else *os << "0, 0};\n\n"; @@ -544,7 +544,7 @@ be_interpretive_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation else *os << "_get_"; } - *os << node->flatname () << "_calldata," << be_nl + *os << node->flat_name () << "_calldata," << be_nl << "_tao_arguments" << be_uidt_nl << ");\n"; @@ -674,9 +674,21 @@ be_compiled_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation *node // Get the interface. be_decl *interface = be_interface::narrow_from_scope (node->defined_in ())->decl (); - *os << "&AMI_" << interface->fullname () << "_Handler" << "::" - << node->local_name () << "_skel," << be_nl; - + { + char *full_name = 0; + + interface->compute_full_name ("AMI_", + "_Handler", + full_name); + + *os << "&" << full_name << "::" + << node->local_name () << "_skel," << be_nl; + + delete full_name; + } + + + // Next argument is the ami handler passed in for this method. *os << "_tao_ami_handler" << be_uidt_nl @@ -735,7 +747,7 @@ be_compiled_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation *node << "int _invoke_status =" << be_idt_nl; if (node->exceptions ()) { - *os << "_tao_call.invoke (_tao_" << node->flatname () + *os << "_tao_call.invoke (_tao_" << node->flat_name () << "_exceptiondata, " << node->exceptions ()->length () << ", ACE_TRY_ENV);"; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ch.cpp index 30f38acf344..450e5bd6cb1 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ch.cpp @@ -90,7 +90,8 @@ be_visitor_operation_ami_handler_operation_ch::visit_operation (be_operation *no // Generating the skeleton method. // Skeleton not necessary for collocated class. - if (this->ctx_->state () == TAO_CodeGen::TAO_COLLOCATED_AMI_HANDLER_OPERATION_CH) + if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_THRU_POA_COLLOCATED_CH + || this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_DIRECT_COLLOCATED_CH) { return 0; /* NOT REACHED */ diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_cs.cpp index 89d14a4d74e..d98be024263 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_cs.cpp @@ -90,8 +90,20 @@ be_visitor_operation_ami_handler_operation_cs::visit_operation (be_operation *no -1); } - // Genereate scope name. - *os << parent->compute_name ("AMI_", "_Handler"); + // Here we do not have our overridden be_interface methods, + // so the interface type strategy does not work here. + // We have to go by foot. + { + char *full_name = 0; + + parent->compute_full_name ("AMI_", + "_Handler", + full_name); + // Genereate scope name. + *os << full_name; + + delete full_name; + } // Generate the operation name. *os << "::" << node->local_name (); @@ -374,7 +386,7 @@ be_interpretive_visitor_operation_ami_handler_operation_cs::gen_pre_stub_info (b else *os << "_get_"; } - *os << node->flatname () << + *os << node->flat_name () << "_paramdata [] = " << be_nl; *os << "{\n"; os->incr_indent (); @@ -397,7 +409,7 @@ be_interpretive_visitor_operation_ami_handler_operation_cs::gen_pre_stub_info (b os->indent (); *os << be_nl; os->decr_indent (); - *os << "}; // " << node->flatname () << "_paramdata\n\n"; + *os << "}; // " << node->flat_name () << "_paramdata\n\n"; // Check if this operation raises any exceptions. In that case, we must // generate a list of exception typecodes. This is not valid for @@ -430,7 +442,7 @@ be_interpretive_visitor_operation_ami_handler_operation_cs::gen_pre_stub_info (b else *os << "_get_"; } - *os << node->flatname () + *os << node->flat_name () << "_calldata = " << be_nl << "{" << "\""; @@ -468,7 +480,7 @@ be_interpretive_visitor_operation_ami_handler_operation_cs::gen_pre_stub_info (b else *os << "_get_"; } - *os << node->flatname () << "_paramdata, "; + *os << node->flat_name () << "_paramdata, "; // insert exception list (if any) - node for attributes if (this->ctx_->attribute ()) @@ -478,7 +490,7 @@ be_interpretive_visitor_operation_ami_handler_operation_cs::gen_pre_stub_info (b if (node->exceptions ()) { *os << node->exceptions ()->length () - << ", _tao_" << node->flatname () << "_exceptiondata};\n\n"; + << ", _tao_" << node->flat_name () << "_exceptiondata};\n\n"; } else *os << "0, 0};\n\n"; @@ -546,7 +558,7 @@ gen_marshal_and_invoke (be_operation*node, else *os << "_get_"; } - *os << node->flatname () << "_calldata," << be_nl + *os << node->flat_name () << "_calldata," << be_nl << "_tao_arguments" << be_uidt_nl << ");\n"; @@ -647,8 +659,6 @@ gen_marshal_and_invoke (be_operation *node, be_type *bt) { TAO_OutStream *os = this->ctx_->stream (); - be_visitor *visitor; - be_visitor_context ctx; os->indent (); @@ -699,43 +709,28 @@ gen_marshal_and_invoke (be_operation *node, << be_nl << "if (!(\n" << be_idt << be_idt << be_idt; - // @@ Michael: This has to be replaced witht he code in the - // "#if 0" clause - // Marshal the ami result argument, if the return type is not - // void. - if (!this->void_return_type (bt)) - { - os->indent (); - *os << "(_tao_out << _tao_retval)"; - - // Print the && if there are OUT or INOUT arguements in the - // signature. - if (this->has_param_type (node, AST_Argument::dir_OUT) || - this->has_param_type (node, AST_Argument::dir_INOUT)) - *os << " &&\n"; - } - -#if 0 - // @@ This for giving the _tao_retval argument only. But - // this may be needed for some data types. - // But the one that is above is ok for basic types. - // @@ We may need to do this. - ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_MARSHAL_CS); + // demarshal + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DEMARSHAL_CS); ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT); - visitor = tao_cg->make_visitor (&ctx); + be_visitor *visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) { delete visitor; ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_compiled_visitor_operation_ami_handler_operation_cs::" - "gen_marshal_and_invoke - " - "codegen for return var in do_static_call failed\n"), + "gen_demarshal_params - " + "codegen for demarshal failed\n"), -1); } delete visitor; - visitor = 0; -#endif /* 0 */ + + // Print the && if there are OUT or INOUT arguements in the + // signature. + if (this->has_param_type (node, AST_Argument::dir_OUT) || + this->has_param_type (node, AST_Argument::dir_INOUT)) + *os << " &&\n"; + // Marshal each out and inout argument. ctx = *this->ctx_; @@ -774,7 +769,7 @@ gen_marshal_and_invoke (be_operation *node, { if (node->exceptions ()) { - *os << "_tao_call.invoke (_tao_" << node->flatname () + *os << "_tao_call.invoke (_tao_" << node->flat_name () << "_exceptiondata, " << node->exceptions ()->length () << ", ACE_TRY_ENV);"; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_servant_operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_servant_operation_cs.cpp new file mode 100644 index 00000000000..d0aa2edfba5 --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_servant_operation_cs.cpp @@ -0,0 +1,686 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// ami_handler_servant_operation_cs.cpp +// +// = DESCRIPTION +// Visitor generating code for Operation in the server skeleton +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#include "idl.h" +#include "idl_extern.h" +#include "be.h" + +#include "be_visitor_operation.h" +#include "be_visitor_argument.h" + +ACE_RCSID(be_visitor_operation, ami_handler_servant_operation_cs, "$Id$") + + +// ************************************************************ +// Operation visitor for server skeletons +// ************************************************************ + +be_visitor_operation_ami_handler_servant_operation_cs::be_visitor_operation_ami_handler_servant_operation_cs (be_visitor_context *ctx) + : be_visitor_operation (ctx) +{ +} + +be_visitor_operation_ami_handler_servant_operation_cs::~be_visitor_operation_ami_handler_servant_operation_cs (void) +{ +} + +// processing to be done after every element in the scope is processed +int +be_visitor_operation_ami_handler_servant_operation_cs::post_process (be_decl *bd) +{ + // all we do here is to insert a comma and a newline + TAO_OutStream *os = this->ctx_->stream (); + if (!this->last_node (bd)) + *os << ",\n"; + return 0; +} + +int +be_visitor_operation_ami_handler_servant_operation_cs::visit_operation (be_operation *node) +{ + TAO_OutStream *os; // output stream + be_type *bt; // type node for return type + + os = this->ctx_->stream (); // grab the o/p stream + this->ctx_->node (node); // save the node for future use + + os->indent (); // start with the current indentation level + + // if there is an argument of type "native", return immediately + if (node->has_native ()) + return 0; + + // retrieve the operation return type + bt = be_type::narrow_from_decl (node->return_type ()); + if (!bt) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "Bad return type\n"), + -1); + } + + // We need the interface node in which this operation was defined. However, + // if this operation node was an attribute node in disguise, we get this + // information from the context + be_interface *intf; + intf = this->ctx_->attribute () + ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ()) + : be_interface::narrow_from_scope (node->defined_in ()); + + if (!intf) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "bad interface scope\n"), + -1); + } + + // Default implementation + os->indent (); + *os << "void " << intf->full_skel_name () << "::"; + // check if we are an attribute node in disguise + if (this->ctx_->attribute ()) + { + // now check if we are a "get" or "set" operation + if (node->nmembers () == 1) // set + *os << "_set_"; + else + *os << "_get_"; + } + *os << node->local_name () << " "; + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CS); + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if ((!visitor) || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_thru_poa_collocated_cs::" + "visit_operation - " + "codegen for argument list failed\n"), + -1); + } + delete visitor; + visitor = 0; + os->indent (); + *os << "{" << be_idt_nl; + + *os << "ACE_DEBUG ((LM_DEBUG," << be_idt << be_idt_nl + <<"\"(%P | %t):" << intf->full_skel_name () << "\\n\"));" + << be_uidt << be_uidt_nl; + + *os << be_uidt_nl << "}" << be_nl << be_nl; + + + + // generate the signature of the static skeleton + os->indent (); + *os << "void " << intf->full_skel_name () << "::"; + // check if we are an attribute node in disguise + if (this->ctx_->attribute ()) + { + // now check if we are a "get" or "set" operation + if (node->nmembers () == 1) // set + *os << "_set_"; + else + *os << "_get_"; + } + *os << node->local_name () + << "_skel (" << be_idt << be_idt_nl; + + *os << "CORBA::ServerRequest &_tao_server_request, " << be_nl; + + *os << "void *_tao_object_reference, " << be_nl + << "void * /* context */, " << be_nl + << "CORBA::Environment &ACE_TRY_ENV" << be_uidt << be_uidt_nl + << ")" << be_nl; + + // generate the actual code for the skeleton. However, if any of the argument + // types is "native", we do not generate any skeleton + // last argument - is always CORBA::Environment + *os << "{\n" << be_idt; + + // generate all the tables and other pre-skel info + if (this->gen_pre_skel_info (node, bt) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "gen_pre_skel_info failed\n"), + -1); + } + + os->indent (); + // get the right object implementation. + *os << intf->full_skel_name () << " *_tao_impl = (" + << intf->full_skel_name () << " *)_tao_object_reference;\n\n"; + + // declare a return type variable + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (bt->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "codegen for return var decl failed\n"), + -1); + } + delete visitor; + visitor = 0; + + // declare variables for arguments + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "codegen for return var decl failed\n"), + -1); + } + delete visitor; + visitor = 0; + + // Demarshal parameters + if (this->gen_demarshal_params (node, bt) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "gen_demarshal_params failed\n"), + -1); + } + + // make the upcall + os->indent (); + *os << "_tao_impl->" << node->local_name () << " (" << be_idt << "\n"; + + if (!this->void_return_type (bt)) + { + os->indent (); + *os << "_tao_retval,\n"; + } + + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "codegen for making upcall failed\n"), + -1); + } + delete visitor; + visitor = 0; + + // end the upcall + os->indent (); + *os << be_uidt_nl << ");\n"; + + os->indent (); + *os << "ACE_CHECK;\n" + << "_tao_server_request.init_reply (ACE_TRY_ENV);\n"; + + os->decr_indent (); + *os << "}\n\n"; + return 0; +} + +int +be_visitor_operation_ami_handler_servant_operation_cs::visit_argument (be_argument *node) +{ + // this method is used to generate the ParamData table entry + + TAO_OutStream *os = this->ctx_->stream (); + be_type *bt; // argument type + + // retrieve the type for this argument + bt = be_type::narrow_from_decl (node->field_type ()); + if (!bt) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_argument - " + "Bad argument type\n"), + -1); + } + + os->indent (); + *os << "{" << bt->tc_name () << ", "; + switch (node->direction ()) + { + case AST_Argument::dir_IN: + *os << "CORBA::ARG_IN, "; + break; + case AST_Argument::dir_INOUT: + *os << "CORBA::ARG_INOUT, "; + break; + case AST_Argument::dir_OUT: + *os << "CORBA::ARG_OUT, "; + break; + } + *os << "0}"; + + return 0; +} + +int +be_visitor_operation_ami_handler_servant_operation_cs::gen_raise_exception (be_type *, + const char *excep, + const char *completion_status, + const char * /* env */) +{ + TAO_OutStream *os = this->ctx_->stream (); + + os->indent (); + *os << "ACE_THROW (" + << excep << " (" << completion_status << ") " + << ");\n"; + return 0; +} + +int +be_visitor_operation_ami_handler_servant_operation_cs::gen_check_exception (be_type *, const char * /* env */) +{ + TAO_OutStream *os = this->ctx_->stream (); + + os->indent (); + // check if there is an exception + *os << "ACE_CHECK;\n"; + // << env << ");\n"; + + return 0; +} + + +// ********************************************************************* +// Operation visitor for server skeletons using interpretive marshaling +// ********************************************************************* + +be_interpretive_visitor_operation_ami_handler_servant_operation_cs:: +be_interpretive_visitor_operation_ami_handler_servant_operation_cs (be_visitor_context *ctx) + : be_visitor_operation_ami_handler_servant_operation_cs (ctx) +{ +} + +be_interpretive_visitor_operation_ami_handler_servant_operation_cs:: +~be_interpretive_visitor_operation_ami_handler_servant_operation_cs (void) +{ +} + +int +be_interpretive_visitor_operation_ami_handler_servant_operation_cs::gen_pre_skel_info (be_operation *node, + be_type *bt) +{ + TAO_OutStream *os = this->ctx_->stream (); + be_visitor_context ctx; + + os->indent (); + // generate the param_data and call_data tables. We generate these if and + // only if none of our arguments is of "native" type. Native types cannot be + // marshaled. + // native type does not exist. Generate the static tables + + // generate the TAO_Param_Data_Skel table + *os << "static const TAO_Param_Data_Skel "; + // check if we are an attribute node in disguise + if (this->ctx_->attribute ()) + { + // now check if we are a "get" or "set" operation + if (node->nmembers () == 1) // set + *os << "_set_"; + else + *os << "_get_"; + } + *os << node->flat_name () << + "_paramdata [] = " << be_nl; + *os << "{\n"; + os->incr_indent (); + + // entry for the return type + *os << "{" << bt->tc_name () << ", 0, 0}"; + if (node->nmembers () > 0) + *os << ",\n"; + + // generate entries for the param data table for arguments + if (this->visit_scope (node) == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "visit scope failed\n"), + -1); + } + *os << "\n"; + os->decr_indent (); + *os << "}; // " << node->flat_name () << "_paramdata\n\n"; + + // now generate the calldata table + os->indent (); + *os << "static const TAO_Call_Data_Skel "; + // check if we are an attribute node in disguise + if (this->ctx_->attribute ()) + { + // now check if we are a "get" or "set" operation + if (node->nmembers () == 1) // set + *os << "_set_"; + else + *os << "_get_"; + } + *os << node->flat_name () + << "_calldata = " << be_nl + << "{" + << "\""; + // check if we are an attribute node in disguise + if (this->ctx_->attribute ()) + { + // now check if we are a "get" or "set" operation + if (node->nmembers () == 1) // set + *os << "_set_"; + else + *os << "_get_"; + } + *os << node->local_name () << "\", "; + + // are we oneway or two operation? + if (node->flags () == AST_Operation::OP_oneway) + { + *os << "0, "; // for false + } + else + { + *os << "1, "; // for true + } + // insert the size of the paramdata table i.e., number of arguments + 1 + // for return type + *os << (node->argument_count () + 1) << ", "; + + // insert the address of the paramdata table + // check if we are an attribute node in disguise + if (this->ctx_->attribute ()) + { + // now check if we are a "get" or "set" operation + if (node->nmembers () == 1) // set + *os << "_set_"; + else + *os << "_get_"; + } + *os << node->flat_name () << "_paramdata};\n\n"; + + return 0; +} + +int +be_interpretive_visitor_operation_ami_handler_servant_operation_cs::gen_demarshal_params (be_operation *node, + be_type *bt) +{ + TAO_OutStream *os = this->ctx_->stream (); + be_visitor *visitor; + be_visitor_context ctx; + + // setup parameters for demarshaling and demarshal them + os->indent (); + *os << "_tao_server_request.demarshal (" << be_idt_nl + << "ACE_TRY_ENV, " << be_nl + << "&"; + // check if we are an attribute node in disguise + if (this->ctx_->attribute ()) + { + // now check if we are a "get" or "set" operation + if (node->nmembers () == 1) // set + *os << "_set_"; + else + *os << "_get_"; + } + *os << node->flat_name () << "_calldata,\n"; + + // pass the appropriate return value to the demarshal operation + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_DEMARSHAL_SS); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (bt->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "codegen for return var in demarshal failed\n"), + -1); + } + // insert a comma after the return val if there are arguments + if (node->argument_count () > 0) + *os << ",\n"; + + // pass each argument to the demarshal operation + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "codegen for argument in demarshal failed\n"), + -1); + } + + // end the demarshal call + *os << be_uidt_nl; + *os << ");" << be_nl; + + *os << "ACE_CHECK;\n"; + + return 0; +} + +int +be_interpretive_visitor_operation_ami_handler_servant_operation_cs::gen_marshal_params (be_operation *node, + be_type *bt) +{ + TAO_OutStream *os = this->ctx_->stream (); + be_visitor *visitor; + be_visitor_context ctx; + + // setup parameters for marshaling and marshal them into the + // outgoing stream + os->indent (); + *os << "_tao_server_request.marshal (" << be_idt_nl + << "ACE_TRY_ENV, " << be_nl + // << "_tao_skel_environment, " << be_nl + << "&"; + // check if we are an attribute node in disguise + if (this->ctx_->attribute ()) + { + // now check if we are a "get" or "set" operation + if (node->nmembers () == 1) // set + *os << "_set_"; + else + *os << "_get_"; + } + *os << node->flat_name () << "_calldata,\n"; + + // pass the appropriate return value to the marshal operation + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_MARSHAL_SS); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (bt->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "codegen for return var in marshal failed\n"), + -1); + } + // insert a comma after the return val if there are arguments + if (node->argument_count () > 0) + { + *os << ",\n"; + } + + // pass each argument to the marshal operation + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_servant_operation_cs::" + "visit_operation - " + "codegen for argument in marshal failed\n"), + -1); + } + // end the marshal call + *os << be_uidt_nl; + *os << ");\n"; + + return 0; +} + +// ********************************************************************* +// Operation visitor for server skeletons using compiled marshaling +// ********************************************************************* + +be_compiled_visitor_operation_ami_handler_servant_operation_cs:: +be_compiled_visitor_operation_ami_handler_servant_operation_cs (be_visitor_context *ctx) + : be_visitor_operation_ami_handler_servant_operation_cs (ctx) +{ +} + +be_compiled_visitor_operation_ami_handler_servant_operation_cs:: +~be_compiled_visitor_operation_ami_handler_servant_operation_cs (void) +{ +} + +int +be_compiled_visitor_operation_ami_handler_servant_operation_cs::gen_pre_skel_info (be_operation *node, + be_type *bt) +{ + TAO_OutStream *os = this->ctx_->stream (); + + // now make sure that we have some in and inout parameters. Otherwise, there + // is nothing to be marshaled in + if (this->has_param_type (node, AST_Argument::dir_INOUT) || + this->has_param_type (node, AST_Argument::dir_OUT) || + !this->void_return_type (bt)) + { + // instantiate a TAO_InputCDR variable + os->indent (); + *os << "TAO_InputCDR &_tao_in = _tao_server_request.incoming ();\n"; + } + + return 0; +} + +int +be_compiled_visitor_operation_ami_handler_servant_operation_cs::gen_demarshal_params (be_operation *node, + be_type *bt) +{ + TAO_OutStream *os = this->ctx_->stream (); + be_visitor *visitor; + be_visitor_context ctx; + + // now make sure that we have some in and inout parameters. Otherwise, there + // is nothing to be marshaled in + if (this->has_param_type (node, AST_Argument::dir_INOUT) || + this->has_param_type (node, AST_Argument::dir_OUT) || + !this->void_return_type (bt)) + { + os->indent (); + + // demarshal the inout and out arguments and return values + *os << "if (!(\n" << be_idt; + + // demarshal + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DEMARSHAL_CS); + ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_compiled_visitor_operation_ami_handler_servant_operation_cs::" + "gen_demarshal_params - " + "codegen for demarshal failed\n"), + -1); + } + + // Print the && if there are OUT or INOUT arguements in the + // signature. + if (this->has_param_type (node, AST_Argument::dir_OUT) || + this->has_param_type (node, AST_Argument::dir_INOUT)) + *os << " &&\n"; + + // marshal each in and inout argument + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS); + ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_compiled_visitor_operation_ami_handler_servant_operation_cs::" + "gen_demarshal_params - " + "codegen for demarshal failed\n"), + -1); + } + *os << be_uidt_nl << "))\n" << be_idt; + + // if marshaling fails, raise exception + if (this->gen_raise_exception (bt, "CORBA::MARSHAL", + "", + "ACE_TRY_ENV") == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_compiled_visitor_operation_ami_handler_servant_operation_cs::" + "gen_marshal_and invoke - " + "codegen for return var failed\n"), + -1); + } + *os << be_uidt << "\n"; + + }; + + return 0; +} + +int +be_compiled_visitor_operation_ami_handler_servant_operation_cs::gen_marshal_params (be_operation *, + be_type *) +{ + // because we do not want to return something. + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp index d6936926da6..7828662ff7f 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp @@ -145,8 +145,6 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod *os << "ACE_CHECK;" << be_nl << be_nl << "// @@ Error handling " << be_nl << be_nl; - *os << "//Demarshall all the arguments.\n"; - // declare a return type variable ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS); @@ -402,57 +400,58 @@ gen_marshal_and_invoke (be_operation *node, os->indent (); - *os << "if (!(\n" << be_idt << be_idt << be_idt; - - if (!this->void_return_type (bt)) + *os << "// Demarshall all the arguments.\n"; + if (!this->void_return_type (bt) + || this->has_param_type (node, AST_Argument::dir_INOUT) + || this->has_param_type (node, AST_Argument::dir_OUT)) { - // demarshal the return val - ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DEMARSHAL_CS); - ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT); - visitor = tao_cg->make_visitor (&ctx); - if (!visitor || (node->accept (visitor) == -1)) + *os << "if (!(\n" << be_idt << be_idt << be_idt; + + if (!this->void_return_type (bt)) { + // demarshal the return val + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DEMARSHAL_CS); + ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_compiled_visitor_operation_ami_handler_skeleton_cs::" + "gen_demarshal_params - " + "codegen for return var failed\n"), + -1); + } delete visitor; - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_compiled_visitor_operation_ami_handler_skeleton_cs::" - "gen_demarshal_params - " - "codegen for return var failed\n"), - -1); } - delete visitor; - // Print the && if there are OUT or INOUT arguements in the - // signature. - if (this->has_param_type (node, AST_Argument::dir_OUT) || - this->has_param_type (node, AST_Argument::dir_INOUT)) - *os << " &&\n"; - } - - if (this->has_param_type (node, AST_Argument::dir_INOUT) || - this->has_param_type (node, AST_Argument::dir_OUT)) - { - // demarshal each in and inout argument - ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS); - ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT); - visitor = tao_cg->make_visitor (&ctx); - if (!visitor || (node->accept (visitor) == -1)) + if (this->has_param_type (node, AST_Argument::dir_INOUT) || + this->has_param_type (node, AST_Argument::dir_OUT)) { + *os << " &&\n"; + + // demarshal each in and inout argument + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS); + ctx.sub_state (TAO_CodeGen::TAO_CDR_INPUT); + visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_compiled_visitor_operation_ami_handler_skeleton_cs::" + "gen_marshal_params - " + "codegen for args failed\n"), + -1); + } delete visitor; - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_compiled_visitor_operation_ami_handler_skeleton_cs::" - "gen_marshal_params - " - "codegen for args failed\n"), - -1); } - delete visitor; + *os << be_uidt << be_uidt_nl + << " ))" << be_nl + << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt_nl << be_nl; } - *os << be_uidt << be_uidt_nl - << " ))" << be_nl - << "ACE_THROW (CORBA::MARSHAL ());" << be_uidt_nl << be_nl; - // Invoke the callback method *os << "// Invoke the call back method." << be_nl << "_tao_reply_handler_object->" diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_ch.cpp new file mode 100644 index 00000000000..dae79c4beba --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_ch.cpp @@ -0,0 +1,101 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// ami_handler_thru_poa_collocated_ch.cpp +// +// = DESCRIPTION +// Visitor generating code for thru_poa_collocated operation in the client stub +// Special code for the AMI Reply Handler +// +// = AUTHOR +// Aniruddha Gokhale +// Michael Kircher +// +// ============================================================================ + +#include "idl.h" +#include "idl_extern.h" +#include "be.h" + +#include "be_visitor_operation.h" + +ACE_RCSID(be_visitor_operation, ami_handler_thru_poa_collocated_ch, "$Id$") + + +// ************************************************************************* +// be_visitor_operation_ami_handler_thru_poa_collocated_ch -- +// This visitor generates code for the thru_poa_collocated operation signature in a +// server header file +// ************************************************************************* + +be_visitor_operation_ami_handler_thru_poa_collocated_ch::be_visitor_operation_ami_handler_thru_poa_collocated_ch +(be_visitor_context *ctx) + : be_visitor_scope (ctx) +{ +} + +be_visitor_operation_ami_handler_thru_poa_collocated_ch::~be_visitor_operation_ami_handler_thru_poa_collocated_ch (void) +{ +} + +int be_visitor_operation_ami_handler_thru_poa_collocated_ch::visit_operation (be_operation *node) +{ + TAO_OutStream *os; // output stream + be_type *bt; // type node representing the return type + + os = this->ctx_->stream (); + this->ctx_->node (node); // save the node + + os->indent (); // start with the current indentation level + + // every operation is declared virtual in the client code + *os << "virtual "; + + // STEP I: generate the return type + bt = be_type::narrow_from_decl (node->return_type ()); + if (!bt) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_sh::" + "visit_operation - " + "Bad return type\n"), + -1); + } + + // STEP 2: generate the operation name + *os << "void " << node->local_name (); + + // STEP 3: generate the argument list with the appropriate mapping. For these + // we grab a visitor that generates the parameter listing + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH); + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_operation_sh::" + "visit_operation - " + "Bad visitor to return type\n"), + -1); + } + + if (node->accept (visitor) == -1) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_sh::" + "visit_operation - " + "codegen for argument list failed\n"), + -1); + } + delete visitor; + + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_cs.cpp new file mode 100644 index 00000000000..d9d86773fff --- /dev/null +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_cs.cpp @@ -0,0 +1,200 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// ami_handler_thru_poa_collocated_cs.cpp +// +// = DESCRIPTION +// Visitor generating code for thru_poa_collocated Operation in the skeleton. +// +// = AUTHOR +// Aniruddha Gokhale +// Michael Kircher +// +// ============================================================================ + +#include "idl.h" +#include "idl_extern.h" +#include "be.h" + +#include "be_visitor_operation.h" + +ACE_RCSID(be_visitor_operation, ami_handler_thru_poa_collocated_cs, "$Id$") + + +// ************************************************************************* +// be_visitor_operation_ami_handler_thru_poa_collocated_cs -- +// This visitor generates code for the thru_poa_collocated operation signature in a +// server skeletons file +// ************************************************************************* + +be_visitor_operation_ami_handler_thru_poa_collocated_cs::be_visitor_operation_ami_handler_thru_poa_collocated_cs +(be_visitor_context *ctx) + : be_visitor_scope (ctx) +{ +} + +be_visitor_operation_ami_handler_thru_poa_collocated_cs::~be_visitor_operation_ami_handler_thru_poa_collocated_cs (void) +{ +} + +int be_visitor_operation_ami_handler_thru_poa_collocated_cs::visit_operation (be_operation *node) +{ + TAO_OutStream *os = this->ctx_->stream (); + + // We need the interface node in which this operation was defined. However, + // if this operation node was an attribute node in disguise, we get this + // information from the context + be_interface *intf; + intf = this->ctx_->attribute () + ? be_interface::narrow_from_scope (this->ctx_->attribute ()->defined_in ()) + : be_interface::narrow_from_scope (node->defined_in ()); + + if (!intf) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_thru_poa_collocated_cs::" + "visit_operation - " + "bad interface scope\n"), + -1); + } + + // retrieve the operation return type + be_type *bt = be_type::narrow_from_decl (node->return_type ()); + if (!bt) + { + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_thru_poa_collocated_cs::" + "visit_operation - " + "Bad return type\n"), + -1); + } + + + + *os << "void " << intf->full_coll_name (be_interface::THRU_POA) << "::" + << node->local_name () << " "; + + // Generate the argument list with the appropriate mapping (same as + // in the header file) + // Generate the argument list with the appropriate mapping (same as + // in the header file). + be_visitor_context ctx (*this->ctx_); + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CS); + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if ((!visitor) || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_thru_poa_collocated_cs::" + "visit_operation - " + "codegen for argument list failed\n"), + -1); + } + delete visitor; + + + *os << "{" << be_idt_nl; + + // @@ Michael: Not sure about this one. +#if 0 + if (!idl_global->exception_support ()) + *os << "ACE_DECLARE_NEW_CORBA_ENV;" << be_nl; +#endif /* 0 */ + + *os <<"TAO_Object_Adapter::Servant_Upcall servant_upcall (" + << be_idt << be_idt_nl + << "*this->_stubobj ()->servant_orb_var ()->orb_core ()->object_adapter ()" + << be_uidt_nl + << ");" << be_uidt_nl + << "servant_upcall.prepare_for_upcall (" << be_idt << be_idt_nl + << "this->_object_key ()," << be_nl + << "\"" << node->original_local_name () << "\""; + if (!idl_global->exception_support ()) + *os << "," << be_nl + << "ACE_TRY_ENV" << be_uidt_nl + << ");\n" << be_uidt; + else + *os << be_uidt_nl << ");\n" << be_uidt; + + // check if there is an exception + if (!idl_global->exception_support ()) + { + os->indent (); + *os << "ACE_CHECK;\n"; + } + + os->indent (); + *os << "ACE_reinterpret_cast (" << be_idt << be_idt_nl + << intf->full_skel_name () << "_ptr," << be_nl + << "servant_upcall.servant ()->_downcast (" << be_idt << be_idt_nl + << "\"" << intf->repoID () << "\"" << be_uidt_nl + << ")" << be_uidt << be_uidt_nl + << ")" << be_uidt; + + if (this->gen_invoke (ctx, node) == -1) + return -1; + + os->indent (); + *os << "return;"; + + *os << be_uidt_nl + << "}\n\n"; + + return 0; +} + +int be_visitor_operation_ami_handler_thru_poa_collocated_cs::gen_invoke (be_visitor_context &ctx, + be_operation *node) +{ + TAO_OutStream *os = this->ctx_->stream (); + + *os << "->" << node->local_name () << " (" + << be_idt << be_idt << "\n"; + + // retrieve the operation return type + be_type *bt = be_type::narrow_from_decl (node->return_type ()); + if (!this->void_return_type (bt)) + { + os->indent (); + *os << "_tao_retval,\n"; + } + + ctx = *this->ctx_; + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_CS); + be_visitor *visitor = tao_cg->make_visitor (&ctx); + if (!visitor || (node->accept (visitor) == -1)) + { + delete visitor; + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) be_visitor_operation_ami_handler_thru_poa_collocated_cs::" + "gen_invoke - " + "codegen for making upcall failed\n"), + -1); + } + + // end the upcall + *os << be_uidt_nl + << ");\n" << be_uidt; + return 0; +} + + +int +be_visitor_operation_ami_handler_thru_poa_collocated_cs::void_return_type (be_type *bt) +{ + // is the operation return type void? + + if (bt->node_type () == AST_Decl::NT_pre_defined + && (be_predefined_type::narrow_from_decl (bt)->pt () + == AST_PredefinedType::PT_void)) + return 1; + else + return 0; +} diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp index a36fd00d9a4..c50bd87c007 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp @@ -61,6 +61,7 @@ be_visitor_operation_argument::post_process (be_decl *bd) case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS: *os << ",\n"; break; + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_CS: case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS: { // @@ Michael @@ -68,7 +69,8 @@ be_visitor_operation_argument::post_process (be_decl *bd) // print a comma for in arguments. // This is due to the concept of post processing, // which I was not able to prevent to be executed - // in the case of in arguments. + // in the case of in arguments. Post processing + // does always write a comma, though. be_argument *arg = this->ctx_->be_node_as_argument (); ACE_ASSERT (arg != 0); if (arg->direction () != AST_Argument::dir_IN) @@ -105,7 +107,6 @@ be_visitor_operation_argument::visit_operation (be_operation *node) { case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS: case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS: - case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS: // applicable only to these cases where the actual upcall is made // last argument is the environment @@ -115,6 +116,11 @@ be_visitor_operation_argument::visit_operation (be_operation *node) os->indent (); *os << "ACE_TRY_ENV"; break; + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_CS: + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS: + os->indent (); + *os << "ACE_TRY_ENV"; + break; default: break; } @@ -173,9 +179,6 @@ be_visitor_operation_argument::visit_argument (be_argument *node) case TAO_CodeGen::TAO_AMI_OPERATION_ARG_INVOKE_CS: ctx.state (TAO_CodeGen::TAO_AMI_ARGUMENT_INVOKE_CS); break; -// @@ Michael case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_INVOKE_CS: -// ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS); -// break; case TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_CS: ctx.state (TAO_CodeGen::TAO_ARGUMENT_POST_INVOKE_CS); break; @@ -206,6 +209,9 @@ be_visitor_operation_argument::visit_argument (be_argument *node) case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS: ctx.state (TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS); break; + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_CS: + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_COLLOCATED_UPCALL_CS); + break; case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS: ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS); break; @@ -215,9 +221,6 @@ be_visitor_operation_argument::visit_argument (be_argument *node) case TAO_CodeGen::TAO_OPERATION_ARG_POST_MARSHAL_SS: ctx.state (TAO_CodeGen::TAO_ARGUMENT_POST_MARSHAL_SS); break; - // case TAO_CodeGen::TAO_OPERATION_ARG_AMI: - // ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI); - // break; default: { ACE_ERROR_RETURN ((LM_ERROR, diff --git a/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp b/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp index 700c11a34ed..756964eacbd 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument_marshal.cpp @@ -212,7 +212,7 @@ be_visitor_compiled_args_decl::visit_array (be_array *node) } // for anonymous arrays, the type name has a _ prepended. We compute - // the fullname with or without the underscore and use it later on. + // the full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and ACE_OS::memset (fname, '\0', NAMEBUFSIZE); @@ -228,18 +228,18 @@ be_visitor_compiled_args_decl::visit_array (be_array *node) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", node->fullname ()); + ACE_OS::sprintf (fname, "_%s", node->full_name ()); } } else { // typedefed node - ACE_OS::sprintf (fname, "%s", node->fullname ()); + ACE_OS::sprintf (fname, "%s", node->full_name ()); } if (f->direction () != AST_Argument::dir_IN) diff --git a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp index 771706f01af..86c35484097 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/exceptlist_cs.cpp @@ -50,7 +50,7 @@ be_visitor_operation_exceptlist_cs::visit_operation (be_operation *node) if (node->exceptions ()) { os->indent (); - *os << "static TAO_Exception_Data " << "_tao_" << node->flatname () + *os << "static TAO_Exception_Data " << "_tao_" << node->flat_name () << "_exceptiondata [] = " << be_nl; *os << "{" << be_idt_nl; // initialize an iterator to iterate thru the exception list diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ami_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ami_cs.cpp index 9db88553f3d..f55999f91f5 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ami_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ami_cs.cpp @@ -81,7 +81,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node) -1); // Generate the scope::operation name. - *os << parent->fullname () + *os << parent->full_name () << "::" << "sendc_" << node->local_name ()->get_string (); @@ -369,7 +369,7 @@ be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () << + *os << node->flat_name () << "_paramdata [] = " << be_nl; *os << "{\n"; os->incr_indent (); @@ -390,7 +390,7 @@ be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node, } *os << "\n"; os->decr_indent (); - *os << "}; // " << node->flatname () << "_paramdata\n\n"; + *os << "}; // " << node->flat_name () << "_paramdata\n\n"; // Check if this operation raises any exceptions. In that case, we must // generate a list of exception typecodes. This is not valid for @@ -423,7 +423,7 @@ be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () + *os << node->flat_name () << "_calldata = " << be_nl << "{" << "\""; @@ -461,7 +461,7 @@ be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () << "_paramdata, "; + *os << node->flat_name () << "_paramdata, "; // insert exception list (if any) - node for attributes if (this->ctx_->attribute ()) @@ -471,7 +471,7 @@ be_interpretive_visitor_operation_ami_cs::gen_pre_stub_info (be_operation *node, if (node->exceptions ()) { *os << node->exceptions ()->length () - << ", _tao_" << node->flatname () << "_exceptiondata};\n\n"; + << ", _tao_" << node->flat_name () << "_exceptiondata};\n\n"; } else *os << "0, 0};\n\n"; @@ -537,7 +537,7 @@ be_interpretive_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation else *os << "_get_"; } - *os << node->flatname () << "_calldata," << be_nl + *os << node->flat_name () << "_calldata," << be_nl << "_tao_arguments" << be_uidt_nl << ");\n"; @@ -731,7 +731,7 @@ be_compiled_visitor_operation_ami_cs::gen_marshal_and_invoke (be_operation { if (node->exceptions ()) { - *os << "_tao_call.invoke (_tao_" << node->flatname () + *os << "_tao_call.invoke (_tao_" << node->flat_name () << "_exceptiondata, " << node->exceptions ()->length () << ", ACE_TRY_ENV);"; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp index b992f6afc2f..f3e46b3eb18 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_cs.cpp @@ -404,7 +404,7 @@ be_interpretive_visitor_operation_cs::gen_pre_stub_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () << + *os << node->flat_name () << "_paramdata [] = " << be_nl; *os << "{\n"; os->incr_indent (); @@ -425,7 +425,7 @@ be_interpretive_visitor_operation_cs::gen_pre_stub_info (be_operation *node, } *os << "\n"; os->decr_indent (); - *os << "}; // " << node->flatname () << "_paramdata\n\n"; + *os << "}; // " << node->flat_name () << "_paramdata\n\n"; // Check if this operation raises any exceptions. In that case, we must // generate a list of exception typecodes. This is not valid for @@ -458,7 +458,7 @@ be_interpretive_visitor_operation_cs::gen_pre_stub_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () + *os << node->flat_name () << "_calldata = " << be_nl << "{" << "\""; @@ -496,7 +496,7 @@ be_interpretive_visitor_operation_cs::gen_pre_stub_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () << "_paramdata, "; + *os << node->flat_name () << "_paramdata, "; // insert exception list (if any) - node for attributes if (this->ctx_->attribute ()) @@ -506,7 +506,7 @@ be_interpretive_visitor_operation_cs::gen_pre_stub_info (be_operation *node, if (node->exceptions ()) { *os << node->exceptions ()->length () - << ", _tao_" << node->flatname () << "_exceptiondata};\n\n"; + << ", _tao_" << node->flat_name () << "_exceptiondata};\n\n"; } else *os << "0, 0};\n\n"; @@ -572,7 +572,7 @@ be_interpretive_visitor_operation_cs::gen_marshal_and_invoke (be_operation else *os << "_get_"; } - *os << node->flatname () << "_calldata," << be_nl + *os << node->flat_name () << "_calldata," << be_nl << "_tao_arguments" << be_uidt_nl << ");\n"; @@ -767,7 +767,7 @@ be_compiled_visitor_operation_cs::gen_marshal_and_invoke (be_operation { if (node->exceptions ()) { - *os << "_tao_call.invoke (_tao_" << node->flatname () + *os << "_tao_call.invoke (_tao_" << node->flat_name () << "_exceptiondata, " << node->exceptions ()->length () << ", ACE_TRY_ENV);"; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp index 4e366f6ef46..80550703004 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_is.cpp @@ -90,12 +90,12 @@ be_visitor_operation_is::visit_operation (be_operation *node) delete visitor; - ACE_CString str(node->flatname ()); + ACE_CString str(node->flat_name ()); int lnmlength = ACE_OS::strlen (node->local_name ()->get_string ()); - int fnmlength = ACE_OS::strlen (node->flatname ()); + int fnmlength = ACE_OS::strlen (node->flat_name ()); fnmlength--; char * classname = str.substr (0,(fnmlength-lnmlength) ).rep (); diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp index d4ac4d925ed..172fe6e66a2 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp @@ -406,7 +406,7 @@ be_interpretive_visitor_operation_ss::gen_pre_skel_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () << + *os << node->flat_name () << "_paramdata [] = " << be_nl; *os << "{\n"; os->incr_indent (); @@ -427,7 +427,7 @@ be_interpretive_visitor_operation_ss::gen_pre_skel_info (be_operation *node, } *os << "\n"; os->decr_indent (); - *os << "}; // " << node->flatname () << "_paramdata\n\n"; + *os << "}; // " << node->flat_name () << "_paramdata\n\n"; // now generate the calldata table os->indent (); @@ -441,7 +441,7 @@ be_interpretive_visitor_operation_ss::gen_pre_skel_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () + *os << node->flat_name () << "_calldata = " << be_nl << "{" << "\""; @@ -479,7 +479,7 @@ be_interpretive_visitor_operation_ss::gen_pre_skel_info (be_operation *node, else *os << "_get_"; } - *os << node->flatname () << "_paramdata};\n\n"; + *os << node->flat_name () << "_paramdata};\n\n"; return 0; } @@ -506,7 +506,7 @@ be_interpretive_visitor_operation_ss::gen_demarshal_params (be_operation *node, else *os << "_get_"; } - *os << node->flatname () << "_calldata,\n"; + *os << node->flat_name () << "_calldata,\n"; // pass the appropriate return value to the demarshal operation ctx = *this->ctx_; @@ -572,7 +572,7 @@ be_interpretive_visitor_operation_ss::gen_marshal_params (be_operation *node, else *os << "_get_"; } - *os << node->flatname () << "_calldata,\n"; + *os << node->flat_name () << "_calldata,\n"; // pass the appropriate return value to the marshal operation ctx = *this->ctx_; diff --git a/TAO/TAO_IDL/be/be_visitor_rettype.cpp b/TAO/TAO_IDL/be/be_visitor_rettype.cpp index eb1cf5095d9..623a95e3e0a 100644 --- a/TAO/TAO_IDL/be/be_visitor_rettype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_rettype.cpp @@ -79,7 +79,7 @@ be_visitor_rettype_ami_handler_result_arg::visit_type (be_type *node) os->indent (); // start from current indentation level // generate the typecode information here - *os << "static const CORBA::Long _oc_" << node->flatname () << "[] =" + *os << "static const CORBA::Long _oc_" << node->flat_name () << "[] =" << be_nl; *os << "{" << be_idt << "\n"; @@ -102,7 +102,7 @@ be_visitor_rettype_ami_handler_result_arg::visit_type (be_type *node) } *os << be_uidt << "};" << be_nl; - *os << "static CORBA::TypeCode _tc_TAO_tc_" << node->flatname () + *os << "static CORBA::TypeCode _tc_TAO_tc_" << node->flat_name () << " ("; switch (node->node_type ()) { @@ -134,8 +134,8 @@ be_visitor_rettype_ami_handler_result_arg::visit_type (be_type *node) return -1; // error } - *os << ", sizeof (_oc_" << node->flatname () - << "), (char *) &_oc_" << node->flatname () + *os << ", sizeof (_oc_" << node->flat_name () + << "), (char *) &_oc_" << node->flat_name () << ", 0, sizeof (" << node->name () << "));" << be_nl; // is our enclosing scope a module? We need this check because for @@ -155,7 +155,7 @@ be_visitor_rettype_ami_handler_result_arg::visit_type (be_type *node) } *os << "TAO_NAMESPACE_DEFINE (CORBA::TypeCode_ptr, _tc_" << node->local_name () << ", &_tc_TAO_tc_" - << node->flatname () << ")" << be_nl; + << node->flat_name () << ")" << be_nl; if (this->gen_nested_namespace_end (module) == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -168,7 +168,7 @@ be_visitor_rettype_ami_handler_result_arg::visit_type (be_type *node) { // outermost scope. *os << "CORBA::TypeCode_ptr " << node->tc_name () << " = &_tc_TAO_tc_" - << node->flatname () << ";\n\n"; + << node->flat_name () << ";\n\n"; } return 0; } @@ -3007,8 +3007,8 @@ queue_lookup (ACE_Unbounded_Queue <be_visitor_typecode_defn::QNode *> &queue, iter.next (addr); item = *addr; - if (!ACE_OS::strcmp (item->node->fullname (), - node->fullname ())) + if (!ACE_OS::strcmp (item->node->full_name (), + node->full_name ())) { // found return item; diff --git a/TAO/TAO_IDL/be/be_visitor_scope.cpp b/TAO/TAO_IDL/be/be_visitor_scope.cpp index 318235619df..c9dc965c01b 100644 --- a/TAO/TAO_IDL/be/be_visitor_scope.cpp +++ b/TAO/TAO_IDL/be/be_visitor_scope.cpp @@ -119,7 +119,7 @@ be_visitor_scope::visit_scope (be_scope *node) // For debugging the prefix... be_decl* decl = node->decl (); ACE_DEBUG ((LM_DEBUG, "Enter scope <%s> : [%s]\n", - decl->fullname (), decl->prefix ())); + decl->full_name (), decl->prefix ())); if (decl->pragmas () != 0) { for (UTL_StrlistActiveIterator i(decl->pragmas ()); diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp index fd72bd07aa9..01bdb3627b0 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ch.cpp @@ -58,9 +58,9 @@ be_visitor_sequence_cdr_op_ch::visit_sequence (be_sequence *node) // being declared more than once. if (!tdef) { - *os << "\n#if !defined _TAO_CDR_OP_" - << node->flatname () << "_H_" << be_nl - << "#define _TAO_CDR_OP_" << node->flatname () << "_H_\n\n"; + *os << "\n#if !defined _TAO_CDR_OP_" + << node->flat_name () << "_H_" << be_nl + << "#define _TAO_CDR_OP_" << node->flat_name () << "_H_\n\n"; } *os << "CORBA::Boolean " << idl_global->stub_export_macro () @@ -76,8 +76,8 @@ be_visitor_sequence_cdr_op_ch::visit_sequence (be_sequence *node) if (!tdef) { - *os << "#endif /* _TAO_CDR_OP_" - << node->flatname () << "_H_ */\n\n"; + *os << "#endif /* _TAO_CDR_OP_" + << node->flat_name () << "_H_ */\n\n"; } node->cli_hdr_cdr_op_gen (1); diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp index 2cc13a9f049..a1348b531d0 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_ci.cpp @@ -62,9 +62,9 @@ be_visitor_sequence_cdr_op_ci::visit_sequence (be_sequence *node) // being declared more than once. if (!tdef) { - *os << "\n#if !defined _TAO_CDR_OP_" - << node->flatname () << "_I_" << be_nl - << "#define _TAO_CDR_OP_" << node->flatname () << "_I_\n\n"; + *os << "\n#if !defined _TAO_CDR_OP_" + << node->flat_name () << "_I_" << be_nl + << "#define _TAO_CDR_OP_" << node->flat_name () << "_I_\n\n"; } *os << "CORBA::Boolean " << idl_global->stub_export_macro () @@ -80,8 +80,8 @@ be_visitor_sequence_cdr_op_ci::visit_sequence (be_sequence *node) if (!tdef) { - *os << "#endif /* _TAO_CDR_OP_" - << node->flatname () << "_I_ */\n\n"; + *os << "#endif /* _TAO_CDR_OP_" + << node->flat_name () << "_I_ */\n\n"; } node->cli_inline_cdr_op_gen (1); diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp index f5baff48ba0..9144cd45fbf 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp @@ -81,9 +81,9 @@ be_visitor_sequence_cdr_op_cs::visit_sequence (be_sequence *node) // being declared more than once. if (!tdef) { - *os << "\n#if !defined _TAO_CDR_OP_" - << node->flatname () << "_CPP_" << be_nl - << "#define _TAO_CDR_OP_" << node->flatname () << "_CPP_\n\n"; + *os << "\n#if !defined _TAO_CDR_OP_" + << node->flat_name () << "_CPP_" << be_nl + << "#define _TAO_CDR_OP_" << node->flat_name () << "_CPP_\n\n"; } // set the sub state as generating code for the output operator @@ -177,8 +177,8 @@ be_visitor_sequence_cdr_op_cs::visit_sequence (be_sequence *node) if (!tdef) { - *os << "#endif /* _TAO_CDR_OP_" - << node->flatname () << "_CPP_ */\n\n"; + *os << "#endif /* _TAO_CDR_OP_" + << node->flat_name () << "_CPP_ */\n\n"; } node->cli_stub_cdr_op_gen (1); diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp index 8f4c05ee2a1..c98182f2f24 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_ci.cpp @@ -63,7 +63,7 @@ be_visitor_sequence_ci::gen_bounded_obj_sequence (be_sequence *node) if (node->is_nested ()) { ACE_OS::sprintf (full_class_name, "%s::%s", - be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (), + be_scope::narrow_from_scope (node->defined_in ())->decl ()->full_name (), class_name); } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp index 8ff1a215796..3e21c77dc46 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_obj_sequence_cs.cpp @@ -63,7 +63,7 @@ be_visitor_sequence_cs::gen_bounded_obj_sequence (be_sequence *node) if (node->is_nested ()) { ACE_OS::sprintf (full_class_name, "%s::%s", - be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (), + be_scope::narrow_from_scope (node->defined_in ())->decl ()->full_name (), class_name); } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp index 167d7a4b79c..7a6528965b2 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_ci.cpp @@ -64,7 +64,7 @@ be_visitor_sequence_ci::gen_bounded_sequence (be_sequence *node) if (node->is_nested ()) { ACE_OS::sprintf (full_class_name, "%s::%s", - be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (), + be_scope::narrow_from_scope (node->defined_in ())->decl ()->full_name (), class_name); } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp index 0b72e049306..6b9a02512ce 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_sequence_cs.cpp @@ -64,7 +64,7 @@ be_visitor_sequence_cs::gen_bounded_sequence (be_sequence *node) if (node->is_nested ()) { ACE_OS::sprintf (full_class_name, "%s::%s", - be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (), + be_scope::narrow_from_scope (node->defined_in ())->decl ()->full_name (), class_name); } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp index bc74e1f12de..1ca16ecb0a3 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_ci.cpp @@ -52,7 +52,7 @@ be_visitor_sequence_ci::gen_bounded_str_sequence (be_sequence *node) if (node->is_nested ()) { ACE_OS::sprintf (full_class_name, "%s::%s", - be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (), + be_scope::narrow_from_scope (node->defined_in ())->decl ()->full_name (), class_name); } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp index 07a34995988..c93c81acee2 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_bounded_str_sequence_cs.cpp @@ -52,7 +52,7 @@ be_visitor_sequence_cs::gen_bounded_str_sequence (be_sequence *node) if (node->is_nested ()) { ACE_OS::sprintf (full_class_name, "%s::%s", - be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (), + be_scope::narrow_from_scope (node->defined_in ())->decl ()->full_name (), class_name); } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp index 16d8728477c..699d35a414e 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_ci.cpp @@ -66,7 +66,7 @@ be_visitor_sequence_ci::gen_unbounded_obj_sequence (be_sequence *node) if (node->is_nested ()) { ACE_OS::sprintf (full_class_name, "%s::%s", - be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (), + be_scope::narrow_from_scope (node->defined_in ())->decl ()->full_name (), class_name); } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp index b42030ec7ab..7ced25811f3 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_obj_sequence_cs.cpp @@ -66,7 +66,7 @@ be_visitor_sequence_cs::gen_unbounded_obj_sequence (be_sequence *node) if (node->is_nested ()) { ACE_OS::sprintf (full_class_name, "%s::%s", - be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (), + be_scope::narrow_from_scope (node->defined_in ())->decl ()->full_name (), class_name); } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp index 9348769b863..954525463c6 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_ci.cpp @@ -65,7 +65,7 @@ be_visitor_sequence_ci::gen_unbounded_sequence (be_sequence *node) if (node->is_nested ()) { ACE_OS::sprintf (full_class_name, "%s::%s", - be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (), + be_scope::narrow_from_scope (node->defined_in ())->decl ()->full_name (), class_name); } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp index 93c7138ba1a..703561c80b3 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/gen_unbounded_sequence_cs.cpp @@ -65,7 +65,7 @@ be_visitor_sequence_cs::gen_unbounded_sequence (be_sequence *node) if (node->is_nested ()) { ACE_OS::sprintf (full_class_name, "%s::%s", - be_scope::narrow_from_scope (node->defined_in ())->decl ()->fullname (), + be_scope::narrow_from_scope (node->defined_in ())->decl ()->full_name (), class_name); } else diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp index 4afb9114834..60063ab9412 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ch.cpp @@ -249,7 +249,7 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) // end of instantiation // generate the ifdefined macro for the sequence type - os->gen_ifdef_macro (node->flatname ()); + os->gen_ifdef_macro (node->flat_name ()); os->indent (); // start with the current indentation level @@ -390,7 +390,7 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) os->gen_endif (); // endif macro // generate the ifdefined macro for the var type - os->gen_ifdef_macro (node->flatname (), "_var"); + os->gen_ifdef_macro (node->flat_name (), "_var"); // generate the var and out types if (this->gen_var_defn (node) == -1) @@ -404,7 +404,7 @@ int be_visitor_sequence_ch::visit_sequence (be_sequence *node) os->gen_endif (); // generate the ifdefined macro for the _out type - os->gen_ifdef_macro (node->flatname (), "_out"); + os->gen_ifdef_macro (node->flat_name (), "_out"); if (this->gen_out_defn (node) == -1) { diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp index d30852ffa11..54e6a1d3c44 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_ci.cpp @@ -63,7 +63,7 @@ be_visitor_sequence_ci::visit_sequence (be_sequence *node) // end of instantiation // generate the ifdefined macro for the sequence type - os->gen_ifdef_macro (node->flatname ()); + os->gen_ifdef_macro (node->flat_name ()); // all we do is generate the _var and _out implementations if (this->gen_var_impl (node) == -1) @@ -180,7 +180,7 @@ be_visitor_sequence_ci::gen_var_impl (be_sequence *node) ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", node->fullname ()); + ACE_OS::sprintf (fname, "%s_var", node->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); ACE_OS::sprintf (lname, "%s_var", node->local_name ()->get_string ()); @@ -420,7 +420,7 @@ be_visitor_sequence_ci::gen_out_impl (be_sequence *node) ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", node->fullname ()); + ACE_OS::sprintf (fname, "%s_out", node->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); ACE_OS::sprintf (lname, "%s_out", node->local_name ()->get_string ()); diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp index d74ffea45d1..254bfed4526 100644 --- a/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_sequence/sequence_cs.cpp @@ -162,7 +162,7 @@ int be_visitor_sequence_cs::visit_sequence (be_sequence *node) // end of instantiation // generate the ifdefined macro for the sequence type - os->gen_ifdef_macro (node->flatname ()); + os->gen_ifdef_macro (node->flat_name ()); os->indent (); // start with the current indentation level diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp index 79fd133600f..a99d30f2df8 100644 --- a/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp +++ b/TAO/TAO_IDL/be/be_visitor_typecode/typecode_defn.cpp @@ -101,6 +101,11 @@ be_visitor_typecode_defn::visit_type (be_type *node) { TAO_OutStream *os = this->ctx_->stream (); + char *flat_name = 0; + node->compute_flat_name ("AMI_", + "_Handler", + flat_name); + // reset the queue this->queue_reset (this->tc_queue_); this->tc_offset_ = 0; @@ -127,9 +132,9 @@ be_visitor_typecode_defn::visit_type (be_type *node) // Flat name generation. if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN) - *os << node->compute_flatname ("AMI_", "_Handler"); + *os << flat_name; else - *os << node->flatname (); + *os << node->flat_name (); *os << "[] =" << be_nl; *os << "{" << be_idt << "\n"; @@ -161,9 +166,9 @@ be_visitor_typecode_defn::visit_type (be_type *node) // Flat name generation. if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN) - *os << node->compute_flatname ("AMI_", "_Handler"); + *os << flat_name; else - *os << node->flatname (); + *os << node->flat_name (); *os << " ("; @@ -201,17 +206,17 @@ be_visitor_typecode_defn::visit_type (be_type *node) // Flat name generation. if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN) - *os << node->compute_flatname ("AMI_", "_Handler"); + *os << flat_name; else - *os << node->flatname (); + *os << node->flat_name (); *os << "), (char *) &_oc_"; // Flat name generation. if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN) - *os << node->compute_flatname ("AMI_", "_Handler"); + *os << flat_name; else - *os << node->flatname (); + *os << node->flat_name (); // Name generation. if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN) @@ -246,9 +251,9 @@ be_visitor_typecode_defn::visit_type (be_type *node) // Flat name generation. if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN) - *os << node->compute_flatname ("AMI_", "_Handler"); + *os << flat_name; else - *os << node->flatname (); + *os << node->flat_name (); *os << ")" << be_nl; @@ -275,12 +280,14 @@ be_visitor_typecode_defn::visit_type (be_type *node) // Flat name generation. if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN) - *os << node->compute_flatname ("AMI_", "_Handler"); + *os << flat_name; else - *os << node->flatname (); + *os << node->flat_name (); *os << ";\n\n"; } + + delete [] flat_name; return 0; } @@ -2839,6 +2846,11 @@ be_visitor_typecode_defn::gen_repoID (be_decl *node) TAO_OutStream *os = this->ctx_->stream (); int flag = 0; + char *repoID = 0; + node->compute_repoID ("AMI_", + "_Handler", + repoID); + // check if we want to generate optimized typecodes. In such a case, there is // no need to generate the repoID (unless we are an object reference or an // exception in which case it is mandatory to have the repository ID) @@ -2878,7 +2890,7 @@ be_visitor_typecode_defn::gen_repoID (be_decl *node) // repoID generation. if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN) - *os << node->compute_repoID ("AMI_", "_Handler"); + *os << repoID; else *os << node->repoID (); @@ -2890,14 +2902,14 @@ be_visitor_typecode_defn::gen_repoID (be_decl *node) // Unoptimized case. if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN) - *os << (ACE_OS::strlen (node->compute_repoID ("AMI_", "_Handler")) + 1) << ", "; + *os << (ACE_OS::strlen (repoID) + 1) << ", "; else *os << (ACE_OS::strlen (node->repoID ()) + 1) << ", "; ACE_CDR::ULong *arr, i, arrlen; if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN) - (void) this->tc_name2long (node->compute_repoID ("AMI_", "_Handler"), arr, arrlen); + (void) this->tc_name2long (repoID, arr, arrlen); else (void) this->tc_name2long (node->repoID (), arr, arrlen); @@ -2908,7 +2920,7 @@ be_visitor_typecode_defn::gen_repoID (be_decl *node) // Comment. if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_TYPECODE_DEFN) - *os << " // repository ID = " << node->compute_repoID ("AMI_", "_Handler"); + *os << " // repository ID = " << repoID; else *os << " // repository ID = " << node->repoID (); @@ -2916,6 +2928,9 @@ be_visitor_typecode_defn::gen_repoID (be_decl *node) this->tc_offset_ += (arrlen + 1) * sizeof (ACE_CDR::ULong); } *os << "\n"; + + delete repoID; + return; } @@ -3136,8 +3151,8 @@ queue_lookup (ACE_Unbounded_Queue <be_visitor_typecode_defn::QNode *> &queue, iter.next (addr); item = *addr; - if (!ACE_OS::strcmp (item->node->fullname (), - node->fullname ())) + if (!ACE_OS::strcmp (item->node->full_name (), + node->full_name ())) { // found return item; diff --git a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp index 017b0e00ac3..bcc93c1e61b 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/cdr_op_ci.cpp @@ -137,7 +137,7 @@ be_visitor_union_cdr_op_ci::visit_union (be_union *node) be_type::narrow_from_decl (node->disc_type ()); // Generate a temporary to store the discriminant - *os << disc_type->fullname () + *os << disc_type->full_name () << " " << "_tao_discriminant;" << be_nl; switch (node->udisc_type ()) diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp index e2a13a2553f..eff5e8eb9d5 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_ch.cpp @@ -58,7 +58,7 @@ int be_visitor_union_ch::visit_union (be_union *node) os = this->ctx_->stream (); // generate the ifdefined macro for the union type - os->gen_ifdef_macro (node->flatname ()); + os->gen_ifdef_macro (node->flat_name ()); os->indent (); // start with the current indentation level *os << "class " << idl_global->stub_export_macro () << " " << node->local_name () << ": public TAO_Base_Union " << be_nl @@ -199,7 +199,7 @@ int be_visitor_union_ch::visit_union (be_union *node) os->gen_endif (); // generate the ifdefined macro for the _var type - os->gen_ifdef_macro (node->flatname (), "_var"); + os->gen_ifdef_macro (node->flat_name (), "_var"); // generate var defn if (node->gen_var_defn () == -1) { @@ -211,7 +211,7 @@ int be_visitor_union_ch::visit_union (be_union *node) os->gen_endif (); // generate the ifdefined macro for the array type - os->gen_ifdef_macro (node->flatname (), "_out"); + os->gen_ifdef_macro (node->flat_name (), "_out"); // a class is generated for an out defn only for a variable length struct if (node->size_type () == be_decl::VARIABLE) { diff --git a/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp index 8790e6a339b..d4327d785a9 100644 --- a/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union/union_ci.cpp @@ -131,7 +131,7 @@ int be_visitor_union_ci::visit_union (be_union *node) } // generate the ifdefined macro for the array type - os->gen_ifdef_macro (node->flatname (), "_var"); + os->gen_ifdef_macro (node->flat_name (), "_var"); if (node->gen_var_impl () == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -143,7 +143,7 @@ int be_visitor_union_ci::visit_union (be_union *node) // generate the ifdefined macro for the array type then generate the _out // impl - os->gen_ifdef_macro (node->flatname (), "_out"); + os->gen_ifdef_macro (node->flat_name (), "_out"); if (node->size_type () == be_decl::VARIABLE && node->gen_out_impl () == -1) { diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp index a1a33647a64..07cd21e0b21 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp @@ -104,18 +104,18 @@ be_visitor_union_branch_cdr_op_ci::visit_array (be_array *node) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", node->fullname ()); + ACE_OS::sprintf (fname, "_%s", node->full_name ()); } } else { // typedefed node - ACE_OS::sprintf (fname, "%s", node->fullname ()); + ACE_OS::sprintf (fname, "%s", node->full_name ()); } // check what is the code generations substate. Are we generating code for diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp index 776f5726158..f98771e4134 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_access_cs.cpp @@ -141,18 +141,18 @@ be_visitor_union_branch_public_access_cs::visit_array (be_array *node) if (bt->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (bt->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), bt->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", bt->fullname ()); + ACE_OS::sprintf (fname, "_%s", bt->full_name ()); } } else { // typedefed node - ACE_OS::sprintf (fname, "%s", bt->fullname ()); + ACE_OS::sprintf (fname, "%s", bt->full_name ()); } os = this->ctx_->stream (); diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp index 6745c75e020..e34bc423157 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_assign_cs.cpp @@ -127,7 +127,7 @@ be_visitor_union_branch_public_assign_cs::visit_array (be_array *node) os = this->ctx_->stream (); // for anonymous arrays, the type name has a _ prepended. We compute the - // fullname with or without the underscore and use it later on. + // full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and // save the node's local name and full name in a buffer for quick use later @@ -143,18 +143,18 @@ be_visitor_union_branch_public_assign_cs::visit_array (be_array *node) if (bt->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (bt->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), bt->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", bt->fullname ()); + ACE_OS::sprintf (fname, "_%s", bt->full_name ()); } } else { // typedefed node - ACE_OS::sprintf (fname, "%s", bt->fullname ()); + ACE_OS::sprintf (fname, "%s", bt->full_name ()); } os->indent (); // start from current indentation diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp index 13629b7cf88..6eaaba77bc8 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_ci.cpp @@ -131,7 +131,7 @@ be_visitor_union_branch_public_ci::visit_array (be_array *node) } // for anonymous arrays, the type name has a _ prepended. We compute the - // fullname with or without the underscore and use it later on. + // full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and // save the node's local name and full name in a buffer for quick use later @@ -147,18 +147,18 @@ be_visitor_union_branch_public_ci::visit_array (be_array *node) if (bt->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (bt->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), bt->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", bt->fullname ()); + ACE_OS::sprintf (fname, "_%s", bt->full_name ()); } } else { // typedefed node - ACE_OS::sprintf (fname, "%s", bt->fullname ()); + ACE_OS::sprintf (fname, "%s", bt->full_name ()); } // set method diff --git a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp b/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp index e6723b1f654..ac8e6a73120 100644 --- a/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_union_branch/public_reset_cs.cpp @@ -125,7 +125,7 @@ be_visitor_union_branch_public_reset_cs::visit_array (be_array *node) } // for anonymous arrays, the type name has a _ prepended. We compute the - // fullname with or without the underscore and use it later on. + // full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and // save the node's local name and full name in a buffer for quick use later @@ -141,18 +141,18 @@ be_visitor_union_branch_public_reset_cs::visit_array (be_array *node) if (bt->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (bt->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), bt->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", bt->fullname ()); + ACE_OS::sprintf (fname, "_%s", bt->full_name ()); } } else { // typedefed node - ACE_OS::sprintf (fname, "%s", bt->fullname ()); + ACE_OS::sprintf (fname, "%s", bt->full_name ()); } os = this->ctx_->stream (); diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp index d8288c7af99..6637b766bf0 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cdr_ci.cpp @@ -89,7 +89,7 @@ be_visitor_valuetype_field_cdr_ci::visit_array (be_array *node) } // for anonymous arrays, the type name has a _ prepended. We compute - // the fullname with or without the underscore and use it later on. + // the full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and // save the node's local name and full name in a buffer for quick @@ -107,18 +107,18 @@ be_visitor_valuetype_field_cdr_ci::visit_array (be_array *node) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", node->fullname ()); + ACE_OS::sprintf (fname, "_%s", node->full_name ()); } } else { // typedefed node - ACE_OS::sprintf (fname, "%s", node->fullname ()); + ACE_OS::sprintf (fname, "%s", node->full_name ()); } // check what is the code generation substate. Are we generating @@ -867,7 +867,7 @@ be_visitor_valuetype_field_cdr_decl::visit_array (be_array *node) } // for anonymous arrays, the type name has a _ prepended. We compute - // the fullname with or without the underscore and use it later on. + // the full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and ACE_OS::memset (fname, '\0', NAMEBUFSIZE); @@ -882,18 +882,18 @@ be_visitor_valuetype_field_cdr_decl::visit_array (be_array *node) if (node->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", node->fullname ()); + ACE_OS::sprintf (fname, "_%s", node->full_name ()); } } else { // typedefed node - ACE_OS::sprintf (fname, "%s", node->fullname ()); + ACE_OS::sprintf (fname, "%s", node->full_name ()); } // check what is the code generation substate. Are we generating code for diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp index b052358eae7..d1e2c9cdcc3 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/field_cs.cpp @@ -131,7 +131,7 @@ be_visitor_valuetype_field_cs::visit_array (be_array *node) } // for anonymous arrays, the type name has a _ prepended. We compute the - // fullname with or without the underscore and use it later on. + // full_name with or without the underscore and use it later on. char fname [NAMEBUFSIZE]; // to hold the full and // save the node's local name and full name in a buffer for quick use later @@ -148,18 +148,18 @@ be_visitor_valuetype_field_cs::visit_array (be_array *node) { be_decl *parent = be_scope::narrow_from_scope (bt->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->fullname (), + ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), bt->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", bt->fullname ()); + ACE_OS::sprintf (fname, "_%s", bt->full_name ()); } } else { // typedefed node - ACE_OS::sprintf (fname, "%s", bt->fullname ()); + ACE_OS::sprintf (fname, "%s", bt->full_name ()); } // set method diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp index 1f7e5405a67..e23026108de 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/marshal_cs.cpp @@ -62,7 +62,7 @@ be_visitor_valuetype_marshal_cs::visit_valuetype (be_valuetype *node) else // only can access base class via virtual function { *os << "if (!this->_tao_marshal__" - << inh->flatname () + << inh->flat_name () << " (strm)) return 0;" << be_nl; } } @@ -104,7 +104,7 @@ be_visitor_valuetype_marshal_cs::visit_valuetype (be_valuetype *node) else // only can access base class via virtual function { *os << "if (!this->_tao_unmarshal__" - << inh->flatname () + << inh->flat_name () << " (strm)) return 0;" << be_nl; } } diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp index c86280c98f6..f33690018f4 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype.cpp @@ -819,10 +819,10 @@ be_visitor_valuetype::gen_init_impl (be_valuetype *node) char lname [NAMEBUFSIZE]; // local _out names ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_init", node->fullname ()); + ACE_OS::sprintf (fname, "%s_init", node->full_name ()); ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_init", node->local_name ()->get_string ()); + ACE_OS::sprintf (lname, "%s_init", node->local_name ()); // destructor *os << fname << "::~" << lname << " ()" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp index c4a45105e74..b180803bf22 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ch.cpp @@ -61,7 +61,7 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) *os << "class " << node->local_name () << ";" << be_nl; // generate the ifdefined macro for the _var type - os->gen_ifdef_macro (node->flatname (), "_var"); + os->gen_ifdef_macro (node->flat_name (), "_var"); // generate the _var declaration if (node->gen_var_defn () == -1) @@ -74,7 +74,7 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) os->gen_endif (); // generate the ifdef macro for the _out class - os->gen_ifdef_macro (node->flatname (), "_out"); + os->gen_ifdef_macro (node->flat_name (), "_out"); // generate the _out declaration - ORBOS/97-05-15 pg 16-20 spec if (node->gen_out_defn () == -1) @@ -88,7 +88,7 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) os->gen_endif (); // generate the ifdef macro for the _init class - os->gen_ifdef_macro (node->flatname (), "_init"); + os->gen_ifdef_macro (node->flat_name (), "_init"); // generate the _init declaration - ptc/98-09-03 20.17.10 p.20-93 if (this->gen_init_defn (node) == -1) @@ -102,7 +102,7 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) os->gen_endif (); // now the valuetype definition itself - os->gen_ifdef_macro (node->flatname ()); + os->gen_ifdef_macro (node->flat_name ()); // now generate the class definition os->indent (); @@ -254,10 +254,10 @@ be_visitor_valuetype_ch::visit_valuetype (be_valuetype *node) { *os << be_uidt_nl << "protected:" << be_idt_nl; *os << "virtual CORBA::Boolean _tao_marshal__" - << node->flatname () << " (TAO_OutputCDR &) = 0;" + << node->flat_name () << " (TAO_OutputCDR &) = 0;" << be_nl; *os << "virtual CORBA::Boolean _tao_unmarshal__" - << node->flatname () << " (TAO_InputCDR &) = 0;" + << node->flat_name () << " (TAO_InputCDR &) = 0;" << be_nl; } } diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp index 368a53e1e71..6ee52bcc6f9 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_ci.cpp @@ -75,7 +75,7 @@ be_visitor_valuetype_ci::visit_valuetype (be_valuetype *node) << "}\n\n"; // generate the ifdefined macro for the _var type - os->gen_ifdef_macro (node->flatname (), "_var"); + os->gen_ifdef_macro (node->flat_name (), "_var"); if (node->gen_var_impl () == -1) { ACE_ERROR_RETURN ((LM_ERROR, @@ -86,7 +86,7 @@ be_visitor_valuetype_ci::visit_valuetype (be_valuetype *node) os->gen_endif (); // generate the ifdefined macro for the _out type - os->gen_ifdef_macro (node->flatname (), "_out"); + os->gen_ifdef_macro (node->flat_name (), "_out"); if (node->gen_out_impl () == -1) { ACE_ERROR_RETURN ((LM_ERROR, diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp index 40b655a80b1..a28d3e2432d 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_cs.cpp @@ -112,7 +112,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) } else { - *os << "this->_tao_marshal__" << node->flatname () + *os << "this->_tao_marshal__" << node->flat_name () << " (strm);" << be_uidt_nl; } *os << "}\n" << be_nl; @@ -130,7 +130,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) } else { - *os << "this->_tao_unmarshal__" << node->flatname () + *os << "this->_tao_unmarshal__" << node->flat_name () << " (strm);" << be_uidt_nl; } *os << "}\n" << be_nl; @@ -181,7 +181,7 @@ be_visitor_valuetype_cs::visit_valuetype (be_valuetype *node) // The static T::_tao_unmarshal method ------------------------ end // generate the ifdefined macro for the _init type - os->gen_ifdef_macro (node->flatname (), "_init"); + os->gen_ifdef_macro (node->flat_name (), "_init"); if (this->gen_init_impl (node) == -1) { ACE_ERROR_RETURN ((LM_ERROR, diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp index 4cdee96d078..c95b5299225 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_ch.cpp @@ -61,7 +61,7 @@ be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node) if (node->opt_accessor ()) { os->indent (); - *os << "typedef " << node->fullname () << " "; + *os << "typedef " << node->full_name () << " "; if (!node->is_nested ()) *os << "OBV_"; *os << node->local_name () << ";" << be_nl; @@ -70,7 +70,7 @@ be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node) { // == STEP 1: generate the class name and the class name we inherit == - os->gen_ifdef_macro (node->flatname (), "_OBV"); + os->gen_ifdef_macro (node->flat_name (), "_OBV"); os->indent (); *os << "// OBV_ class" << be_nl; @@ -78,7 +78,7 @@ be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node) if (!node->is_nested()) // we are in root ? *os << "OBV_"; *os << node->local_name () << " : public virtual " - << node->fullname () << be_nl; + << node->full_name () << be_nl; // == STEP 2: generate the body == @@ -97,9 +97,9 @@ be_visitor_valuetype_obv_ch::visit_valuetype (be_valuetype *node) { *os << be_uidt_nl << "protected:" << be_idt_nl; *os << "virtual CORBA::Boolean _tao_marshal__" - << node->flatname () << " (TAO_OutputCDR &);" << be_nl; + << node->flat_name () << " (TAO_OutputCDR &);" << be_nl; *os << "virtual CORBA::Boolean _tao_unmarshal__" - << node->flatname () << " (TAO_InputCDR &);" << be_nl; + << node->flat_name () << " (TAO_InputCDR &);" << be_nl; *os << "CORBA::Boolean " << "_tao_marshal_state (TAO_OutputCDR &);" << be_nl << "CORBA::Boolean " diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp index 4bcf4ef00ba..15dc7954f15 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype/valuetype_obv_cs.cpp @@ -62,7 +62,7 @@ be_visitor_valuetype_obv_cs::visit_valuetype (be_valuetype *node) os->indent (); *os << "CORBA::Boolean " << be_nl << node->full_obv_skel_name () - << "::_tao_marshal__" << node->flatname () + << "::_tao_marshal__" << node->flat_name () << " (TAO_OutputCDR &strm)" << "{" << be_idt_nl << "return " << node->full_obv_skel_name () @@ -71,7 +71,7 @@ be_visitor_valuetype_obv_cs::visit_valuetype (be_valuetype *node) *os << "CORBA::Boolean " << node->full_obv_skel_name () - << "::_tao_unmarshal__" << node->flatname () + << "::_tao_unmarshal__" << node->flat_name () << " (TAO_InputCDR &strm)" << "{" << be_idt_nl << "return " << node->full_obv_skel_name () diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ch.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ch.cpp index 5411463a7ec..a8a1c6bc183 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ch.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ch.cpp @@ -59,7 +59,7 @@ be_visitor_valuetype_fwd_ch::visit_valuetype_fwd (be_valuetype_fwd *node) *os << "class " << node->local_name () << ";" << be_nl; // generate the ifdefined macro for the _ptr type - os->gen_ifdef_macro (node->flatname (), "_ptr"); + os->gen_ifdef_macro (node->flat_name (), "_ptr"); // generate the _ptr declaration *os << "typedef " << node->local_name () << " *" << node->local_name () @@ -68,7 +68,7 @@ be_visitor_valuetype_fwd_ch::visit_valuetype_fwd (be_valuetype_fwd *node) os->gen_endif (); // enclose under an ifdef macro - os->gen_ifdef_macro (node->flatname (), "_var"); + os->gen_ifdef_macro (node->flat_name (), "_var"); // generate the _var declaration if (node->gen_var_defn () == -1) @@ -82,7 +82,7 @@ be_visitor_valuetype_fwd_ch::visit_valuetype_fwd (be_valuetype_fwd *node) os->gen_endif (); // enclose under an ifdef macro - os->gen_ifdef_macro (node->flatname (), "_out"); + os->gen_ifdef_macro (node->flat_name (), "_out"); // generate the _out declaration - ORBOS/97-05-15 pg 16-20 spec if (node->gen_out_defn () == -1) diff --git a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ci.cpp b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ci.cpp index aaadbbb38f6..e14028a0034 100644 --- a/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_valuetype_fwd/interface_fwd_ci.cpp @@ -55,7 +55,7 @@ be_visitor_valuetype_fwd_ci::visit_valuetype_fwd (be_valuetype_fwd *node) { // generate the ifdefined macro for the _var type - os->gen_ifdef_macro (node->flatname (), "_var"); + os->gen_ifdef_macro (node->flat_name (), "_var"); if (node->gen_var_impl () == -1) { @@ -68,7 +68,7 @@ be_visitor_valuetype_fwd_ci::visit_valuetype_fwd (be_valuetype_fwd *node) os->gen_endif (); // generate the ifdefined macro for the _out type - os->gen_ifdef_macro (node->flatname (), "_out"); + os->gen_ifdef_macro (node->flat_name (), "_out"); if (node->gen_out_impl () == -1) { diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h index 19edeafc611..4daebfe465b 100644 --- a/TAO/TAO_IDL/be_include/be_codegen.h +++ b/TAO/TAO_IDL/be_include/be_codegen.h @@ -304,8 +304,9 @@ public: TAO_AMI_HANDLER_STUB_CS, // AMI_*_Handler class visitor. - TAO_AMI_HANDLER_SERVANT_OPERATION_CH, // Operation in AMI_*_Handler. - TAO_AMI_HANDLER_STUB_OPERATION_CH, // Operation in POA_AMI_*_Handler. + TAO_AMI_HANDLER_SERVANT_OPERATION_CS, + TAO_AMI_HANDLER_SERVANT_OPERATION_CH, // Operation in POA_AMI_*_Handler. + TAO_AMI_HANDLER_STUB_OPERATION_CH, // Operation in AMI_*_Handler. TAO_AMI_HANDLER_OPERATION_ARGLIST_CH, TAO_AMI_HANDLER_OPERATION_ARGLIST_CS, TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CH, @@ -315,14 +316,6 @@ public: TAO_AMI_HANDLER_TYPECODE_DECL, // Typecode decl for the AMI_*_Handler. - TAO_COLLOCATED_AMI_HANDLER_CH, // Collocated AMI_*_Handler class. - - TAO_COLLOCATED_AMI_HANDLER_OPERATION_CH, // Operation inside the collocated AMI handler. - -// @@ Michael TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS, - -// @@ Michael TAO_AMI_HANDLER_OPERATION_ARG_INVOKE_CS, - TAO_AMI_HANDLER_STUB_OPERATION_CS, TAO_AMI_HANDLER_TYPECODE_DEFN, // Typecode definition for AMI Handler class. @@ -337,8 +330,28 @@ public: TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS, // Argument declartion. + TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_CH, + + TAO_AMI_HANDLER_INTERFACE_THRU_POA_COLLOCATED_CS, + + TAO_AMI_HANDLER_INTERFACE_DIRECT_COLLOCATED_CH, + + TAO_AMI_HANDLER_INTERFACE_DIRECT_COLLOCATED_CS, + + TAO_AMI_HANDLER_OPERATION_THRU_POA_COLLOCATED_CH, + + TAO_AMI_HANDLER_OPERATION_THRU_POA_COLLOCATED_CS, + + TAO_AMI_HANDLER_OPERATION_DIRECT_COLLOCATED_CH, + + TAO_AMI_HANDLER_OPERATION_DIRECT_COLLOCATED_CS, + TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS, // State derived out of the above + TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_CS, // Argument list for the upcall + + TAO_AMI_HANDLER_ARGUMENT_COLLOCATED_UPCALL_CS, // State derived out of the above + TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS, // Argument list for the upcall // (only out and inout arguments) TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS, // State derived out of the above diff --git a/TAO/TAO_IDL/be_include/be_decl.h b/TAO/TAO_IDL/be_include/be_decl.h index e2423a851fc..47aff696ce0 100644 --- a/TAO/TAO_IDL/be_include/be_decl.h +++ b/TAO/TAO_IDL/be_include/be_decl.h @@ -65,37 +65,36 @@ public: virtual SIZE_TYPE size_type (void); // return our size type - const char *fullname (void); + const char *full_name (void); // return the stringified full name - const char *ami_handler_fullname (void); - // return the stringified full name of the assosciated AMI reply handler. - - const char *flatname (void); + const char *flat_name (void); // return the flattened full scoped name. - const char *ami_handler_flatname (void); - // return the flattened full scoped name of the assosciated AMI reply handler. + const char *repoID (void); + // retrieve the repository ID. - char* compute_flatname (const char *prefix, const char *suffix); + // Methods used by the interface type strategy + void compute_full_name (const char *prefix, + const char *suffix, + char *&name); // Both the arguments should be non-null!!!. Applies prefix and // suffix to the local name and makes a flat name. - const char *repoID (void); - // retrieve the repository ID. + void compute_flat_name (const char *prefix, + const char *suffix, + char *& name); + // Both the arguments should be non-null!!!. Applies prefix and + // suffix to the local name and makes a flat name. - const char *ami_handler_repoID (void); - // retrieve the repository ID of the assosciated AMI reply handler. - char *compute_repoID (const char *prefix, const char *suffix); + void compute_repoID (const char *prefix, + const char *suffix, + char *& name); // Apply the prefix and suffix to the local name and compute the // repoID. Both the parameters should be non-null. - int compute_ami_handler_name (const char *name, - char *&ami_handler_name); - // Computes the name of the corresponding AMI handler out of a - // given name. The name might contain POA_ at the beginning - // and might possibly have many scope levels. + // End of Methods use by the interface type strategy const char* prefix (void); // retrieve the repository ID prefix @@ -158,13 +157,12 @@ protected: virtual int compute_size_type (void); // determine our size type and set it if it is unknown - virtual void compute_fullname (void); + virtual void compute_full_name (void); // computes the fully scoped name - virtual void compute_flatname (void); + virtual void compute_flat_name (void); // compute the flattened fully scoped name - virtual void compute_repoID (void); // computes the repoID @@ -187,24 +185,15 @@ protected: idl_bool cli_stub_cdr_op_gen_; idl_bool cli_inline_cdr_op_gen_; - char *fullname_; + char *full_name_; // our full scoped name - char *ami_handler_fullname_; - // our full scoped name of the associated AMI reply handler - - char *flatname_; + char *flat_name_; // flattened fully scoped name - char *ami_handler_flatname_; - // flattened fully scoped name of the associated AMI reply handler - char *repoID_; // repository ID - char *ami_handler_repoID_; - // repository ID of the associated AMI reply handler - char *prefix_; // The repository ID prefix @@ -212,7 +201,7 @@ protected: // whether we are fixed or variable size (by default fixed) idl_bool has_constructor_; - // attribute that helps a union determine whether a member + // attribute that helps a union determine whether a member // should be included by value or by reference. }; diff --git a/TAO/TAO_IDL/be_include/be_helper.h b/TAO/TAO_IDL/be_include/be_helper.h index c931b758f97..cb0a911e2f9 100644 --- a/TAO/TAO_IDL/be_include/be_helper.h +++ b/TAO/TAO_IDL/be_include/be_helper.h @@ -134,7 +134,7 @@ public: int print (const char *format, ...); // "printf" style variable argument print - int gen_ifdef_macro (const char *flatname, const char *suffix=0); + int gen_ifdef_macro (const char *flat_name, const char *suffix=0); // generate a #if !defined, #defined macro int gen_endif (void); diff --git a/TAO/TAO_IDL/be_include/be_interface.h b/TAO/TAO_IDL/be_include/be_interface.h index d9b7d2c669a..3426ce68169 100644 --- a/TAO/TAO_IDL/be_include/be_interface.h +++ b/TAO/TAO_IDL/be_include/be_interface.h @@ -16,7 +16,8 @@ // = AUTHOR // Copyright 1994-1995 by Sun Microsystems, Inc. // and -// Aniruddha Gokhale +// Aniruddha Gokhale, +// Michael Kircher // // ============================================================================ @@ -28,6 +29,177 @@ #include "ast_interface.h" class TAO_OutStream; +class be_interface; + +// This class serves as a strategy base class for the differences +// in generating e.g. ami reply handlers. + +class be_interface_type_strategy +{ +public: + be_interface_type_strategy (be_interface *node); + + virtual ~be_interface_type_strategy (); + + virtual const char *local_name (void) = 0; + // return the local name + + virtual const char *full_name (void) = 0; + // return the stringified full name + + virtual const char *flat_name (void) = 0; + // return the flattened full scoped name. + + virtual const char *repoID (void) = 0; + // retrieve the repository ID. + + virtual const char *full_skel_name (void) = 0; + // retrieve the fully scoped skel class name. + + virtual const char *full_coll_name (int) = 0; + // retrieve the fully qualified collocated class name + + virtual const char *local_coll_name (int) = 0; + // retrieve the fully qualified collocated class name. + + const char *relative_skel_name (const char *skel_name); + // relative skeleton name + + const char* relative_name (const char *localname, + const char *othername); + + void compute_names (const char* name, + const char* prefix, + const char* suffix, + char *&new_name); + // compute the names using the local prefix and suffix + + void compute_coll_names (int type, + const char *prefix, + const char *suffix); + // compute the collocation names + + virtual TAO_OutStream *get_out_stream () = 0; + // return the out stream depending on the strategy + // -> the client stub (e.g. AMI) or server skeleton + // outstream is returned. + + virtual const char *get_out_stream_fname () = 0; + // return the file name of the output stream. + +protected: + + char *local_name_; + + char *full_name_; + + char *flat_name_; + + char *repoID_; + + char *full_skel_name_; + + char *full_coll_name_; + + char *local_coll_name_; + + char *relative_skel_name_; + + be_interface *node_; + // The node we strategize +}; + + + +class be_interface_ami_handler_strategy + : public be_interface_type_strategy +{ +public: + // begin overridden methods. + be_interface_ami_handler_strategy (be_interface *node); + + virtual ~be_interface_ami_handler_strategy (); + + const char * local_name (void); + // return the local name + + virtual const char *full_name (void); + // return the stringified full name + + virtual const char *flat_name (void); + // return the flattened full scoped name. + + virtual const char *repoID (void); + // retrieve the repository ID. + + virtual const char *full_skel_name (void); + // retrieve the fully scoped skel class name. + + virtual const char *full_coll_name (int); + // retrieve the fully qualified collocated class name + + virtual const char *local_coll_name (int); + // retrieve the fully qualified collocated class name. + + virtual TAO_OutStream *get_out_stream (); + // return the out stream depending on the strategy + // return the client stub + + virtual const char *get_out_stream_fname (); + // return the file name of the output stream. + + // end of overridden methods +private: + + const char *prefix_; + // The prefix to the interface + + const char *suffix_; + // The suffix to the interface +}; + + +class be_interface_default_strategy + : public be_interface_type_strategy +{ +public: + // begin overridden methods. + be_interface_default_strategy (be_interface *node); + + virtual ~be_interface_default_strategy (); + + const char * local_name (void); + // return the local name + + virtual const char *full_name (void); + // return the stringified full name + + virtual const char *flat_name (void); + // return the flattened full scoped name. + + virtual const char *repoID (void); + // retrieve the repository ID. + + virtual const char *full_skel_name (void); + // retrieve the fully scoped skel class name. + + virtual const char *full_coll_name (int); + // retrieve the fully qualified collocated class name + + virtual const char *local_coll_name (int); + // retrieve the fully qualified collocated class name. + + virtual TAO_OutStream *get_out_stream (); + // return the out stream depending on the strategy + // return the server skeleton + + virtual const char *get_out_stream_fname (); + // return the file name of the output stream. + + // end of overridden methods +}; + +// **************************************************************** /* * BE_Interface @@ -46,7 +218,6 @@ public: THRU_POA = 0, DIRECT = 1 }; - // Collocated stubs type value. // used to pass functions to the template method typedef int (*tao_code_emitter) (be_interface *, be_interface *, TAO_OutStream *); @@ -55,7 +226,9 @@ public: be_interface (void); // Default constructor - be_interface (UTL_ScopedName *n, AST_Interface **ih, long nih, + be_interface (UTL_ScopedName *n, + AST_Interface **ih, + long nih, UTL_StrList *p); // Constructor that sets its scoped name <n>, a list of inherited interfaces // <ih>, the number of inherited interfaces <nih>, and any prgmas <p> @@ -63,6 +236,40 @@ public: ~be_interface (void); // dtor + be_interface_type_strategy *set_strategy (be_interface_type_strategy *new_strategy); + // Set the strategy to generate the names + + // Methods, which access the strategy + + const char *local_name (void) const; + // return the local name + + const char *full_name (void) const; + // return the stringified full name + + const char *flat_name (void) const; + // return the flattened full scoped name. + + const char *repoID (void) const; + // retrieve the repository ID. + + const char *full_skel_name (void) const; + // retrieve the fully scoped skel class name. + + const char *full_coll_name (int) const; + // retrieve the fully qualified collocated class name + + const char *local_coll_name (int) const; + // retrieve the fully qualified collocated class name. + + const char *be_interface::relative_skel_name (const char *skel_name); + // relative skeleton name + + void compute_full_skel_name (const char *prefix,char *&skel_name); + // Build up the skeleton name + + static const char *relative_name (const char *localname, const char *othername); + virtual void gen_def_ctors (TAO_OutStream* os); //call the default constructors of all the base classes @@ -90,13 +297,6 @@ public: // Generate the out class implementation. // If any one of the argument is 0, then use the name giin this // node, else use the arguments. - - const char *full_skel_name (void); - // Retrieve the fully scoped skel class name. - - const char *ami_handler_full_skel_name (void); - // Retrieve the fully scoped skel AMI handler class name - // // Each interface (to fix names "T") also defines two help classes, // the "collocated" class inherits from T, but delegates on the @@ -108,35 +308,11 @@ public: // defines the stubs (all operations in T are pure virtual). // @@ TODO currently the stub class is not implemented. // - const char *full_coll_name (int); - // Retrieve the fully qualified collocated class name - - const char *ami_handler_full_coll_name (void); - // Retrieve the fully qualified collocated AMI handler class name - - const char *local_coll_name (int) const; - // Retrieve the fully qualified collocated class name. - - const char *ami_handler_local_coll_name (void); - // Retrieve the fully qualified collocated AMI handler class name. - - const char *ami_handler_local_name (void); - // Retrieve the local name of the AMI handler - - int compute_coll_names (const char *local_name, - char *&coll_local_name, - char *&coll_full_name); - // Generate collocated local and full names for the arbitrary local - // name under the scope of this interface. Usefull to generate AMI - // Handlers. virtual int traverse_inheritance_graph (tao_code_emitter gen, TAO_OutStream *os); // template method using breadth first traversal of inheritance graph - const char *relative_skel_name (const char *other_class_name); - // relative skeleton name - int in_mult_inheritance (void); // am I in some form of multiple inheritance // -1 => error @@ -170,6 +346,12 @@ public: // helper method passed to the template method to generate code for the // operation table + static int ami_handler_gen_optable_helper (be_interface *, + be_interface *, + TAO_OutStream *os); + // helper method passed to the template method to generate code for the + // operation table + static int gen_skel_helper (be_interface *, be_interface *, TAO_OutStream *os); @@ -201,23 +383,12 @@ public: //helper method to generate a call to the copy constructors of all the base classes - void compute_fullskelname (void); - void compute_fullskelname (char *&skelname, const char * prefix); - // compute the fully scoped skel class name - int gen_operation_table (void); // generate the operation table including entries for inherited interfaces - static const char *relative_name (const char* our_name, - const char *other_class_name); - // relative name for collocated class. - int gen_optable_entries (be_interface *); // generate the operation table entries. - void compute_coll_name (int); - // compute the fully qualified collocated class name. - private: void gen_gperf_input_header (TAO_OutStream *ss); // Output the header (type declaration and %%) to the gperf's input @@ -253,36 +424,15 @@ private: void gen_linear_search_instance (void); // Create an instance of the linear search optable. - char *full_skel_name_; - // Fully scoped skeleton name. - - char *ami_handler_full_skel_name_; - // Fully scoped AMI Handler skeleton name - int skel_count_; // Number of static skeletons in the operation table. - char *full_coll_name_; - // Full collocated name - - int cached_coll_name_type_; - // Record the type of cached collocated class prefix. - - char *ami_handler_full_coll_name_; - // Full collocated name of the AMI handler - - char *local_coll_name_; - // Local collocated name - - char *ami_handler_local_coll_name_; - // Local collocated name of the AMI handler - - char *ami_handler_local_name_; - // Local name of the AMI Handler - int in_mult_inheritance_; // am I directly or indirectly involved in a multiple inheritance. If the // value is -1 => not computed yet. + + be_interface_type_strategy *strategy_; + // Member for holding the strategy for generating names }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_visitor_interface.h b/TAO/TAO_IDL/be_include/be_visitor_interface.h index e35aed8ac7b..8f2e85f15fb 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_interface.h +++ b/TAO/TAO_IDL/be_include/be_visitor_interface.h @@ -45,10 +45,13 @@ #include "be_visitor_interface/tie_si.h" #include "be_visitor_interface/ami_handler_fwd_ch.h" #include "be_visitor_interface/ami_handler_fwd_ci.h" -#include "be_visitor_interface/ami_handler_servant_ch.h" -#include "be_visitor_interface/ami_handler_servant_cs.h" #include "be_visitor_interface/ami_handler_stub_ch.h" #include "be_visitor_interface/ami_handler_stub_cs.h" + +#if 0 /* We are using normal servant code */ #include "be_visitor_interface/collocated_ami_handler_ch.h" +#include "be_visitor_interface/ami_handler_servant_ch.h" +#include "be_visitor_interface/ami_handler_servant_cs.h" +#endif /* 0 */ #endif /* _BE_VISITOR_INTERFACE_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation.h b/TAO/TAO_IDL/be_include/be_visitor_operation.h index e19952ca92d..dd637624a35 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation.h @@ -61,6 +61,10 @@ #include "be_visitor_operation/ami_handler_operation_ch.h" #include "be_visitor_operation/ami_handler_arglist.h" #include "be_visitor_operation/ami_handler_operation_cs.h" +#include "be_visitor_operation/ami_handler_servant_operation_cs.h" #include "be_visitor_operation/ami_handler_skeleton_cs.h" #include "be_visitor_operation/ami_handler_argument_marshal.h" +#include "be_visitor_operation/ami_handler_thru_poa_collocated_ch.h" +#include "be_visitor_operation/ami_handler_thru_poa_collocated_cs.h" + #endif // TAO_BE_VISITOR_OPERATION_H diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_servant_operation_cs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_servant_operation_cs.h new file mode 100644 index 00000000000..66a2ef89ed8 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_servant_operation_cs.h @@ -0,0 +1,142 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// ami_handler_servant_operation_cs.h +// +// = DESCRIPTION +// Visitor for generating code for IDL operations in server skeletons +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#ifndef _BE_VISITOR_OPERATION_AMI_HANDLER_SERVANT_OPERATION_CS_H_ +#define _BE_VISITOR_OPERATION_AMI_HANDLER_SERVANT_OPERATION_CS_H_ + +// ************************************************************ +// Operation visitor for server skeletons +// ************************************************************ + +class be_visitor_operation_ami_handler_servant_operation_cs : public be_visitor_operation +{ + // + // = TITLE + // be_visitor_operation_ami_handler_servant_operation_cs + // + // = DESCRIPTION + // This is a concrete visitor to generate the server skeletons for operation + // + // +public: + + be_visitor_operation_ami_handler_servant_operation_cs (be_visitor_context *ctx); + // constructor + + ~be_visitor_operation_ami_handler_servant_operation_cs (void); + // destructor + + virtual int visit_operation (be_operation *node); + // visit operation. We provide code for this method in the derived class + + virtual int visit_argument (be_argument *node); + // visit argument to generate ParamData entries + + // template methods + + virtual int gen_pre_skel_info (be_operation *, be_type *) = 0; + // generate any pre skeleton code info + + virtual int gen_demarshal_params (be_operation *, be_type *) = 0; + // generate code for demarshaling incoming parameters + + virtual int gen_marshal_params (be_operation *, be_type *) = 0; + // generate code for marshaling outgoing parameters + + // = helper + virtual int post_process (be_decl *); + // stuff to output after every member of the scope is handled + + virtual int gen_raise_exception (be_type *, + const char * excep, + const char * status, + const char * env); + // helper that generates code for raising an exception + + virtual int gen_check_exception (be_type *, const char *env); + // helper that generates code for checking for an exception + +}; + +// concrete visitors + +class be_interpretive_visitor_operation_ami_handler_servant_operation_cs : public be_visitor_operation_ami_handler_servant_operation_cs +{ + // + // = TITLE + // be_interpretive_visitor_operation_ami_handler_servant_operation_cs + // + // = DESCRIPTION + // This is a concrete visitor to generate the server skeletons for + // operation using interpretive marshaling + // + // +public: + be_interpretive_visitor_operation_ami_handler_servant_operation_cs (be_visitor_context *ctx); + // constructor + + ~be_interpretive_visitor_operation_ami_handler_servant_operation_cs (void); + // destructor + + // template methods + + virtual int gen_pre_skel_info (be_operation *, be_type *); + // generate any pre skeleton code info + + virtual int gen_demarshal_params (be_operation *, be_type *); + // generate code for demarshaling incoming parameters + + virtual int gen_marshal_params (be_operation *, be_type *); + // generate code for marshaling outgoing parameters + +}; + +class be_compiled_visitor_operation_ami_handler_servant_operation_cs : public be_visitor_operation_ami_handler_servant_operation_cs +{ + // + // = TITLE + // be_compiled_visitor_operation_ami_handler_servant_operation_cs + // + // = DESCRIPTION + // This is a concrete visitor to generate the server skeletons for + // operation using compiled marshaling + // + // +public: + be_compiled_visitor_operation_ami_handler_servant_operation_cs (be_visitor_context *ctx); + // constructor + + ~be_compiled_visitor_operation_ami_handler_servant_operation_cs (void); + // destructor + + // template methods + + virtual int gen_pre_skel_info (be_operation *, be_type *); + // generate any pre skeleton code info + + virtual int gen_demarshal_params (be_operation *, be_type *); + // generate code for demarshaling incoming parameters + + virtual int gen_marshal_params (be_operation *, be_type *); + // generate code for marshaling outgoing parameters + +}; + +#endif /* _BE_VISITOR_OPERATION_AMI_HANDLER_SERVANT_OPERATION_CS_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_thru_poa_collocated_ch.h b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_thru_poa_collocated_ch.h new file mode 100644 index 00000000000..a7b09defbe9 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_thru_poa_collocated_ch.h @@ -0,0 +1,53 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// thru_poa_collocated_ch.h +// +// = DESCRIPTION +// Visitor for generating code for IDL operations for the thru_poa collocated case +// inside of the servant header +// Special code for the AMI Reply Handler +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#ifndef _BE_VISITOR_OPERATION_ami_handler_thru_poa_collocated_ch_H_ +#define _BE_VISITOR_OPERATION_ami_handler_thru_poa_collocated_ch_H_ + +// ************************************************************ +// Operation visitor for server header in the thru_poa collocated class +// ************************************************************ + +class be_visitor_operation_ami_handler_thru_poa_collocated_ch : public be_visitor_scope +{ + // + // = TITLE + // be_visitor_operation_ami_handler_thru_poa_collocated_ch + // + // = DESCRIPTION + // This is a concrete visitor to generate the server header for operation + // in the thru_poa collocated class + // + // +public: + be_visitor_operation_ami_handler_thru_poa_collocated_ch (be_visitor_context *ctx); + // constructor + + ~be_visitor_operation_ami_handler_thru_poa_collocated_ch (void); + // destructor + + virtual int visit_operation (be_operation *node); + // visit operation node. + +}; + +#endif /* _BE_VISITOR_OPERATION_ami_handler_thru_poa_collocated_ch_H_ */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_thru_poa_collocated_cs.h b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_thru_poa_collocated_cs.h new file mode 100644 index 00000000000..b5eff14e374 --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_visitor_operation/ami_handler_thru_poa_collocated_cs.h @@ -0,0 +1,58 @@ +// +// $Id$ +// + +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// ami_handler_thru_poa_collocated_cs.h +// +// = DESCRIPTION +// Visitor for generating code for IDL operations for the thru_poa collocated case +// inside of the servant skeleton +// +// = AUTHOR +// Aniruddha Gokhale +// Michael Kircher +// +// ============================================================================ + +#ifndef _BE_VISITOR_OPERATION_AMI_HANDLER_THRU_POA_COLLOCATED_CS_H_ +#define _BE_VISITOR_OPERATION_AMI_HANDLER_THRU_POA_COLLOCATED_CS_H_ + +// ***************************************************************** +// Operation visitor for server skeletons for the thru_poa collocated class +// ***************************************************************** + +class be_visitor_operation_ami_handler_thru_poa_collocated_cs : public be_visitor_scope +{ + // + // = TITLE + // be_visitor_operation_ss + // + // = DESCRIPTION + // This is a concrete visitor to generate the server skeletons for + // operation in the thru_poa collocated class + // + // +public: + be_visitor_operation_ami_handler_thru_poa_collocated_cs (be_visitor_context *ctx); + // constructor + + ~be_visitor_operation_ami_handler_thru_poa_collocated_cs (void); + // destructor + + virtual int visit_operation (be_operation *node); + // visit operation node. + + virtual int gen_invoke (be_visitor_context &ctx, be_operation *node); + // A helper method to generate operation invocation code. + + virtual int void_return_type (be_type *bt); + // is my return type void? +}; + +#endif /* _BE_VISITOR_OPERATION_AMI_HANDLER_THRU_POA_COLLOCATED_CS_H_ */ diff --git a/TAO/examples/AMI/FL_Callback/Makefile b/TAO/examples/AMI/FL_Callback/Makefile new file mode 100644 index 00000000000..d9cd3cb5bb0 --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/Makefile @@ -0,0 +1,1664 @@ +#---------------------------------------------------------------------------- +# +# $Id$ +# +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +ifndef TAO_ROOT + TAO_ROOT = $(ACE_ROOT)/TAO +endif # ! TAO_ROOT + +LDLIBS = -lTAO + +IDLFILES = testC testS +BIN = progress peer + +SRC = $(addsuffix .cpp, $(BIN) $(IDLFILES) Peer_i Progress_i) + +PROGRESS_OBJS = progress.o Progress_i.o $(addsuffix .o, $(IDLFILES)) +PEER_OBJS = peer.o Peer_i.o $(addsuffix .o, $(IDLFILES)) + +BUILD = $(BIN) +VLDLIBS = $(LDLIBS:%=%$(VAR)) +VBIN = $(BIN:%=%$(VAR)) + +TAO_IDLFLAGS += -Ge 1 -GC +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(TAO_ROOT)/rules.tao.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU +include $(TAO_ROOT)/taoconfig.mk + +#---------------------------------------------------------------------------- +# Local targets +#---------------------------------------------------------------------------- + +.PRECIOUS: testC.h testC.i testC.cpp +.PRECIOUS: testS.h testS.i testS.cpp +.PRECIOUS: testS_T.h testS_T.i testS_T.cpp + +progress: $(addprefix $(VDIR),$(PROGRESS_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) + +peer: $(addprefix $(VDIR),$(PEER_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) + +realclean: clean + -$(RM) testC.* testS.* testS_T.* + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +.obj/progress.o .obj/progress.so .shobj/progress.o .shobj/progress.so: progress.cpp Progress_i.h testS.h testC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/inc_user_config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/IOR_LookupTable.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/varout.i \ + $(TAO_ROOT)/tao/varout.cpp \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/IORManipulation.h \ + $(TAO_ROOT)/tao/IORS.h \ + $(TAO_ROOT)/tao/IORC.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/IORC.i \ + $(TAO_ROOT)/tao/Servant_Base.h \ + $(TAO_ROOT)/tao/POAC.h \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/POAC.i \ + $(TAO_ROOT)/tao/Servant_Base.i \ + $(TAO_ROOT)/tao/IORS.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/Request.h \ + $(TAO_ROOT)/tao/Context.h \ + $(TAO_ROOT)/tao/Context.i \ + $(TAO_ROOT)/tao/Request.i \ + $(TAO_ROOT)/tao/Server_Request.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/GIOP.h \ + $(TAO_ROOT)/tao/GIOP.i \ + $(TAO_ROOT)/tao/Server_Request.i \ + $(TAO_ROOT)/tao/Marshal.h \ + $(TAO_ROOT)/tao/Marshal.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(TAO_ROOT)/tao/POA.h \ + $(TAO_ROOT)/tao/Object_Adapter.h \ + $(TAO_ROOT)/tao/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ + $(ACE_ROOT)/ace/Map.i \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair.h \ + $(ACE_ROOT)/ace/Pair.i \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/Key_Adapters.i \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(TAO_ROOT)/tao/poa_macros.h \ + $(TAO_ROOT)/tao/POAS.h \ + $(TAO_ROOT)/tao/POA_CORBA.h \ + $(TAO_ROOT)/tao/DynAnyC.h \ + $(TAO_ROOT)/tao/DynAnyC.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/POAS.i \ + $(TAO_ROOT)/tao/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Object_Adapter.i \ + $(TAO_ROOT)/tao/POAManager.h \ + $(TAO_ROOT)/tao/POAManager.i \ + $(TAO_ROOT)/tao/POA.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/MessagingS.h \ + $(TAO_ROOT)/tao/TimeBaseS.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.h \ + $(TAO_ROOT)/tao/TimeBaseS_T.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.cpp \ + $(TAO_ROOT)/tao/TimeBaseS.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/MessagingS.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(ACE_ROOT)/ace/Dynamic_Service.cpp \ + $(TAO_ROOT)/tao/Operation_Table.h \ + $(TAO_ROOT)/tao/Client_Strategy_Factory.h \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/InconsistentTypeCodeC.h \ + $(TAO_ROOT)/tao/DynAny_i.h \ + $(TAO_ROOT)/tao/Union.h \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.i \ + testC.i testS_T.h testS_T.i testS_T.cpp testS.i Progress_i.i \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i +.obj/peer.o .obj/peer.so .shobj/peer.o .shobj/peer.so: peer.cpp Peer_i.h testS.h testC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/inc_user_config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/IOR_LookupTable.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/varout.i \ + $(TAO_ROOT)/tao/varout.cpp \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/IORManipulation.h \ + $(TAO_ROOT)/tao/IORS.h \ + $(TAO_ROOT)/tao/IORC.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/IORC.i \ + $(TAO_ROOT)/tao/Servant_Base.h \ + $(TAO_ROOT)/tao/POAC.h \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/POAC.i \ + $(TAO_ROOT)/tao/Servant_Base.i \ + $(TAO_ROOT)/tao/IORS.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/Request.h \ + $(TAO_ROOT)/tao/Context.h \ + $(TAO_ROOT)/tao/Context.i \ + $(TAO_ROOT)/tao/Request.i \ + $(TAO_ROOT)/tao/Server_Request.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/GIOP.h \ + $(TAO_ROOT)/tao/GIOP.i \ + $(TAO_ROOT)/tao/Server_Request.i \ + $(TAO_ROOT)/tao/Marshal.h \ + $(TAO_ROOT)/tao/Marshal.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(TAO_ROOT)/tao/POA.h \ + $(TAO_ROOT)/tao/Object_Adapter.h \ + $(TAO_ROOT)/tao/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ + $(ACE_ROOT)/ace/Map.i \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair.h \ + $(ACE_ROOT)/ace/Pair.i \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/Key_Adapters.i \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(TAO_ROOT)/tao/poa_macros.h \ + $(TAO_ROOT)/tao/POAS.h \ + $(TAO_ROOT)/tao/POA_CORBA.h \ + $(TAO_ROOT)/tao/DynAnyC.h \ + $(TAO_ROOT)/tao/DynAnyC.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/POAS.i \ + $(TAO_ROOT)/tao/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Object_Adapter.i \ + $(TAO_ROOT)/tao/POAManager.h \ + $(TAO_ROOT)/tao/POAManager.i \ + $(TAO_ROOT)/tao/POA.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/MessagingS.h \ + $(TAO_ROOT)/tao/TimeBaseS.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.h \ + $(TAO_ROOT)/tao/TimeBaseS_T.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.cpp \ + $(TAO_ROOT)/tao/TimeBaseS.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/MessagingS.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(ACE_ROOT)/ace/Dynamic_Service.cpp \ + $(TAO_ROOT)/tao/Operation_Table.h \ + $(TAO_ROOT)/tao/Client_Strategy_Factory.h \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/InconsistentTypeCodeC.h \ + $(TAO_ROOT)/tao/DynAny_i.h \ + $(TAO_ROOT)/tao/Union.h \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.i \ + testC.i testS_T.h testS_T.i testS_T.cpp testS.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.i \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + Peer_i.i $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/Sched_Params.h \ + $(ACE_ROOT)/ace/Sched_Params.i +.obj/testC.o .obj/testC.so .shobj/testC.o .shobj/testC.so: testC.cpp testC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/inc_user_config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/IOR_LookupTable.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/varout.i \ + $(TAO_ROOT)/tao/varout.cpp \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/IORManipulation.h \ + $(TAO_ROOT)/tao/IORS.h \ + $(TAO_ROOT)/tao/IORC.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/IORC.i \ + $(TAO_ROOT)/tao/Servant_Base.h \ + $(TAO_ROOT)/tao/POAC.h \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/POAC.i \ + $(TAO_ROOT)/tao/Servant_Base.i \ + $(TAO_ROOT)/tao/IORS.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/Request.h \ + $(TAO_ROOT)/tao/Context.h \ + $(TAO_ROOT)/tao/Context.i \ + $(TAO_ROOT)/tao/Request.i \ + $(TAO_ROOT)/tao/Server_Request.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/GIOP.h \ + $(TAO_ROOT)/tao/GIOP.i \ + $(TAO_ROOT)/tao/Server_Request.i \ + $(TAO_ROOT)/tao/Marshal.h \ + $(TAO_ROOT)/tao/Marshal.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(TAO_ROOT)/tao/POA.h \ + $(TAO_ROOT)/tao/Object_Adapter.h \ + $(TAO_ROOT)/tao/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ + $(ACE_ROOT)/ace/Map.i \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair.h \ + $(ACE_ROOT)/ace/Pair.i \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/Key_Adapters.i \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(TAO_ROOT)/tao/poa_macros.h \ + $(TAO_ROOT)/tao/POAS.h \ + $(TAO_ROOT)/tao/POA_CORBA.h \ + $(TAO_ROOT)/tao/DynAnyC.h \ + $(TAO_ROOT)/tao/DynAnyC.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/POAS.i \ + $(TAO_ROOT)/tao/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Object_Adapter.i \ + $(TAO_ROOT)/tao/POAManager.h \ + $(TAO_ROOT)/tao/POAManager.i \ + $(TAO_ROOT)/tao/POA.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/MessagingS.h \ + $(TAO_ROOT)/tao/TimeBaseS.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.h \ + $(TAO_ROOT)/tao/TimeBaseS_T.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.cpp \ + $(TAO_ROOT)/tao/TimeBaseS.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/MessagingS.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(ACE_ROOT)/ace/Dynamic_Service.cpp \ + $(TAO_ROOT)/tao/Operation_Table.h \ + $(TAO_ROOT)/tao/Client_Strategy_Factory.h \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/InconsistentTypeCodeC.h \ + $(TAO_ROOT)/tao/DynAny_i.h \ + $(TAO_ROOT)/tao/Union.h \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.i \ + testC.i +.obj/testS.o .obj/testS.so .shobj/testS.o .shobj/testS.so: testS.cpp testS.h testC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/inc_user_config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/IOR_LookupTable.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/varout.i \ + $(TAO_ROOT)/tao/varout.cpp \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/IORManipulation.h \ + $(TAO_ROOT)/tao/IORS.h \ + $(TAO_ROOT)/tao/IORC.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/IORC.i \ + $(TAO_ROOT)/tao/Servant_Base.h \ + $(TAO_ROOT)/tao/POAC.h \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/POAC.i \ + $(TAO_ROOT)/tao/Servant_Base.i \ + $(TAO_ROOT)/tao/IORS.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/Request.h \ + $(TAO_ROOT)/tao/Context.h \ + $(TAO_ROOT)/tao/Context.i \ + $(TAO_ROOT)/tao/Request.i \ + $(TAO_ROOT)/tao/Server_Request.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/GIOP.h \ + $(TAO_ROOT)/tao/GIOP.i \ + $(TAO_ROOT)/tao/Server_Request.i \ + $(TAO_ROOT)/tao/Marshal.h \ + $(TAO_ROOT)/tao/Marshal.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(TAO_ROOT)/tao/POA.h \ + $(TAO_ROOT)/tao/Object_Adapter.h \ + $(TAO_ROOT)/tao/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ + $(ACE_ROOT)/ace/Map.i \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair.h \ + $(ACE_ROOT)/ace/Pair.i \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/Key_Adapters.i \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(TAO_ROOT)/tao/poa_macros.h \ + $(TAO_ROOT)/tao/POAS.h \ + $(TAO_ROOT)/tao/POA_CORBA.h \ + $(TAO_ROOT)/tao/DynAnyC.h \ + $(TAO_ROOT)/tao/DynAnyC.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/POAS.i \ + $(TAO_ROOT)/tao/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Object_Adapter.i \ + $(TAO_ROOT)/tao/POAManager.h \ + $(TAO_ROOT)/tao/POAManager.i \ + $(TAO_ROOT)/tao/POA.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/MessagingS.h \ + $(TAO_ROOT)/tao/TimeBaseS.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.h \ + $(TAO_ROOT)/tao/TimeBaseS_T.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.cpp \ + $(TAO_ROOT)/tao/TimeBaseS.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/MessagingS.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(ACE_ROOT)/ace/Dynamic_Service.cpp \ + $(TAO_ROOT)/tao/Operation_Table.h \ + $(TAO_ROOT)/tao/Client_Strategy_Factory.h \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/InconsistentTypeCodeC.h \ + $(TAO_ROOT)/tao/DynAny_i.h \ + $(TAO_ROOT)/tao/Union.h \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.i \ + testC.i testS_T.h testS_T.i testS_T.cpp testS.i +.obj/Peer_i.o .obj/Peer_i.so .shobj/Peer_i.o .shobj/Peer_i.so: Peer_i.cpp Peer_i.h testS.h testC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/inc_user_config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/IOR_LookupTable.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/varout.i \ + $(TAO_ROOT)/tao/varout.cpp \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/IORManipulation.h \ + $(TAO_ROOT)/tao/IORS.h \ + $(TAO_ROOT)/tao/IORC.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/IORC.i \ + $(TAO_ROOT)/tao/Servant_Base.h \ + $(TAO_ROOT)/tao/POAC.h \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/POAC.i \ + $(TAO_ROOT)/tao/Servant_Base.i \ + $(TAO_ROOT)/tao/IORS.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/Request.h \ + $(TAO_ROOT)/tao/Context.h \ + $(TAO_ROOT)/tao/Context.i \ + $(TAO_ROOT)/tao/Request.i \ + $(TAO_ROOT)/tao/Server_Request.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/GIOP.h \ + $(TAO_ROOT)/tao/GIOP.i \ + $(TAO_ROOT)/tao/Server_Request.i \ + $(TAO_ROOT)/tao/Marshal.h \ + $(TAO_ROOT)/tao/Marshal.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(TAO_ROOT)/tao/POA.h \ + $(TAO_ROOT)/tao/Object_Adapter.h \ + $(TAO_ROOT)/tao/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ + $(ACE_ROOT)/ace/Map.i \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair.h \ + $(ACE_ROOT)/ace/Pair.i \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/Key_Adapters.i \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(TAO_ROOT)/tao/poa_macros.h \ + $(TAO_ROOT)/tao/POAS.h \ + $(TAO_ROOT)/tao/POA_CORBA.h \ + $(TAO_ROOT)/tao/DynAnyC.h \ + $(TAO_ROOT)/tao/DynAnyC.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/POAS.i \ + $(TAO_ROOT)/tao/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Object_Adapter.i \ + $(TAO_ROOT)/tao/POAManager.h \ + $(TAO_ROOT)/tao/POAManager.i \ + $(TAO_ROOT)/tao/POA.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/MessagingS.h \ + $(TAO_ROOT)/tao/TimeBaseS.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.h \ + $(TAO_ROOT)/tao/TimeBaseS_T.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.cpp \ + $(TAO_ROOT)/tao/TimeBaseS.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/MessagingS.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(ACE_ROOT)/ace/Dynamic_Service.cpp \ + $(TAO_ROOT)/tao/Operation_Table.h \ + $(TAO_ROOT)/tao/Client_Strategy_Factory.h \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/InconsistentTypeCodeC.h \ + $(TAO_ROOT)/tao/DynAny_i.h \ + $(TAO_ROOT)/tao/Union.h \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.i \ + testC.i testS_T.h testS_T.i testS_T.cpp testS.i \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.i \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + Peer_i.i +.obj/Progress_i.o .obj/Progress_i.so .shobj/Progress_i.o .shobj/Progress_i.so: Progress_i.cpp Progress_i.h testS.h testC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/inc_user_config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(TAO_ROOT)/tao/corbafwd.h \ + $(ACE_ROOT)/ace/CDR_Stream.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Malloc_T.cpp \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/CDR_Stream.i \ + $(TAO_ROOT)/tao/try_macros.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(ACE_ROOT)/ace/CORBA_macros.h \ + $(TAO_ROOT)/tao/corbafwd.i \ + $(TAO_ROOT)/tao/Environment.h \ + $(TAO_ROOT)/tao/Environment.i \ + $(TAO_ROOT)/tao/ORB.h \ + $(TAO_ROOT)/tao/Exception.h \ + $(TAO_ROOT)/tao/Exception.i \ + $(TAO_ROOT)/tao/IOR_LookupTable.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Functor.h \ + $(ACE_ROOT)/ace/Functor.i \ + $(ACE_ROOT)/ace/Functor_T.h \ + $(ACE_ROOT)/ace/Functor_T.i \ + $(ACE_ROOT)/ace/Functor_T.cpp \ + $(ACE_ROOT)/ace/Hash_Map_Manager.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.cpp \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/tao/Services.h \ + $(TAO_ROOT)/tao/Sequence.h \ + $(TAO_ROOT)/tao/Managed_Types.h \ + $(TAO_ROOT)/tao/Managed_Types.i \ + $(TAO_ROOT)/tao/Sequence.i \ + $(TAO_ROOT)/tao/Sequence_T.h \ + $(TAO_ROOT)/tao/Sequence_T.i \ + $(TAO_ROOT)/tao/Sequence_T.cpp \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/Object.h \ + $(TAO_ROOT)/tao/Object.i \ + $(TAO_ROOT)/tao/varout.i \ + $(TAO_ROOT)/tao/varout.cpp \ + $(TAO_ROOT)/tao/Services.i \ + $(TAO_ROOT)/tao/IORManipulation.h \ + $(TAO_ROOT)/tao/IORS.h \ + $(TAO_ROOT)/tao/IORC.h \ + $(TAO_ROOT)/tao/CDR.h \ + $(TAO_ROOT)/tao/Typecode.h \ + $(TAO_ROOT)/tao/Typecode.i \ + $(TAO_ROOT)/tao/CDR.i \ + $(TAO_ROOT)/tao/IORC.i \ + $(TAO_ROOT)/tao/Servant_Base.h \ + $(TAO_ROOT)/tao/POAC.h \ + $(TAO_ROOT)/tao/PolicyC.h \ + $(TAO_ROOT)/tao/CurrentC.h \ + $(TAO_ROOT)/tao/CurrentC.i \ + $(TAO_ROOT)/tao/PolicyC.i \ + $(TAO_ROOT)/tao/POAC.i \ + $(TAO_ROOT)/tao/Servant_Base.i \ + $(TAO_ROOT)/tao/IORS.i \ + $(TAO_ROOT)/tao/ORB.i \ + $(TAO_ROOT)/tao/Any.h \ + $(TAO_ROOT)/tao/Any.i \ + $(TAO_ROOT)/tao/NVList.h \ + $(TAO_ROOT)/tao/NVList.i \ + $(TAO_ROOT)/tao/Principal.h \ + $(TAO_ROOT)/tao/Principal.i \ + $(TAO_ROOT)/tao/Request.h \ + $(TAO_ROOT)/tao/Context.h \ + $(TAO_ROOT)/tao/Context.i \ + $(TAO_ROOT)/tao/Request.i \ + $(TAO_ROOT)/tao/Server_Request.h \ + $(TAO_ROOT)/tao/Object_KeyC.h \ + $(TAO_ROOT)/tao/Object_KeyC.i \ + $(TAO_ROOT)/tao/GIOP.h \ + $(TAO_ROOT)/tao/GIOP.i \ + $(TAO_ROOT)/tao/Server_Request.i \ + $(TAO_ROOT)/tao/Marshal.h \ + $(TAO_ROOT)/tao/Marshal.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(TAO_ROOT)/tao/POA.h \ + $(TAO_ROOT)/tao/Object_Adapter.h \ + $(TAO_ROOT)/tao/Key_Adapters.h \ + $(ACE_ROOT)/ace/Map.h \ + $(ACE_ROOT)/ace/Map.i \ + $(ACE_ROOT)/ace/Map_T.h \ + $(ACE_ROOT)/ace/Pair.h \ + $(ACE_ROOT)/ace/Pair.i \ + $(ACE_ROOT)/ace/Pair_T.h \ + $(ACE_ROOT)/ace/Pair_T.i \ + $(ACE_ROOT)/ace/Pair_T.cpp \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Map_Manager.cpp \ + $(ACE_ROOT)/ace/Active_Map_Manager.h \ + $(ACE_ROOT)/ace/Active_Map_Manager.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.h \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.i \ + $(ACE_ROOT)/ace/Active_Map_Manager_T.cpp \ + $(ACE_ROOT)/ace/Map_T.i \ + $(ACE_ROOT)/ace/Map_T.cpp \ + $(TAO_ROOT)/tao/Key_Adapters.i \ + $(TAO_ROOT)/tao/Server_Strategy_Factory.h \ + $(TAO_ROOT)/tao/poa_macros.h \ + $(TAO_ROOT)/tao/POAS.h \ + $(TAO_ROOT)/tao/POA_CORBA.h \ + $(TAO_ROOT)/tao/DynAnyC.h \ + $(TAO_ROOT)/tao/DynAnyC.i \ + $(TAO_ROOT)/tao/DomainC.h \ + $(TAO_ROOT)/tao/DomainC.i \ + $(TAO_ROOT)/tao/PollableC.h \ + $(TAO_ROOT)/tao/PollableC.i \ + $(TAO_ROOT)/tao/POAS.i \ + $(TAO_ROOT)/tao/Active_Object_Map.h \ + $(TAO_ROOT)/tao/Active_Object_Map.i \ + $(TAO_ROOT)/tao/Object_Adapter.i \ + $(TAO_ROOT)/tao/POAManager.h \ + $(TAO_ROOT)/tao/POAManager.i \ + $(TAO_ROOT)/tao/POA.i \ + $(TAO_ROOT)/tao/Stub.h \ + $(TAO_ROOT)/tao/Pluggable.h \ + $(TAO_ROOT)/tao/Pluggable.i \ + $(TAO_ROOT)/tao/MProfile.h \ + $(TAO_ROOT)/tao/MProfile.i \ + $(TAO_ROOT)/tao/MessagingS.h \ + $(TAO_ROOT)/tao/TimeBaseS.h \ + $(TAO_ROOT)/tao/TimeBaseC.h \ + $(TAO_ROOT)/tao/TimeBaseC.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.h \ + $(TAO_ROOT)/tao/TimeBaseS_T.i \ + $(TAO_ROOT)/tao/TimeBaseS_T.cpp \ + $(TAO_ROOT)/tao/TimeBaseS.i \ + $(TAO_ROOT)/tao/MessagingC.h \ + $(TAO_ROOT)/tao/IOPC.h \ + $(TAO_ROOT)/tao/IOPC.i \ + $(TAO_ROOT)/tao/MessagingC.i \ + $(TAO_ROOT)/tao/MessagingS.i \ + $(TAO_ROOT)/tao/Stub.i \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/ORB_Core.h \ + $(TAO_ROOT)/tao/Policy_Manager.h \ + $(TAO_ROOT)/tao/Policy_Manager.i \ + $(TAO_ROOT)/tao/Resource_Factory.h \ + $(TAO_ROOT)/tao/Protocol_Factory.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies.i \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Synch_Options.i \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Strategies_T.i \ + $(ACE_ROOT)/ace/Strategies_T.cpp \ + $(ACE_ROOT)/ace/Service_Repository.h \ + $(ACE_ROOT)/ace/Service_Types.h \ + $(ACE_ROOT)/ace/Service_Types.i \ + $(ACE_ROOT)/ace/Service_Repository.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/WFMO_Reactor.i \ + $(TAO_ROOT)/tao/ORB_Core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(ACE_ROOT)/ace/Dynamic_Service.cpp \ + $(TAO_ROOT)/tao/Operation_Table.h \ + $(TAO_ROOT)/tao/Client_Strategy_Factory.h \ + $(TAO_ROOT)/tao/Invocation.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.h \ + $(TAO_ROOT)/tao/Reply_Dispatcher.i \ + $(TAO_ROOT)/tao/Invocation.i \ + $(TAO_ROOT)/tao/InconsistentTypeCodeC.h \ + $(TAO_ROOT)/tao/DynAny_i.h \ + $(TAO_ROOT)/tao/Union.h \ + $(TAO_ROOT)/tao/ValueBase.h \ + $(TAO_ROOT)/tao/ValueBase.i \ + $(TAO_ROOT)/tao/ValueFactory.h \ + $(TAO_ROOT)/tao/ValueFactory.i \ + $(TAO_ROOT)/tao/ObjectIDList.h \ + $(TAO_ROOT)/tao/ObjectIDList.i \ + $(TAO_ROOT)/tao/WrongTransactionC.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.h \ + $(TAO_ROOT)/tao/Asynch_Invocation.i \ + testC.i testS_T.h testS_T.i testS_T.cpp testS.i Progress_i.i + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/examples/AMI/FL_Callback/Peer_i.cpp b/TAO/examples/AMI/FL_Callback/Peer_i.cpp new file mode 100644 index 00000000000..2f4aed8abff --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/Peer_i.cpp @@ -0,0 +1,159 @@ +// $Id$ + +#include "Peer_i.h" + +#if !defined(__ACE_INLINE__) +#include "Peer_i.i" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(FL_Callback, Peer_i, "$Id$") + +Peer_Handler_i::Peer_Handler_i (Peer_i *peer) + : peer_ (peer) +{ +} + +void +Peer_Handler_i::request (CORBA::Long retval, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + static int i = 0; + i++; + if (i % 100 == 0) + ACE_DEBUG ((LM_DEBUG, "(%P|%t) %d replies received\n", i)); + this->peer_->reply (retval, ACE_TRY_ENV); +} + +void +Peer_Handler_i::start (CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ +} + +void +Peer_Handler_i::shutdown (CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) + +{ +} + +Peer_i::Peer_i (void) + : reply_handler_ (this) +{ +} + +Peer_i::~Peer_i (void) +{ +} + +void +Peer_i::init (CORBA::ORB_ptr orb, + Progress_ptr progress, + const ACE_Time_Value &delay, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + this->orb_ = CORBA::ORB::_duplicate (orb); + this->progress_ = Progress::_duplicate (progress); + this->delay_ = delay; + + Peer_var peer = this->_this (ACE_TRY_ENV); + ACE_CHECK; + + ACE_DEBUG ((LM_DEBUG, "Peer (%P|%t) - binding\n")); + this->id_ = this->progress_->bind (peer.in (), ACE_TRY_ENV); + ACE_CHECK; +} + +void +Peer_i::reply (CORBA::Long result, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + this->progress_->recv_reply (result, ACE_TRY_ENV); +} + +CORBA::Long +Peer_i::request (CORBA::Long id, + CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_Time_Value tv = this->delay_; + ACE_OS::sleep (tv); + + return id; +} + +void +Peer_i::start (const PeerSet &the_peers, + CORBA::Long iterations, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + AMI_Peer_Handler_var handler = + this->reply_handler_._this (ACE_TRY_ENV); + ACE_CHECK; + + // @@ Report errors as exceptions... + Peer_Task *task; + ACE_NEW (task, Peer_Task (the_peers, + iterations, + this->progress_.in (), + handler.in (), + this->id_)); + task->activate (); +} + +void +Peer_i::shutdown (CORBA::Environment &ACE_TRY_ENV) +{ + this->orb_->shutdown (0, ACE_TRY_ENV); +} + +// **************************************************************** + +Peer_Task::Peer_Task (const PeerSet& the_peers, + CORBA::Long iterations, + Progress_ptr progress, + AMI_Peer_Handler_ptr handler, + CORBA::Long id) + : the_peers_ (the_peers), + iterations_ (iterations), + progress_ (Progress::_duplicate (progress)), + handler_ (AMI_Peer_Handler::_duplicate (handler)), + id_ (id) +{ +} + +int +Peer_Task::svc (void) +{ + for (int i = 0; i != this->iterations_; ++i) + { + CORBA::ULong l = this->the_peers_.length (); + for (CORBA::ULong j = 0; j != l; ++j) + { + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + this->the_peers_[j]->sendc_request (this->handler_.in (), + this->id_, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + this->progress_->sent_request (this->id_, + ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + // Ignore exceptions; + } + ACE_ENDTRY; + } + if (i % 100 == 0) + ACE_DEBUG ((LM_DEBUG, "(%P|%t) %d requests sent\n", i)); + } + return 0; +} diff --git a/TAO/examples/AMI/FL_Callback/Peer_i.h b/TAO/examples/AMI/FL_Callback/Peer_i.h new file mode 100644 index 00000000000..c8d7fba80f9 --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/Peer_i.h @@ -0,0 +1,128 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO/examples/AMI/FL_Callback +// +// = FILENAME +// Peer_i.h +// +// = AUTHOR +// Carlos O'Ryan +// +// ============================================================================ + +#ifndef PEER_I_H +#define PEER_I_H + +#include "testS.h" +#include "ace/Task.h" + +class Peer_i; + +class Peer_Handler_i : public POA_AMI_Peer_Handler +{ +public: + Peer_Handler_i (Peer_i *peer); + // The peer + + virtual void request (CORBA::Long retval, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void start (CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void shutdown (CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)); + +private: + Peer_i *peer_; + // The real implementation +}; + +class Peer_i : public POA_Peer +{ +public: + Peer_i (void); + // Constructor + + virtual ~Peer_i (void); + // Destructor + + void init (CORBA::ORB_ptr orb, + Progress_ptr progress, + const ACE_Time_Value &delay, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void reply (CORBA::Long result, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)); + // Used by the Reply_Handler to indicate that a reply has been + // received. + + // = See test.idl for an explanation of these methods. + CORBA::Long request (CORBA::Long id, + CORBA::Environment& ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)); + void start (const PeerSet& the_peers, + CORBA::Long iterations, + CORBA::Environment& ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)); + + void shutdown (CORBA::Environment& ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)); + +private: + Peer_Handler_i reply_handler_; + // The reply_handler + + CORBA::ORB_var orb_; + // The orb + + Progress_var progress_; + // The interface to report back progress. + + ACE_Time_Value delay_; + // The delay on each request + + CORBA::Long id_; + // The id assigned by the progress interface +}; + +class Peer_Task : public ACE_Task_Base +{ + // = DESCRIPTION + // Run a "start" request on a separate thread. +public: + Peer_Task (const PeerSet& the_peers, + CORBA::Long iterations, + Progress_ptr progress, + AMI_Peer_Handler_ptr handler, + CORBA::Long id); + + virtual int svc (void); + // The thread entry point + +private: + PeerSet the_peers_; + // The peers + + CORBA::Long iterations_; + // The number of iterations + + Progress_var progress_; + // To report progress + + AMI_Peer_Handler_var handler_; + // To issue async requests + + CORBA::Long id_; + // Our id +}; + +#if defined(__ACE_INLINE__) +#include "Peer_i.i" +#endif /* __ACE_INLINE__ */ + +#endif /* PEER_I_H */ diff --git a/TAO/examples/AMI/FL_Callback/Peer_i.i b/TAO/examples/AMI/FL_Callback/Peer_i.i new file mode 100644 index 00000000000..cfa1da318d3 --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/Peer_i.i @@ -0,0 +1 @@ +// $Id$ diff --git a/TAO/examples/AMI/FL_Callback/Progress_i.cpp b/TAO/examples/AMI/FL_Callback/Progress_i.cpp new file mode 100644 index 00000000000..c25c334b12f --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/Progress_i.cpp @@ -0,0 +1,177 @@ +// $Id$ + +#include "Progress_i.h" + +#include <FL/Fl_Slider.h> +#include <FL/Fl_Button.h> + +#if defined(ACE_HAS_FL) + +#if !defined(__ACE_INLINE__) +#include "test_i.i" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(FL_Cube, test_i, "$Id$") + +Progress_i::Progress_i (Progress_Window *window) + : window_ (window) +{ +} + +void +Progress_i::sent_request (CORBA::Long id, + CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + //ACE_DEBUG ((LM_DEBUG, "Progress (%t) - sent request %d\n", id)); + this->window_->sent_request (id); +} + +void +Progress_i::recv_reply (CORBA::Long id, + CORBA::Environment &) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + this->window_->recv_reply (id); +} + +CORBA::Long +Progress_i::bind (Peer_ptr a_peer, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + ACE_DEBUG ((LM_DEBUG, "Progress (%t) - peer bound\n")); + return this->window_->bind (a_peer, ACE_TRY_ENV); +} + +// **************************************************************** + +Progress_Window::Progress_Window (int n_peers, + int n_iterations, + int x, int y, + int w, int h, + const char* l) + : Fl_Box (x, y, w, h, l), + n_peers_ (n_peers), + peers_ (n_peers), + n_iterations_ (n_iterations) +{ + ACE_NEW (this->request_progress_, Fl_Widget*[this->n_peers_]); + ACE_NEW (this->reply_progress_, Fl_Widget*[this->n_peers_]); + + // @@ leak... + Fl_Widget *button = new Fl_Button (x + 5, y + 5, + 50, h - 10, + "Start"); + button->callback (Progress_Window::start_callback, this); + + // Compute the slider height, leaving a little margin... + int sh = h / ( 2 * this->n_peers_); + sh = sh - 5; + + // The initial position, with margin... + int sy = y + 5; + + // Set the width of the sliders... + int sx = x + 60; + int sw = w - 65; + int max = this->n_peers_ * this->n_iterations_; + for (int i = 0; i < this->n_peers_; ++i) + { + Fl_Slider *obj; + + this->request_progress_[i] = obj = + new Fl_Slider (FL_HOR_FILL_SLIDER, sx, sy, sw, sh, ""); + obj->color (FL_BLACK); + obj->selection_color (FL_RED); + obj->bounds (0, max); + obj->precision (0); + obj->value (0); + sy += sh + 5; + + this->reply_progress_[i] = obj = + new Fl_Slider (FL_HOR_FILL_SLIDER, sx, sy, sw, sh, ""); + obj->color (FL_BLACK); + obj->selection_color (FL_GREEN); + obj->bounds (0, max); + obj->precision (0); + obj->value (0); + sy += sh + 5; + } +} + +void +Progress_Window::sent_request (CORBA::Long id) +{ + if (id < 0 || id >= this->n_peers_) + return; + Fl_Slider *obj = + ACE_dynamic_cast (Fl_Slider*,this->request_progress_[id]); + obj->value (obj->value () + 1); + obj->redraw (); + + int i = obj->value (); + if (i % 100 == 0) + ACE_DEBUG ((LM_DEBUG, "Progress (%t) - recv reply %d\n", i)); +} + +void +Progress_Window::recv_reply (CORBA::Long id) +{ + if (id < 0 || id >= this->n_peers_) + return; + Fl_Slider *obj = + ACE_dynamic_cast (Fl_Slider*,this->reply_progress_[id]); + obj->value (obj->value () + 1); + obj->redraw (); + + int i = obj->value (); + if (i % 100 == 0) + ACE_DEBUG ((LM_DEBUG, "Progress (%t) - recv reply %d\n", i)); +} + +CORBA::Long +Progress_Window::bind (Peer_ptr a_peer, + CORBA::Environment &) +{ + CORBA::ULong l = this->peers_.length (); + this->peers_.length (l + 1); + this->peers_[l] = Peer::_duplicate (a_peer); + + return l; +} + +void +Progress_Window::start_callback (Fl_Widget* /* widget */, + void *data) +{ + Progress_Window *self = ACE_static_cast (Progress_Window*, data); + self->start (); +} + +void +Progress_Window::start () +{ + if (this->peers_.length () < CORBA::ULong (this->n_peers_)) + return; + + ACE_DECLARE_NEW_CORBA_ENV; + for (CORBA::ULong i = 0; i != this->peers_.length (); ++i) + { + ACE_TRY + { + this->peers_[i]->start (this->peers_, + this->n_iterations_, + ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + // Ignore exceptions + } + ACE_ENDTRY; + } +} + + +#endif /* ACE_HAS_FL */ diff --git a/TAO/examples/AMI/FL_Callback/Progress_i.h b/TAO/examples/AMI/FL_Callback/Progress_i.h new file mode 100644 index 00000000000..9066b6833e6 --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/Progress_i.h @@ -0,0 +1,100 @@ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO/examples/AMI/FL_Callback +// +// = FILENAME +// Progress_i.h +// +// = AUTHOR +// Carlos O'Ryan +// +// ============================================================================ + +#ifndef PROGRESS_I_H +#define PROGRESS_I_H + +#include "testS.h" + +#if defined(ACE_HAS_FL) + +#include <FL/Fl_Box.h> + +class Progress_Window : public Fl_Box +{ +public: + Progress_Window (int n_peers, + int n_iterations, + int x, int y, + int w, int h, + const char* l = 0); + // Constructor + + void sent_request (CORBA::Long id); + void recv_reply (CORBA::Long id); + // Keep track of the progress on each peer + + CORBA::Long bind (Peer_ptr a_peer, + CORBA::Environment &ACE_TRY_ENV); + // One of the peers has bound to the server + + void start (void); + // Start the peers... + +private: + static void start_callback (Fl_Widget* widget, void *data); + // The callback method + +private: + int n_peers_; + // The total number of peers + + PeerSet peers_; + // The peers + + int n_iterations_; + // The number of iterations; + + Fl_Widget** request_progress_; + Fl_Widget** reply_progress_; + // The set of sliders where we keep track of each client +}; + +class Progress_i : public POA_Progress +{ + // = TITLE + // Progress server implementation + // + // = DESCRIPTION + // Implements the Progress interface in test.idl, forward the + // calls to the Progress_Window class + // +public: + Progress_i (Progress_Window* window); + // ctor + + // = The Progress methods. + void sent_request (CORBA::Long id, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)); + void recv_reply (CORBA::Long id, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)); + CORBA::Long bind (Peer_ptr a_peer, + CORBA::Environment&) + ACE_THROW_SPEC ((CORBA::SystemException)); + +private: + Progress_Window* window_; + // Display the graphics... +}; + +#if defined(__ACE_INLINE__) +#include "Progress_i.i" +#endif /* __ACE_INLINE__ */ + +#endif /* ACE_HAS_FL */ + +#endif /* PROGRESS_I_H */ diff --git a/TAO/examples/AMI/FL_Callback/Progress_i.i b/TAO/examples/AMI/FL_Callback/Progress_i.i new file mode 100644 index 00000000000..cfa1da318d3 --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/Progress_i.i @@ -0,0 +1 @@ +// $Id$ diff --git a/TAO/examples/AMI/FL_Callback/README b/TAO/examples/AMI/FL_Callback/README new file mode 100644 index 00000000000..f2352ecdde5 --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/README @@ -0,0 +1,14 @@ +# $Id$ + + A demo of the AMI callback model, using the FL toolkit for the +GUI components. + + Run as: + +$ ./progress -p 4 -i 10000 -ORBSvcConf svc.conf +$ ./peer -n 1 -t 10000 -ORBSvcConf peer.conf +$ ./peer -n 2 -t 10000 -ORBSvcConf peer.conf +$ ./peer -n 4 -t 10000 -ORBSvcConf peer.conf +$ ./peer -n 8 -t 10000 -ORBSvcConf peer.conf + + then press "start" in the progress window. diff --git a/TAO/examples/AMI/FL_Callback/peer.conf b/TAO/examples/AMI/FL_Callback/peer.conf new file mode 100644 index 00000000000..688fd7715c1 --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/peer.conf @@ -0,0 +1,4 @@ +# $Id$ +# +static Resource_Factory "-ORBReactorType tp" +static Client_Strategy_Factory "-ORBTransportMuxStrategy MUXED" diff --git a/TAO/examples/AMI/FL_Callback/peer.cpp b/TAO/examples/AMI/FL_Callback/peer.cpp new file mode 100644 index 00000000000..e59159d401f --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/peer.cpp @@ -0,0 +1,178 @@ +// $Id$ + +#include "Peer_i.h" +#include "ace/Get_Opt.h" +#include "ace/Task.h" +#include "ace/Sched_Params.h" + +ACE_RCSID(FL_Callback, peer, "$Id$") + +const char *ior = "file://progress.ior"; +int nthreads = 4; +int interval = 0; // microseconds + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "k:n:t:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.optarg; + break; + + case 'n': + nthreads = ACE_OS::atoi (get_opts.optarg); + break; + + case 't': + interval = ACE_OS::atoi (get_opts.optarg); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-o <iorfile>" + "-n <threads>" + "-t <microseconds>" + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +class Worker : public ACE_Task_Base +{ + // = TITLE + // Run a server thread + // + // = DESCRIPTION + // Use the ACE_Task_Base class to run server threads + // +public: + Worker (CORBA::ORB_ptr orb); + // ctor + + virtual int svc (void); + // The thread entry point. + +private: + CORBA::ORB_var orb_; + // The orb +}; + +int +main (int argc, char *argv[]) +{ + int priority = + (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) + + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2; + + priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, + priority); + + priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, + priority); + + // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. + if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO, + priority, + ACE_SCOPE_PROCESS)) != 0) + { + if (ACE_OS::last_error () == EPERM) + { + ACE_DEBUG ((LM_DEBUG, + "server (%P|%t): user is not superuser, " + "test runs in time-shared class\n")); + } + else + ACE_ERROR ((LM_ERROR, + "server (%P|%t): sched_params failed\n")); + } + + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "", ACE_TRY_ENV); + ACE_TRY_CHECK; + + CORBA::Object_var poa_object = + orb->resolve_initial_references("RootPOA"); + if (CORBA::is_nil (poa_object.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (ACE_TRY_ENV); + ACE_TRY_CHECK; + + poa_manager->activate (ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (parse_args (argc, argv) != 0) + return 1; + + CORBA::Object_var progress_object = + orb->string_to_object (ior, ACE_TRY_ENV); + ACE_TRY_CHECK; + + Progress_var progress = + Progress::_narrow (progress_object.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + ACE_Time_Value delay (0, interval); + + Peer_i peer; + peer.init (orb.in (), + progress.in (), + delay, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + Worker worker (orb.in ()); + if (worker.activate (THR_NEW_LWP | THR_JOINABLE, + nthreads) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot activate client threads\n"), + 1); + + worker.thr_mgr ()->wait (); + + ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Catched exception:"); + return 1; + } + ACE_ENDTRY; + + return 0; +} + +// **************************************************************** + +Worker::Worker (CORBA::ORB_ptr orb) + : orb_ (CORBA::ORB::_duplicate (orb)) +{ +} + +int +Worker::svc (void) +{ + ACE_DEBUG ((LM_DEBUG, "(%P|%t) starting event loop\n")); + this->orb_->run (); + return 0; +} diff --git a/TAO/examples/AMI/FL_Callback/progress.cpp b/TAO/examples/AMI/FL_Callback/progress.cpp new file mode 100644 index 00000000000..14c38bf9a13 --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/progress.cpp @@ -0,0 +1,150 @@ +// $Id$ + +#include "Progress_i.h" +#include "ace/Get_Opt.h" + +ACE_RCSID(FL_Callback, progress, "$Id$") + +#if !defined (ACE_HAS_FL) + +int main (int, char *[]) +{ + ACE_ERROR ((LM_INFO, + "This example requires FL support\n")); + return 0; +} + +#else + +#include <FL/Fl.h> +#include <FL/Fl_Window.h> + +const char *ior_output_file = "progress.ior"; +int n_iterations = 1000; +int n_peers = 1; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "o:p:i:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'o': + ior_output_file = get_opts.optarg; + break; + + case 'p': + n_peers = ACE_OS::atoi (get_opts.optarg); + break; + + case 'i': + n_iterations = ACE_OS::atoi (get_opts.optarg); + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-o <iorfile>" + "-p <peers>" + "-i <iterations>" + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +int +main (int argc, char *argv[]) +{ + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "", ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (parse_args (argc, argv) != 0) + return 1; + + int w = 320; + int h = 30 * n_peers + 20; + Fl_Window window(w, h); + + Progress_Window sw (n_peers, n_iterations, + 10, + 10, + window.w () - 20, + window.h () - 20); + window.resizable (&sw); + + window.end (); + + char* targv[] = { argv[0] }; + window.show (1, targv); + + sw.show (); + + CORBA::Object_var poa_object = + orb->resolve_initial_references("RootPOA"); + if (CORBA::is_nil (poa_object.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (ACE_TRY_ENV); + ACE_TRY_CHECK; + + poa_manager->activate (ACE_TRY_ENV); + ACE_TRY_CHECK; + + Progress_i server_impl (&sw); + + Progress_var server = + server_impl._this (ACE_TRY_ENV); + ACE_TRY_CHECK; + + CORBA::String_var ior = + orb->object_to_string (server.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ())); + + // If the ior_output_file exists, output the ior to it + if (ior_output_file != 0) + { + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); + if (output_file == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file for writing IOR: %s", + ior_output_file), + 1); + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); + } + + if (Fl::run () == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "Fl::run"), -1); + ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Catched exception:"); + return 1; + } + ACE_ENDTRY; + return 0; +} + +#endif /* ACE_HAS_FL */ diff --git a/TAO/examples/AMI/FL_Callback/svc.conf b/TAO/examples/AMI/FL_Callback/svc.conf new file mode 100644 index 00000000000..be6fb27be83 --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/svc.conf @@ -0,0 +1,3 @@ +# $Id$ +# +static Resource_Factory "-ORBReactorType fl" diff --git a/TAO/examples/AMI/FL_Callback/test.idl b/TAO/examples/AMI/FL_Callback/test.idl new file mode 100644 index 00000000000..87dead7906d --- /dev/null +++ b/TAO/examples/AMI/FL_Callback/test.idl @@ -0,0 +1,41 @@ +// +// $Id$ +// + +interface Peer; +typedef sequence<Peer> PeerSet; + +interface Peer +{ + // = DESCRIPTION + // A simple interface to demo the AMI implementation. + // A set of "peers" run in the network, each one binds to the + // progress server, when all the peers are bound the server + // requests that each one send multiple "request" messages to each + // other, using AMI. The progress is reported back to the progress + // server for display. + + long request (in long id); + // A simple request, sends back the number in <id>. + + oneway void start (in PeerSet the_peers, + in long iterations); + // Start the demo in one Peer + + oneway void shutdown (); + // Shutdown the ORB +}; + +interface Progress +{ + // = DESCRIPTION + // This interface is used to report progress, multiple + // applications identified by an <id> run in parallel, each one + // reports as the asynchronous requests are sent and received. + + oneway void sent_request (in long id); + oneway void recv_reply (in long id); + + long bind (in Peer a_peer); + // Bind one of the peers. +}; diff --git a/TAO/examples/AMI/Makefile b/TAO/examples/AMI/Makefile new file mode 100644 index 00000000000..50ffadd7cdc --- /dev/null +++ b/TAO/examples/AMI/Makefile @@ -0,0 +1,23 @@ +#---------------------------------------------------------------------------- +# +# $Id$ +# +# Makefile for the TAO examples +# +#---------------------------------------------------------------------------- + +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +DIRS = FL_Callback + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nolocal.GNU diff --git a/TAO/examples/Makefile b/TAO/examples/Makefile index ffc594c62ef..e7d8c8deb1c 100644 --- a/TAO/examples/Makefile +++ b/TAO/examples/Makefile @@ -15,7 +15,8 @@ DIRS = Callback_Quoter \ Logging \ Simple \ Event_Comm \ - OBV + OBV \ + AMI #---------------------------------------------------------------------------- # Include macros and targets diff --git a/TAO/performance-tests/Latency/Makefile b/TAO/performance-tests/Latency/Makefile index 7e230178dee..86c4322be2a 100644 --- a/TAO/performance-tests/Latency/Makefile +++ b/TAO/performance-tests/Latency/Makefile @@ -17,6 +17,10 @@ LDLIBS = -lTAO IDLFILES = testC testS BIN = client st_client server st_server +ifdef AMI +BIN += ami-latency-client ami-throughput-client +endif # AMI + SRC = $(addsuffix .cpp, $(BIN) $(IDLFILES) test_i) CLIENT_OBJS = client.o testC.o @@ -24,7 +28,19 @@ ST_CLIENT_OBJS = st_client.o testC.o SERVER_OBJS = server.o test_i.o $(addsuffix .o, $(IDLFILES)) ST_SERVER_OBJS = st_server.o test_i.o $(addsuffix .o, $(IDLFILES)) -TAO_IDLFLAGS += -Ge 1 +ifdef AMI +AMI_LATENCY_CLIENT_OBJS = ami-latency-client.o testC.o +AMI_THROUGHPUT_CLIENT_OBJS = ami-throughput-client.o testC.o +endif # AMI + +BUILD = $(BIN) +VLDLIBS = $(LDLIBS:%=%$(VAR)) +VBIN = $(BIN:%=%$(VAR)) +TAO_IDLFLAGS += -Ge 1 + +ifdef AMI +TAO_IDLFLAGS += -GC +endif # AMI #---------------------------------------------------------------------------- # Include macros and targets @@ -56,6 +72,14 @@ server: $(addprefix $(VDIR),$(SERVER_OBJS)) st_server: $(addprefix $(VDIR),$(ST_SERVER_OBJS)) $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) +ifdef AMI +ami-latency-client: $(addprefix $(VDIR),$(AMI_LATENCY_CLIENT_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) + +ami-throughput-client: $(addprefix $(VDIR),$(AMI_THROUGHPUT_CLIENT_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) $(POSTLINK) +endif # AMI + realclean: clean -$(RM) $(foreach ext, $(IDL_EXT), test$(ext)) @@ -187,8 +211,7 @@ realclean: clean $(ACE_ROOT)/ace/High_Res_Timer.h \ $(ACE_ROOT)/ace/High_Res_Timer.i \ $(ACE_ROOT)/ace/Sched_Params.h \ - $(ACE_ROOT)/ace/Sched_Params.i \ - testC.h \ + $(ACE_ROOT)/ace/Sched_Params.i testC.h \ $(TAO_ROOT)/tao/corba.h \ $(TAO_ROOT)/tao/corbafwd.h \ $(ACE_ROOT)/ace/CDR_Stream.h \ @@ -401,8 +424,7 @@ realclean: clean $(ACE_ROOT)/ace/High_Res_Timer.h \ $(ACE_ROOT)/ace/High_Res_Timer.i \ $(ACE_ROOT)/ace/Sched_Params.h \ - $(ACE_ROOT)/ace/Sched_Params.i \ - testC.h \ + $(ACE_ROOT)/ace/Sched_Params.i testC.h \ $(TAO_ROOT)/tao/corba.h \ $(TAO_ROOT)/tao/corbafwd.h \ $(ACE_ROOT)/ace/CDR_Stream.h \ diff --git a/TAO/performance-tests/Latency/README b/TAO/performance-tests/Latency/README index 5f27d6dceff..cf27c9d8775 100644 --- a/TAO/performance-tests/Latency/README +++ b/TAO/performance-tests/Latency/README @@ -43,3 +43,23 @@ $ client -ORBSvcConf client.conf -n 4 -i 1000 $ st_server -ORBSvcConf st_server.conf $ st_client -ORBSvcConf st_client.conf -i 1000 + +AMI Latency Test: +================== + +$ server -o ior_file \ + -ORBSvcConf server.conf + +$ ami-latency-client -k file://ior_file -i 1000 \ + -ORBSvcConf client-st-muxed.conf + +AMI Throughput Test: +================== + +$ server -o ior_file -ORBEndpoint iiop://localhost:port \ + -ORBSvcConf server.conf + +$ ami-throughput-client -s -k file://ior_file -i 1000 \ + -ORBSvcConf client-st-muxed.conf \ + -ORBPreconnect iiop://localhost:port + diff --git a/TAO/performance-tests/Latency/ami-latency-client.cpp b/TAO/performance-tests/Latency/ami-latency-client.cpp new file mode 100644 index 00000000000..ba66e05a575 --- /dev/null +++ b/TAO/performance-tests/Latency/ami-latency-client.cpp @@ -0,0 +1,320 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "ace/Task.h" +#include "ace/Stats.h" +#include "ace/High_Res_Timer.h" +#include "ace/Sched_Params.h" +#include "testS.h" + +ACE_RCSID(Latency, client, "$Id$") + +const char *ior = "file://test.ior"; + +int niterations = 5; + +int sleep_flag = 0; + +ACE_hrtime_t latency_base; + +ACE_hrtime_t throughput_base; + +ACE_Throughput_Stats throughput_stats; +// Global throughput statistics. + +ACE_Time_Value sleep_time (0, 10000); + +int done = 0; + + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "k:n:i:s"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.optarg; + break; + // case 'n': + // nthreads = ACE_OS::atoi (get_opts.optarg); + // break; + case 'i': + niterations = ACE_OS::atoi (get_opts.optarg); + break; + case 's': + sleep_flag = 1; + break; + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + // "-n <nthreads> " + "-i <niterations> " + "-v " + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +class Handler : public POA_AMI_Test_Handler +{ +public: + Handler (void) {}; + + void test_method (CORBA::ULongLong stamp, + CORBA::Environment&) + { + ACE_hrtime_t now = ACE_OS::gethrtime (); + throughput_stats.sample (now - throughput_base, + now - stamp); + + done = 1; + }; + + ~Handler (void) {}; +}; + +class Client +{ + // = TITLE + // Run the client thread. + // + // = DESCRIPTION + // Use the ACE_Task_Base class to run the client threads. + // +public: + Client (void); + // ctor + + void set (Test_ptr server, + int niterations, + CORBA::ORB_ptr orb, + AMI_Test_Handler_ptr reply_handler); + // Set the test attributes. + + void accumulate_into (ACE_Throughput_Stats &throughput) const; + // Accumulate the throughput statistics into <throughput> + + void dump_stats (const char* msg, ACE_UINT32 gsf); + // Accumulate the throughput statistics into <throughput> + + // = The ACE_Task_Base methods.... + virtual int svc (void); + +private: + Test_var server_; + // The server. + + int niterations_; + // The number of iterations on each client thread. + + CORBA::ORB_ptr orb_; + // Cache the ORB pointer. + + AMI_Test_Handler_ptr reply_handler_; + // ReplyHandler object. +}; + +int +main (int argc, char *argv[]) +{ + int priority = + (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) + + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2; + // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. + + if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO, + priority, + ACE_SCOPE_PROCESS)) != 0) + { + if (ACE_OS::last_error () == EPERM) + { + ACE_DEBUG ((LM_DEBUG, + "server (%P|%t): user is not superuser, " + "test runs in time-shared class\n")); + } + else + ACE_ERROR ((LM_ERROR, + "server (%P|%t): sched_params failed\n")); + } + + ACE_TRY_NEW_ENV + { + ACE_DEBUG ((LM_DEBUG, "High res. timer calibration....")); + ACE_High_Res_Timer::calibrate (); + ACE_DEBUG ((LM_DEBUG, "done\n")); + + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "", ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (parse_args (argc, argv) != 0) + return 1; + + CORBA::Object_var object = + orb->string_to_object (ior, ACE_TRY_ENV); + ACE_TRY_CHECK; + + Test_var server = + Test::_narrow (object.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (CORBA::is_nil (server.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Object reference <%s> is nil\n", + ior), + 1); + } + + // ReplyHandler object. + Handler handler; + AMI_Test_Handler_var reply_handler = handler._this (ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Activate POA to handle the call back. + + CORBA::Object_var poa_object = + orb->resolve_initial_references("RootPOA"); + if (CORBA::is_nil (poa_object.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (ACE_TRY_ENV); + ACE_TRY_CHECK; + + poa_manager->activate (ACE_TRY_ENV); + ACE_TRY_CHECK; + + Client client; + + // Init the client object. + client.set (server.in (), + niterations, + orb, + reply_handler.in ()); + + // Start the test. + client.svc (); + + ACE_Throughput_Stats throughput; + char buf[64]; + + ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor (); + + client.accumulate_into (throughput); + + ACE_OS::sprintf (buf, "Single Threaded:AMI"); + client.dump_stats (buf, gsf); + + throughput.dump_results ("Aggregated", gsf); + + // server->shutdown (ACE_TRY_ENV); + // ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Catched exception:"); + return 1; + } + ACE_ENDTRY; + + return 0; +} + +// **************************************************************** + +Client::Client (void) + : niterations_ (0), + orb_ (0), + reply_handler_ (0) +{ +} + +void +Client::set (Test_ptr server, + int niterations, + CORBA::ORB_ptr orb, + AMI_Test_Handler_ptr reply_handler) +{ + this->server_ = Test::_duplicate (server); + this->niterations_ = niterations; + this->orb_ = orb; + this->reply_handler_ = reply_handler; +} + +int +Client::svc (void) +{ + ACE_TRY_NEW_ENV + { + // @@ We should use "validate_connection" for this. + for (int j = 0; j < 100; ++j) + { + server_->_is_a ("IDL:Test:1.0", ACE_TRY_ENV); + ACE_TRY_CHECK; + } + + // Init global throughput base. + throughput_base = ACE_OS::gethrtime (); + + for (size_t i = 0; i < this->niterations_; ++i) + { + // Get timestamp. + latency_base = ACE_OS::gethrtime (); + + // Invoke asynchronous operation. + server_->sendc_test_method (this->reply_handler_, + ACE_OS::gethrtime (), + ACE_TRY_ENV); + + if (sleep_flag) + // Spend 10 msecs running the ORB. + this->orb_->run (sleep_time); + else + while (!done) + this->orb_->perform_work (); + + ACE_TRY_CHECK; + + if (TAO_debug_level > 0 && i % 100 == 0) + ACE_DEBUG ((LM_DEBUG, "(%P|%t) iteration = %d\n", i)); + + done = 0; + } + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Latency: exception raised"); + } + ACE_ENDTRY; + return 0; +} + +void +Client::accumulate_into (ACE_Throughput_Stats &t) const +{ + t.accumulate (throughput_stats); +} + +void +Client::dump_stats (const char* msg, ACE_UINT32 gsf) +{ + throughput_stats.dump_results (msg, gsf); +} diff --git a/TAO/performance-tests/Latency/ami-throughput-client.cpp b/TAO/performance-tests/Latency/ami-throughput-client.cpp new file mode 100644 index 00000000000..f8b3b95e892 --- /dev/null +++ b/TAO/performance-tests/Latency/ami-throughput-client.cpp @@ -0,0 +1,375 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "ace/Task.h" +#include "ace/Stats.h" +#include "ace/High_Res_Timer.h" +#include "ace/Sched_Params.h" +#include "testS.h" + +ACE_RCSID(Latency, client, "$Id$") + +const char *ior = "file://test.ior"; + +size_t niterations = 5; + +int sleep_flag = 0; + +int done = 0; + +ACE_hrtime_t *latency_base_array; + +ACE_hrtime_t throughput_base; + +ACE_Throughput_Stats throughput_stats; + +int +parse_args (int argc, char *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, "k:n:i:s"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'k': + ior = get_opts.optarg; + break; + // case 'n': + // nthreads = ACE_OS::atoi (get_opts.optarg); + // break; + case 'i': + niterations = ACE_OS::atoi (get_opts.optarg); + break; + case 's': + sleep_flag = 1; + break; + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-k <ior> " + // "-n <nthreads> " + "-i <niterations> " + "-s " + "\n", + argv [0]), + -1); + } + // Indicates sucessful parsing of the command line + return 0; +} + +// ********************************************************************* + +class Handler : public POA_AMI_Test_Handler +{ +public: + Handler (CORBA::ORB_ptr orb) + : nreplies_received_ (0), + orb_ (orb) + {}; + + void test_method (CORBA::ULongLong stamp, + CORBA::Environment &) + { + // Get the currect time. + ACE_hrtime_t now = ACE_OS::gethrtime (); + int i = this->nreplies_received_; + + if (TAO_debug_level > 0) + fprintf (stderr, + "Latency %llu %llu %llu\n", + now, stamp, latency_base_array[i]); + + // Take the sample. + throughput_stats.sample (now - throughput_base, + now - stamp); + + if (TAO_debug_level > 0 && i % 100 == 0) + ACE_DEBUG ((LM_DEBUG, "(%P|%t) received = %d\n", i)); + + // Inc count. + this->nreplies_received_++; + + // Check for end. + if (this->nreplies_received_ == niterations) + { + done = 1; + if (sleep_flag) + orb_->shutdown (); + } + }; + + ~Handler (void) {}; + +private: + size_t nreplies_received_; + // Number of replies received so far. + + CORBA::ORB_ptr orb_; + // ORB pointer. +}; + +// ********************************************************************* + +class Reply_Handler_Task : public ACE_Task_Base +{ + // = TITLE + // Run the thread handling the reply. + // + // = DESCRIPTION + // Use the ACE_Task_Base class to run the reply handling. + // +public: + Reply_Handler_Task (void); + // Constructor. + + void set (Test_ptr server, + int niterations, + CORBA::ORB_ptr orb, + AMI_Test_Handler_ptr reply_handler); + // Set the test attributes. + + void accumulate_into (ACE_Throughput_Stats &throughput) const; + // Accumulate the throughput statistics into <throughput> + + void dump_stats (const char* msg, ACE_UINT32 gsf); + // Accumulate the throughput statistics into <throughput> + + // = The ACE_Task_Base methods.... + virtual int svc (void); + +private: + Test_var server_; + // The server. + + int niterations_; + // The number of iterations on each client thread. + + CORBA::ORB_ptr orb_; + // Cache the ORB pointer. + + AMI_Test_Handler_ptr reply_handler_; + // ReplyHandler object. +}; + +// ********************************************************************* + +int +main (int argc, char *argv[]) +{ + int priority = + (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) + + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2; + // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. + + if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO, + priority, + ACE_SCOPE_PROCESS)) != 0) + { + if (ACE_OS::last_error () == EPERM) + { + ACE_DEBUG ((LM_DEBUG, + "server (%P|%t): user is not superuser, " + "test runs in time-shared class\n")); + } + else + ACE_ERROR ((LM_ERROR, + "server (%P|%t): sched_params failed\n")); + } + + ACE_TRY_NEW_ENV + { + ACE_DEBUG ((LM_DEBUG, "High res. timer calibration....")); + ACE_High_Res_Timer::calibrate (); + ACE_DEBUG ((LM_DEBUG, "done\n")); + + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "", ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (parse_args (argc, argv) != 0) + return 1; + + CORBA::Object_var object = + orb->string_to_object (ior, ACE_TRY_ENV); + ACE_TRY_CHECK; + + Test_var server = + Test::_narrow (object.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (CORBA::is_nil (server.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Object reference <%s> is nil\n", + ior), + 1); + } + + // ReplyHandler object. + Handler handler (orb); + AMI_Test_Handler_var reply_handler = handler._this (ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Activate POA to handle the call back. + + CORBA::Object_var poa_object = + orb->resolve_initial_references("RootPOA"); + if (CORBA::is_nil (poa_object.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (ACE_TRY_ENV); + ACE_TRY_CHECK; + + poa_manager->activate (ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Initiate the Handler task to receive replies. + + Reply_Handler_Task reply_handler_task; + + // Init the Reply Handler task. + reply_handler_task.set (server.in (), + niterations, + orb, + reply_handler.in ()); + + // Activate Reply Handler task. + if (reply_handler_task.activate (THR_BOUND | THR_SCHED_FIFO | THR_NEW_LWP | THR_JOINABLE, + 1, + 1, + priority + 1) != 0) + { + int priority = + (ACE_Sched_Params::priority_min (ACE_SCHED_OTHER) + + ACE_Sched_Params::priority_max (ACE_SCHED_OTHER)) / 2; + + // Retry in the regular class: + if (reply_handler_task.activate (THR_NEW_LWP | THR_JOINABLE, + 1, + 1, + priority + 1) != 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "Cannot activate client threads"), + 1); + } + } + + // Allocate memory for latency base array. + ACE_NEW_RETURN (latency_base_array, + ACE_hrtime_t [niterations], + 1); + + // Init global throughput base. + throughput_base = ACE_OS::gethrtime (); + + // Issue asynchronous invocations. + for (size_t i = 0; i < niterations; ++i) + { + // Get timestamp. + latency_base_array [i] = ACE_OS::gethrtime (); + + // Invoke asynchronous operation. + server->sendc_test_method (reply_handler.in (), + latency_base_array [i], + ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (TAO_debug_level > 0 && i % 100 == 0) + ACE_DEBUG ((LM_DEBUG, "(%P|%t) iteration = %d\n", i)); + } + + // Wait for the Reply Handler task. + ACE_Thread_Manager::instance ()->wait (); + + ACE_DEBUG ((LM_DEBUG, "threads finished\n")); + + // Output statistics. + + ACE_Throughput_Stats throughput; + char buf[64]; + ACE_UINT32 gsf = ACE_High_Res_Timer::global_scale_factor (); + + reply_handler_task.accumulate_into (throughput); + + ACE_OS::sprintf (buf, "Reply Handler Thread"); + reply_handler_task.dump_stats (buf, gsf); + + throughput.dump_results ("Aggregated", gsf); + + // server->shutdown (ACE_TRY_ENV); + // ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Catched exception:"); + return 1; + } + ACE_ENDTRY; + + return 0; +} + +// **************************************************************** + +Reply_Handler_Task::Reply_Handler_Task (void) + : niterations_ (0), + orb_ (0), + reply_handler_ (0) +{ +} + +void +Reply_Handler_Task::set (Test_ptr server, + int niterations, + CORBA::ORB_ptr orb, + AMI_Test_Handler_ptr reply_handler) +{ + this->server_ = Test::_duplicate (server); + this->niterations_ = niterations; + this->orb_ = orb; + this->reply_handler_ = reply_handler; +} + +int +Reply_Handler_Task::svc (void) +{ + if (sleep_flag) + { + ACE_DEBUG ((LM_DEBUG, "(%P|%t) - starting receiver thread [1]\n")); + // Spend 10 msecs running the ORB. + this->orb_->run (); + } + else + { + ACE_DEBUG ((LM_DEBUG, "(%P|%t) - starting receiver thread [2]\n")); + while (!done) + this->orb_->perform_work (); + } + ACE_DEBUG ((LM_DEBUG, "(%P|%t) - finished receiver thread\n")); + return 0; +} + +void +Reply_Handler_Task::accumulate_into (ACE_Throughput_Stats &t) const +{ + t.accumulate (throughput_stats); +} + +void +Reply_Handler_Task::dump_stats (const char* msg, ACE_UINT32 gsf) +{ + throughput_stats.dump_results (msg, gsf); +} diff --git a/TAO/performance-tests/Latency/client-mt-exclusive.conf b/TAO/performance-tests/Latency/client-mt-exclusive.conf new file mode 100644 index 00000000000..2a75162271c --- /dev/null +++ b/TAO/performance-tests/Latency/client-mt-exclusive.conf @@ -0,0 +1,2 @@ +# $Id$ +static Client_Strategy_Factory "-ORBclientconnectionhandler MT" diff --git a/TAO/performance-tests/Latency/client-st-exclusive.conf b/TAO/performance-tests/Latency/client-st-exclusive.conf new file mode 100644 index 00000000000..9a6166dfbb3 --- /dev/null +++ b/TAO/performance-tests/Latency/client-st-exclusive.conf @@ -0,0 +1,4 @@ +# $Id$ +static Resource_Factory "-ORBResources global -ORBReactorType select_st -ORBInputCDRAllocator null" +static Client_Strategy_Factory "-ORBProfileLock null -ORBClientConnectionHandler ST" + diff --git a/TAO/performance-tests/Latency/client-st-muxed.conf b/TAO/performance-tests/Latency/client-st-muxed.conf new file mode 100644 index 00000000000..57fe621c5f5 --- /dev/null +++ b/TAO/performance-tests/Latency/client-st-muxed.conf @@ -0,0 +1,5 @@ +# $Id$ +static Resource_Factory "-ORBResources global -ORBReactorType select_mt -ORBInputCDRAllocator null" +static Client_Strategy_Factory "-ORBClientConnectionHandler ST -ORBTransportMuxStrategy MUXED" + + diff --git a/TAO/performance-tests/Latency/client.cpp b/TAO/performance-tests/Latency/client.cpp index 9190bbdaca6..5072c05bb68 100644 --- a/TAO/performance-tests/Latency/client.cpp +++ b/TAO/performance-tests/Latency/client.cpp @@ -13,10 +13,14 @@ const char *ior = "file://test.ior"; int nthreads = 5; int niterations = 5; +int sleep_flag = 0; + +ACE_Time_Value sleep_time (0, 10000); + int parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "k:n:i:"); + ACE_Get_Opt get_opts (argc, argv, "k:n:i:s"); int c; while ((c = get_opts ()) != -1) @@ -31,6 +35,9 @@ parse_args (int argc, char *argv[]) case 'i': niterations = ACE_OS::atoi (get_opts.optarg); break; + case 's': + sleep_flag = 1; + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, @@ -204,15 +211,27 @@ Client::svc (void) for (int i = 0; i < this->niterations_; ++i) { + // Record current time. ACE_hrtime_t latency_base = ACE_OS::gethrtime (); - server_->test_method (ACE_TRY_ENV); - ACE_hrtime_t now = ACE_OS::gethrtime (); - ACE_TRY_CHECK; + // Invoke method. + server_->test_method (latency_base, + ACE_TRY_ENV); + // Grab timestamp again. + ACE_hrtime_t now = ACE_OS::gethrtime (); + + // Record statistics. this->throughput_.sample (now - throughput_base, now - latency_base); + ACE_TRY_CHECK; + + // Sleep for 10 msecs. + if (sleep_flag) + ACE_OS::sleep (sleep_time); + + if (TAO_debug_level > 0 && i % 100 == 0) ACE_DEBUG ((LM_DEBUG, "(%P|%t) iteration = %d\n", i)); } diff --git a/TAO/performance-tests/Latency/run_test.pl b/TAO/performance-tests/Latency/run_test.pl index b12d2ee472a..7be2430c464 100755 --- a/TAO/performance-tests/Latency/run_test.pl +++ b/TAO/performance-tests/Latency/run_test.pl @@ -39,7 +39,7 @@ if ($client == -1) { $CL->Kill (); $CL->TimedWait (1); } -$server = $SV->TimedWait (5); +$server = $SV->TimedWait (10); if ($server == -1) { print STDERR "ERROR: server timedout\n"; $SV->Kill (); $SV->TimedWait (1); diff --git a/TAO/performance-tests/Latency/server.cpp b/TAO/performance-tests/Latency/server.cpp index 721930c7a9e..03322101651 100644 --- a/TAO/performance-tests/Latency/server.cpp +++ b/TAO/performance-tests/Latency/server.cpp @@ -21,22 +21,22 @@ parse_args (int argc, char *argv[]) switch (c) { case 'o': - ior_output_file = get_opts.optarg; - break; + ior_output_file = get_opts.optarg; + break; case 'n': - nthreads = ACE_OS::atoi (get_opts.optarg); - break; + nthreads = ACE_OS::atoi (get_opts.optarg); + break; case 'w': - workload = ACE_OS::atoi (get_opts.optarg); - break; + workload = ACE_OS::atoi (get_opts.optarg); + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " - "-o <iorfile>" + "-o <iorfile>" "\n", argv [0]), -1); @@ -71,10 +71,14 @@ main (int argc, char *argv[]) int priority = (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO) + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO)) / 2; + priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, - priority); - // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. + priority); + + priority = ACE_Sched_Params::next_priority (ACE_SCHED_FIFO, + priority); + // Enable FIFO scheduling, e.g., RT scheduling class on Solaris. if (ACE_OS::sched_params (ACE_Sched_Params (ACE_SCHED_FIFO, priority, ACE_SCOPE_PROCESS)) != 0) @@ -121,27 +125,27 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; CORBA::String_var ior = - orb->object_to_string (server.in (), ACE_TRY_ENV); + orb->object_to_string (server.in (), ACE_TRY_ENV); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ())); // If the ior_output_file exists, output the ior to it if (ior_output_file != 0) - { - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } + { + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); + if (output_file == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file for writing IOR: %s", + ior_output_file), + 1); + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); + } poa_manager->activate (ACE_TRY_ENV); ACE_TRY_CHECK; - + Worker worker (orb.in ()); if (worker.activate (THR_NEW_LWP | THR_JOINABLE, nthreads) != 0) diff --git a/TAO/performance-tests/Latency/st_client.cpp b/TAO/performance-tests/Latency/st_client.cpp index 64aaa4593db..580394c6e5b 100644 --- a/TAO/performance-tests/Latency/st_client.cpp +++ b/TAO/performance-tests/Latency/st_client.cpp @@ -60,7 +60,7 @@ public: void dump_stats (const char* msg, ACE_UINT32 gsf); // Accumulate the throughput statistics into <throughput> - + int svc (void); // Run the test... @@ -179,8 +179,8 @@ Client::svc (void) for (int i = 0; i < this->niterations_; ++i) { - ACE_hrtime_t latency_base = ACE_OS::gethrtime (); - server_->test_method (ACE_TRY_ENV); + ACE_hrtime_t latency_base = + server_->test_method (ACE_OS::gethrtime (), ACE_TRY_ENV); ACE_hrtime_t now = ACE_OS::gethrtime (); ACE_TRY_CHECK; diff --git a/TAO/performance-tests/Latency/test.idl b/TAO/performance-tests/Latency/test.idl index fb5e94ff048..5fc10225039 100644 --- a/TAO/performance-tests/Latency/test.idl +++ b/TAO/performance-tests/Latency/test.idl @@ -4,7 +4,7 @@ interface Test { - void test_method (); + unsigned long long test_method (in unsigned long long stamp); oneway void shutdown (); }; diff --git a/TAO/performance-tests/Latency/test_i.cpp b/TAO/performance-tests/Latency/test_i.cpp index c95525d7e0a..617ae15ff5c 100644 --- a/TAO/performance-tests/Latency/test_i.cpp +++ b/TAO/performance-tests/Latency/test_i.cpp @@ -9,8 +9,9 @@ ACE_RCSID(Latency, test_i, "$Id$") -void -Test_i::test_method (CORBA::Environment&) ACE_THROW_SPEC (()) +CORBA::ULongLong +Test_i::test_method (CORBA::ULongLong stamp, + CORBA::Environment&) ACE_THROW_SPEC (()) { ACE_Time_Value tv (0, 0); for (int i = 0; i != this->workload_; ++i) @@ -19,6 +20,7 @@ Test_i::test_method (CORBA::Environment&) ACE_THROW_SPEC (()) ACE::is_prime (n, 2, n / 2); ACE_OS::sleep (tv); } + return stamp; } void diff --git a/TAO/performance-tests/Latency/test_i.h b/TAO/performance-tests/Latency/test_i.h index a98ff85285b..953bf67d30d 100644 --- a/TAO/performance-tests/Latency/test_i.h +++ b/TAO/performance-tests/Latency/test_i.h @@ -31,7 +31,8 @@ public: // ctor // = The Test methods. - void test_method (CORBA::Environment&) + CORBA::ULongLong test_method (CORBA::ULongLong stamp, + CORBA::Environment&) ACE_THROW_SPEC (()); void shutdown (CORBA::Environment&) diff --git a/TAO/tao/Client_Strategy_Factory.cpp b/TAO/tao/Client_Strategy_Factory.cpp index 8d6411f972d..80dcfec9c20 100644 --- a/TAO/tao/Client_Strategy_Factory.cpp +++ b/TAO/tao/Client_Strategy_Factory.cpp @@ -19,7 +19,7 @@ TAO_Client_Strategy_Factory::create_profile_lock (void) } TAO_Transport_Mux_Strategy * -TAO_Client_Strategy_Factory::create_transport_mux_strategy (TAO_ORB_Core *) +TAO_Client_Strategy_Factory::create_transport_mux_strategy (TAO_Transport *) { return 0; } diff --git a/TAO/tao/Client_Strategy_Factory.h b/TAO/tao/Client_Strategy_Factory.h index d4b0cbfdda5..4d6e9926cbe 100644 --- a/TAO/tao/Client_Strategy_Factory.h +++ b/TAO/tao/Client_Strategy_Factory.h @@ -49,7 +49,7 @@ public: // <TAO_GIOP_Invocation::location_forward> and the // <TAO_GIOP_Invocation::start>. - virtual TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_ORB_Core *orb_core); + virtual TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_Transport *transport); // Create the correct client request muxing strategy. virtual TAO_Wait_Strategy *create_wait_strategy (TAO_Transport *transport); diff --git a/TAO/tao/GIOP.cpp b/TAO/tao/GIOP.cpp index 8d349cbae5f..19ef3bde8e7 100644 --- a/TAO/tao/GIOP.cpp +++ b/TAO/tao/GIOP.cpp @@ -227,42 +227,36 @@ TAO_GIOP::dump_msg (const char *label, { if (TAO_debug_level >= 5) { + // Message name. const char *message_name = "UNKNOWN MESSAGE"; u_long slot = ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET]; if (slot < sizeof (names)/sizeof(names[0])) message_name = names [slot]; + + // Byte order. int byte_order = ptr[TAO_GIOP_MESSAGE_FLAGS_OFFSET] & 0x01; + + // request/reply id. + CORBA::ULong tmp = 0; + CORBA::ULong *id = &tmp; + if (ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET] == TAO_GIOP::Request || + ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET] == TAO_GIOP::Reply) + { + // @@ Only works if ServiceContextList is empty.... + id = ACE_reinterpret_cast (CORBA::ULong *, + (char * ) (ptr + TAO_GIOP_HEADER_LEN + 4)); + } + + // Print. ACE_DEBUG ((LM_DEBUG, - "(%P | %t):%s GIOP v%c.%c msg, %d data bytes, %s endian, %s", + "(%P | %t):%s GIOP v%c.%c msg, %d data bytes, %s endian, %s = %d\n", label, digits[ptr[TAO_GIOP_VERSION_MAJOR_OFFSET]], digits[ptr[TAO_GIOP_VERSION_MINOR_OFFSET]], len - TAO_GIOP_HEADER_LEN, (byte_order == TAO_ENCAP_BYTE_ORDER) ? "my" : "other", - message_name)); - - if (ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET] == TAO_GIOP::Request) - { - // @@ Only works if ServiceContextList is empty.... - const CORBA::ULong *request_id = - ACE_reinterpret_cast (const CORBA::ULong *, - ptr + TAO_GIOP_HEADER_LEN + 4); - ACE_DEBUG ((LM_DEBUG, - " = %d\n", - *request_id)); - } - else if (ptr[TAO_GIOP_MESSAGE_TYPE_OFFSET] == TAO_GIOP::Reply) - { - const CORBA::ULong *request_id = - ACE_reinterpret_cast (const CORBA::ULong *, - ptr + TAO_GIOP_HEADER_LEN + 4); - ACE_DEBUG ((LM_DEBUG, - " = %d\n", - *request_id)); - } - else - ACE_DEBUG ((LM_DEBUG, - "\n")); + message_name, + *id)); if (TAO_debug_level >= 10) ACE_HEX_DUMP ((LM_DEBUG, diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index 4c50530ee67..0132f882a51 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -84,8 +84,6 @@ TAO_GIOP_Invocation::TAO_GIOP_Invocation (TAO_Stub *stub, TAO_GIOP_Invocation::~TAO_GIOP_Invocation (void) { - if (this->transport_ != 0) - this->transport_->idle_after_reply (); } // The public API involves creating an invocation, starting it, filling @@ -393,6 +391,12 @@ TAO_GIOP_Invocation::location_forward (TAO_InputCDR &inp_stream, // **************************************************************** +TAO_GIOP_Twoway_Invocation::~TAO_GIOP_Twoway_Invocation (void) +{ + if (this->transport_ != 0) + this->transport_->idle (); +} + void TAO_GIOP_Twoway_Invocation::start (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -638,7 +642,8 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV) } int reply_error = - this->transport_->wait_for_reply (this->max_wait_time_); + this->transport_->wait_for_reply (this->max_wait_time_, + this->rd_.reply_received ()); // Do the wait loop till we receive the reply for this invocation. // while (reply_error != -1 && @@ -767,6 +772,12 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV) // **************************************************************** +TAO_GIOP_Oneway_Invocation::~TAO_GIOP_Oneway_Invocation (void) +{ + if (this->transport_ != 0) + this->transport_->idle (); +} + void TAO_GIOP_Oneway_Invocation::start (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) @@ -785,6 +796,12 @@ TAO_GIOP_Oneway_Invocation::start (CORBA::Environment &ACE_TRY_ENV) // **************************************************************** +TAO_GIOP_Locate_Request_Invocation::~TAO_GIOP_Locate_Request_Invocation (void) +{ + if (this->transport_ != 0) + this->transport_->idle (); +} + // Send request, block until any reply comes back. void TAO_GIOP_Locate_Request_Invocation::start (CORBA::Environment &ACE_TRY_ENV) @@ -860,7 +877,8 @@ TAO_GIOP_Locate_Request_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV) // Wait for the reply. int reply_error = - this->transport_->wait_for_reply (this->max_wait_time_); + this->transport_->wait_for_reply (this->max_wait_time_, + this->rd_.reply_received ()); // // Do the wait loop, till we receive the reply for this invocation. // while (reply_error != -1 && diff --git a/TAO/tao/Invocation.h b/TAO/tao/Invocation.h index 5ea132a7bd4..582db967456 100644 --- a/TAO/tao/Invocation.h +++ b/TAO/tao/Invocation.h @@ -76,8 +76,11 @@ public: TAO_ORB_Core* orb_core); // Constructor. - ~TAO_GIOP_Invocation (void); - // Destructor. + virtual ~TAO_GIOP_Invocation (void); + // This destructor is virtual so that the derived synchronous + // invocation classes can call <idle> method on the <Transport>, if + // they want to. All the synchronous invocations <idle> the + // Transport, but asynchronous invocations do not do that. void put_param (CORBA::TypeCode_ptr tc, void *value, @@ -177,6 +180,9 @@ public: TAO_ORB_Core* orb_core); // Constructor. + ~TAO_GIOP_Twoway_Invocation (void); + // Destructor. + void start (CORBA_Environment &TAO_IN_ENV = TAO_default_environment ()) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -235,6 +241,9 @@ public: TAO_ORB_Core* orb_core); // Constructor. + ~TAO_GIOP_Oneway_Invocation (void); + // Destructor. + void start (CORBA_Environment &TAO_IN_ENV = TAO_default_environment ()) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -258,6 +267,9 @@ public: TAO_ORB_Core* orb_core); // Constructor. + ~TAO_GIOP_Locate_Request_Invocation (void); + // Destructor. + void start (CORBA_Environment &TAO_IN_ENV = TAO_default_environment ()) ACE_THROW_SPEC ((CORBA::SystemException)); diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index e37bf367d98..a471f2e86e6 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -1344,6 +1344,26 @@ TAO_ORB_Core::object_adapter_i (void) return this->object_adapter_; } +ACE_SYNCH_CONDITION* +TAO_ORB_Core::leader_follower_condition_variable (void) +{ + // Always using TSS. + + // Get tss key. + TAO_ORB_Core_TSS_Resources *tss = this->get_tss_resources (); + + if (tss->leader_follower_condition_variable_ == 0) + { + // Create a new one and return. + ACE_NEW_RETURN (tss->leader_follower_condition_variable_, + ACE_SYNCH_CONDITION (this->leader_follower ().lock ()), + 0); + tss->owns_resources_ = 1; + } + + return tss->leader_follower_condition_variable_; +} + int TAO_ORB_Core::is_collocated (const TAO_MProfile& mprofile) { @@ -1813,7 +1833,8 @@ TAO_ORB_Core_TSS_Resources::TAO_ORB_Core_TSS_Resources (void) input_cdr_buffer_allocator_ (0), connection_cache_ (0), is_server_thread_ (0), - is_leader_thread_ (0) + is_leader_thread_ (0), + leader_follower_condition_variable_ (0) { } @@ -1848,6 +1869,9 @@ TAO_ORB_Core_TSS_Resources::~TAO_ORB_Core_TSS_Resources (void) // unimplemented delete this->connection_cache_; this->connection_cache_ = 0; + + delete this->leader_follower_condition_variable_; + this->leader_follower_condition_variable_ = 0; } // **************************************************************** diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index 06898c72fcc..105b0b8952a 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -101,6 +101,9 @@ public: int is_leader_thread_; // Is this thread a leader for this ORB? + + ACE_SYNCH_CONDITION* leader_follower_condition_variable_; + // Condition variable for the leader follower model. }; // **************************************************************** @@ -417,7 +420,7 @@ public: // Obtain the TSS resources of this orb. TAO_Leader_Follower &leader_follower (void); - // Get access to the leader_follower class + // Get access to the leader_follower class. int run (ACE_Time_Value *tv, int break_on_timeouts); // Run the event loop @@ -434,6 +437,10 @@ public: // the shutdown flag. // If the return value is zero then the server threads block forever. + ACE_SYNCH_CONDITION* leader_follower_condition_variable (void); + // Condition variable used in the Leader Follower Wait Strategy, on + // which the follower thread blocks. + protected: int set_iiop_endpoint (int dotted_decimal_addresses, CORBA::UShort port, diff --git a/TAO/tao/Pluggable.cpp b/TAO/tao/Pluggable.cpp index 8e9b2869ba9..e3187b52bc1 100644 --- a/TAO/tao/Pluggable.cpp +++ b/TAO/tao/Pluggable.cpp @@ -161,7 +161,7 @@ TAO_Transport::TAO_Transport (CORBA::ULong tag, this->ws_ = orb_core->client_factory ()->create_wait_strategy (this); // Create TMS now. - this->tms_ = orb_core->client_factory ()->create_transport_mux_strategy (orb_core); + this->tms_ = orb_core->client_factory ()->create_transport_mux_strategy (this); } TAO_Transport::~TAO_Transport (void) @@ -215,9 +215,11 @@ TAO_Transport::bind_reply_dispatcher (CORBA::ULong request_id, } int -TAO_Transport::wait_for_reply (ACE_Time_Value *max_wait_time) +TAO_Transport::wait_for_reply (ACE_Time_Value *max_wait_time, + int &reply_received) { - return this->ws_->wait (max_wait_time); + return this->ws_->wait (max_wait_time, + reply_received); } // Read and handle the reply. Returns 0 when there is Short Read on @@ -241,19 +243,25 @@ TAO_Transport::register_handler (void) int TAO_Transport::idle_after_send (void) { - return this->tms ()->idle_after_send (this); + return this->tms ()->idle_after_send (); } -int -TAO_Transport::idle_after_reply (void) -{ - return this->tms ()->idle_after_reply (this); -} +// int +// TAO_Transport::idle_after_reply (void) +// { +// return this->tms ()->idle_after_reply (); +// } -int -TAO_Transport::reply_received (const CORBA::ULong request_id) +// int +// TAO_Transport::reply_received (const CORBA::ULong request_id) +// { +// return this->tms ()->reply_received (request_id); +// } + +ACE_SYNCH_CONDITION * +TAO_Transport::leader_follower_condition_variable (void) { - return this->tms ()->reply_received (request_id); + return this->wait_strategy ()->leader_follower_condition_variable (); } void diff --git a/TAO/tao/Pluggable.h b/TAO/tao/Pluggable.h index ff9798da3fc..a73540ca70e 100644 --- a/TAO/tao/Pluggable.h +++ b/TAO/tao/Pluggable.h @@ -172,7 +172,8 @@ public: TAO_Reply_Dispatcher *rd); // Bind the reply dispatcher with the TMS object. - virtual int wait_for_reply (ACE_Time_Value *max_wait_time); + virtual int wait_for_reply (ACE_Time_Value *max_wait_time, + int &reply_received); // Wait for the reply depending on the strategy. virtual int handle_client_input (int block = 0, @@ -195,14 +196,19 @@ public: // Request has been just sent, but the reply is not received. Idle // the transport now. - virtual int idle_after_reply (void); + // virtual int idle_after_reply (void); // Request is sent and the reply is received. Idle the transport // now. - virtual int reply_received (const CORBA::ULong request_id); + // virtual int reply_received (const CORBA::ULong request_id); // Check with the TMS whether the reply has been receieved for the // request with <request_id>. + virtual ACE_SYNCH_CONDITION *leader_follower_condition_variable (void); + // Return the TSS leader follower condition variable used in the + // Wait Strategy. Muxed Leader Follower implementation returns a + // valid condition variable, others return 0. + protected: CORBA::ULong tag_; // IOP protocol tag. diff --git a/TAO/tao/PollableC.cpp b/TAO/tao/PollableC.cpp index 0a27a5f3bd2..3dc24e91601 100644 --- a/TAO/tao/PollableC.cpp +++ b/TAO/tao/PollableC.cpp @@ -34,7 +34,7 @@ ACE_RCSID(tao, PollableC, "$Id$") CORBA_Pollable_ptr CORBA_Pollable::_narrow ( CORBA::Object_ptr obj, - CORBA::Environment &env + CORBA::Environment &ACE_TRY_ENV ) { if (CORBA::is_nil (obj)) @@ -196,7 +196,7 @@ const char* CORBA_Pollable::_interface_repository_id (void) const CORBA::DIIPollable_ptr CORBA::DIIPollable::_narrow ( CORBA::Object_ptr obj, - CORBA::Environment &env + CORBA::Environment &ACE_TRY_ENV ) { if (CORBA::is_nil (obj)) @@ -256,7 +256,7 @@ const char* CORBA::DIIPollable::_interface_repository_id (void) const CORBA_PollableSet_ptr CORBA_PollableSet::_narrow ( CORBA::Object_ptr obj, - CORBA::Environment &env + CORBA::Environment &ACE_TRY_ENV ) { if (CORBA::is_nil (obj)) diff --git a/TAO/tao/Reply_Dispatcher.cpp b/TAO/tao/Reply_Dispatcher.cpp index 54de0dc3963..3e17c854ace 100644 --- a/TAO/tao/Reply_Dispatcher.cpp +++ b/TAO/tao/Reply_Dispatcher.cpp @@ -25,11 +25,12 @@ TAO_Reply_Dispatcher::message_state (void) const return 0; } -// int -// TAO_Reply_Dispatcher::reply_received (void) const -// { -// return reply_received_; -// } +int +TAO_Reply_Dispatcher::leader_follower_condition_variable (TAO_Transport *) +{ + // no-op. + return 0; +} // ********************************************************************* @@ -38,7 +39,10 @@ TAO_Synch_Reply_Dispatcher::TAO_Synch_Reply_Dispatcher (TAO_ORB_Core *orb_core) : message_state_ (0), reply_cdr_ (orb_core->create_input_cdr_data_block (ACE_CDR::DEFAULT_BUFSIZE), TAO_ENCAP_BYTE_ORDER, - orb_core) + orb_core), + reply_received_ (0), + leader_follower_condition_variable_ (0), + orb_core_ (orb_core) { } @@ -54,7 +58,7 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status, TAO_GIOP_ServiceContextList &reply_ctx, TAO_GIOP_Message_State *message_state) { - // this->reply_received_ = 1; + this->reply_received_ = 1; this->reply_status_ = reply_status; this->version_ = version; @@ -69,6 +73,26 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status, // Steal the buffer so that no copying is done. this->reply_cdr_.steal_from (message_state->cdr); + + // If condition variable is present, then we are doing leader + // follower model. Do all the nessary things. + if (this->leader_follower_condition_variable_ != 0) + { + TAO_Leader_Follower& leader_follower = + this->orb_core_->leader_follower (); + + // We *must* remove it when we signal it so the same condition + // is not signalled for both wake up as a follower and as the + // next leader. + // The follower may not be there if the reply is received while + // the consumer is not yet waiting for it (i.e. it send the + // request but has not blocked to receive the reply yet). + // Ignore errors. + (void) leader_follower.remove_follower (this->leader_follower_condition_variable_); + + (void) this->leader_follower_condition_variable_->signal (); + } + return 1; } @@ -84,6 +108,19 @@ TAO_Synch_Reply_Dispatcher::reply_cdr (void) return this->reply_cdr_; } +int & +TAO_Synch_Reply_Dispatcher::reply_received (void) +{ + return reply_received_; +} + +int +TAO_Synch_Reply_Dispatcher::leader_follower_condition_variable (TAO_Transport *transport) +{ + this->leader_follower_condition_variable_ = + transport->leader_follower_condition_variable (); + return 0; +} // ********************************************************************* #if defined (TAO_HAS_CORBA_MESSAGING) && defined (TAO_POLLER) @@ -126,12 +163,21 @@ TAO_Asynch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status, "(%P | %t):TAO_Asynch_Reply_Dispatcher::dispatch_reply:\n")); } - ACE_DECLARE_NEW_CORBA_ENV; - - // Call the Reply Handler's skeleton. - reply_handler_skel_ (message_state_->cdr, - reply_handler_, - ACE_TRY_ENV); + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment (); + ACE_TRY + { + // Call the Reply Handler's skeleton. + reply_handler_skel_ (message_state_->cdr, + reply_handler_, + ACE_TRY_ENV); + } + ACE_CATCHANY + { + if (TAO_debug_level >= 4) + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Exception during reply handler"); + } + ACE_ENDTRY; // This was dynamically allocated. Now the job is done. Commit // suicide here. diff --git a/TAO/tao/Reply_Dispatcher.h b/TAO/tao/Reply_Dispatcher.h index 5066ef0845f..9c7670369a1 100644 --- a/TAO/tao/Reply_Dispatcher.h +++ b/TAO/tao/Reply_Dispatcher.h @@ -56,12 +56,10 @@ public: virtual TAO_GIOP_Message_State *message_state (void) const; // Get the Message State into which the reply has been read. - // virtual int reply_received (void) const; - // Return the reply received flag. - - // protected: - // int reply_received_; - // Reply received flag. + virtual int leader_follower_condition_variable (TAO_Transport *); + // Obtain the condition variable used in the Leader Follower Wait + // Strategy. This is valid only for the synchronous reply dispatcher + // and only when the Leader Follower wait strategy is used. }; // ********************************************************************* @@ -106,6 +104,16 @@ public: virtual TAO_InputCDR &reply_cdr (void); // Return the reply CDR. + virtual int &reply_received (void); + // Return the reference to the reply received flag. This will not + // make sense in the Asynch Reply Dispatcher case, since the + // reply will be dispatched as soon as it is available and the + // dispatcher will go away immediately after that. + + virtual int leader_follower_condition_variable (TAO_Transport *); + // Obtain the condition variable used in the Leader Follower Wait + // Strategy. + private: CORBA::ULong reply_status_; // Reply or LocateReply status. @@ -118,11 +126,21 @@ private: TAO_GIOP_Message_State *message_state_; // CDR stream for reading the input. - // @@ Carlos : message_state should go away. All we need is the reply - // cdr. Is that rite? (Alex). + // @@ Carlos : message_state should go away. All we need is the + // reply cdr. Is that rite? (Alex). TAO_InputCDR reply_cdr_; // CDR where the reply message is placed. + + int reply_received_; + // Flag that indicates the reply has been received. + + ACE_SYNCH_CONDITION *leader_follower_condition_variable_; + // Condition variable used by the leader to notify the follower + // about the availability of the response. + + TAO_ORB_Core *orb_core_; + // Cache the ORB Core pointer. }; // ********************************************************************* diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index a2091dd6cd4..a02d5c68c76 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -124,6 +124,7 @@ TAO_Stub::add_forward_profiles (const TAO_MProfile &mprofiles) // make sure we start at the beginning of mprofiles this->forward_profiles_->rewind (); } + // Quick'n'dirty hash of objref data, for partitioning objrefs into // sets. // @@ -674,7 +675,7 @@ TAO_Stub::do_dynamic_call (const char *opname, begin = call.inp_stream ().rd_ptr (); // skip the parameter to get the ending position - retval = temp.skip (any->type_, + retval = temp.skip (any->type_, ACE_TRY_ENV); ACE_CHECK; @@ -685,7 +686,7 @@ TAO_Stub::do_dynamic_call (const char *opname, TAO_OutputCDR out (any->cdr_); retval = out.append (any->type_, - &call.inp_stream (), + &call.inp_stream (), ACE_TRY_ENV); ACE_CHECK; @@ -725,7 +726,7 @@ TAO_Stub::do_dynamic_call (const char *opname, } call.get_value (any->type_, - (void *) any->value_, + (void *) any->value_, ACE_TRY_ENV); ACE_CHECK; } @@ -958,7 +959,6 @@ TAO_Stub::validate_connection ( return 0; } - #endif /* TAO_HAS_CORBA_MESSAGING */ #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/tao/Transport_Mux_Strategy.cpp b/TAO/tao/Transport_Mux_Strategy.cpp index e18ed8ecadc..96ee15fd913 100644 --- a/TAO/tao/Transport_Mux_Strategy.cpp +++ b/TAO/tao/Transport_Mux_Strategy.cpp @@ -5,7 +5,8 @@ #include "tao/debug.h" #include "tao/Pluggable.h" -TAO_Transport_Mux_Strategy::TAO_Transport_Mux_Strategy (void) +TAO_Transport_Mux_Strategy::TAO_Transport_Mux_Strategy (TAO_Transport *transport) + : transport_ (transport) { } @@ -13,13 +14,24 @@ TAO_Transport_Mux_Strategy::~TAO_Transport_Mux_Strategy (void) { } + +int +TAO_Transport_Mux_Strategy::bind_dispatcher (CORBA::ULong, + TAO_Reply_Dispatcher *rd) +{ + // Help the Reply dispatcher to obtain leader follower condition + // variable. + return rd->leader_follower_condition_variable (this->transport_); +} + // ********************************************************************* -TAO_Exclusive_TMS::TAO_Exclusive_TMS (TAO_ORB_Core *orb_core) - : request_id_generator_ (0), +TAO_Exclusive_TMS::TAO_Exclusive_TMS (TAO_Transport *transport) + : TAO_Transport_Mux_Strategy (transport), + request_id_generator_ (0), request_id_ (0), rd_ (0), - message_state_ (orb_core) + message_state_ (transport->orb_core ()) { } @@ -48,7 +60,7 @@ TAO_Exclusive_TMS::bind_dispatcher (CORBA::ULong request_id, // should be the correct place to <reset> the message state. Do I // make sense? (Alex). // @@ Alex: the state must be reset, but the contents are always - // clean because: + // clean because: // 1) it starts clean // 2) it is reset after each reply arrives... @@ -56,7 +68,8 @@ TAO_Exclusive_TMS::bind_dispatcher (CORBA::ULong request_id, if (this->message_state_.message_size != 0) this->message_state_.reset (0); - return 0; + return TAO_Transport_Mux_Strategy::bind_dispatcher (request_id, + rd); } int @@ -84,10 +97,33 @@ TAO_Exclusive_TMS::dispatch_reply (CORBA::ULong request_id, this->request_id_ = 0xdeadbeef; // @@ What is a good value??? this->rd_ = 0; - return rd->dispatch_reply (reply_status, - version, - reply_ctx, - message_state); + // Dispatch the reply. + int result = rd->dispatch_reply (reply_status, + version, + reply_ctx, + message_state); + + // Idle the transport now. + // if (this->transport_ != 0) + // this->transport_->idle (); + // @@ Carlos : We can do this, in the Muxed Leader Follower + // implementation. In the older implementation, since the state + // variables are in the Transport, and since we are in the + // handle_input right now, we cannot idle the Transport. This + // means that I cannot use asynchronous requests with Exclusive + // Transport&Old Leader Follower implementation , because I dont + // know when to idle the Transport. + // So I am moving this <idle> call to the destructors of + // synchronous invocations and for asynchronous invocations + // idle'ing is not at all called after the reply is + // received. + // We can enable <idle> out here, once we get rid of the old + // Leader Follower implementation. Then we can get rid of the + // destructors in the Invocation classes and they dont have to + // call <idle>. + // Do I make sense? (Alex). + + return result; } TAO_GIOP_Message_State * @@ -106,53 +142,54 @@ TAO_Exclusive_TMS::destroy_message_state (TAO_GIOP_Message_State *) } int -TAO_Exclusive_TMS::idle_after_send (TAO_Transport *) +TAO_Exclusive_TMS::idle_after_send (void) { // No op. return 0; } -int -TAO_Exclusive_TMS::idle_after_reply (TAO_Transport *transport) -{ - if (transport != 0) - return transport->idle (); - - return 0; -} - -int -TAO_Exclusive_TMS::reply_received (const CORBA::ULong request_id) -{ - if (this->rd_ == 0) - { - // Reply should have been dispatched already. - return 1; - } - else if (this->request_id_ == request_id) - { - // Reply dispatcher is still here. - return 0; - } - else - { - // Error. Request id is not matching. - - if (TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, - "(%P | %t):TAO_Exclusive_TMS::reply_received:" - "Invalid request_id \n")); - } - return -1; - } -} +// int +// TAO_Exclusive_TMS::idle_after_reply (void) +// { +// if (this->transport_ != 0) +// return this->transport_->idle (); +// +// return 0; +// } + +// int +// TAO_Exclusive_TMS::reply_received (const CORBA::ULong request_id) +// { +// if (this->rd_ == 0) +// { +// // Reply should have been dispatched already. +// return 1; +// } +// else if (this->request_id_ == request_id) +// { +// // Reply dispatcher is still here. +// return 0; +// } +// else +// { +// // Error. Request id is not matching. +// +// if (TAO_debug_level > 0) +// { +// ACE_DEBUG ((LM_DEBUG, +// "(%P | %t):TAO_Exclusive_TMS::reply_received:" +// "Invalid request_id \n")); +// } +// return -1; +// } +// } // ********************************************************************* -TAO_Muxed_TMS::TAO_Muxed_TMS (TAO_ORB_Core *orb_core) - : request_id_generator_ (0), - orb_core_ (orb_core), +TAO_Muxed_TMS::TAO_Muxed_TMS (TAO_Transport *transport) + : TAO_Transport_Mux_Strategy (transport), + request_id_generator_ (0), + orb_core_ (transport->orb_core ()), message_state_ (0) { } @@ -189,6 +226,10 @@ TAO_Muxed_TMS::bind_dispatcher (CORBA::ULong request_id, return -1; } + + return TAO_Transport_Mux_Strategy::bind_dispatcher (request_id, + rd); + return 0; } @@ -221,7 +262,7 @@ TAO_Muxed_TMS::dispatch_reply (CORBA::ULong request_id, return -1; } - // @@ Carlos : We could save the <messagee_state> somehow and then + // @@ Carlos : We could save the <message_state> somehow and then // signal some other thread to go ahead read the incoming message // if any. Is this what you were telling me before? (Alex). @@ -230,6 +271,9 @@ TAO_Muxed_TMS::dispatch_reply (CORBA::ULong request_id, version, reply_ctx, message_state); + + // No need for idling Transport, it would have got idle'd soon after + // sending the request. } TAO_GIOP_Message_State * @@ -239,7 +283,8 @@ TAO_Muxed_TMS::get_message_state (void) { // Create the next message state. ACE_NEW_RETURN (this->message_state_, - TAO_GIOP_Message_State (this->orb_core_), + TAO_GIOP_Message_State + (this->transport_->orb_core ()), 0); } @@ -254,34 +299,34 @@ TAO_Muxed_TMS::destroy_message_state (TAO_GIOP_Message_State *) } int -TAO_Muxed_TMS::idle_after_send (TAO_Transport *transport) +TAO_Muxed_TMS::idle_after_send (void) { - if (transport != 0) - return transport->idle (); + if (this->transport_ != 0) + return this->transport_->idle (); return 0; } -int -TAO_Muxed_TMS::idle_after_reply (TAO_Transport *) -{ - return 0; -} - -int -TAO_Muxed_TMS::reply_received (const CORBA::ULong request_id) -{ - if (this->dispatcher_table_.find (request_id) == -1) - { - // Reply should have been dispatched already. - return 1; - } - else - { - // Reply dispatcher is still here. - return 0; - } -} +// int +// TAO_Muxed_TMS::idle_after_reply (void) +// { +// return 0; +// } + +// int +// TAO_Muxed_TMS::reply_received (const CORBA::ULong request_id) +// { +// if (this->dispatcher_table_.find (request_id) == -1) +// { +// // Reply should have been dispatched already. +// return 1; +// } +// else +// { +// // Reply dispatcher is still here. +// return 0; +// } +// } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Hash_Map_Manager_Ex <CORBA::ULong, diff --git a/TAO/tao/Transport_Mux_Strategy.h b/TAO/tao/Transport_Mux_Strategy.h index 6c13a03e73d..ee06d1b9349 100644 --- a/TAO/tao/Transport_Mux_Strategy.h +++ b/TAO/tao/Transport_Mux_Strategy.h @@ -43,7 +43,7 @@ class TAO_Export TAO_Transport_Mux_Strategy // public: - TAO_Transport_Mux_Strategy (void); + TAO_Transport_Mux_Strategy (TAO_Transport *transport); // Base class constructor. virtual ~TAO_Transport_Mux_Strategy (void); @@ -57,8 +57,9 @@ public: // pairs. virtual int bind_dispatcher (CORBA::ULong request_id, - TAO_Reply_Dispatcher *rd) = 0; - // Bind the dispatcher with the request id. + TAO_Reply_Dispatcher *rd); + // Bind the dispatcher with the request id. Commonalities in the + // derived class implementations is kept here. virtual int dispatch_reply (CORBA::ULong request_id, CORBA::ULong reply_status, @@ -77,19 +78,23 @@ public: virtual void destroy_message_state (TAO_GIOP_Message_State *) = 0; // Destroy a CDR stream. - - virtual int idle_after_send (TAO_Transport *) = 0; + + virtual int idle_after_send (void) = 0; // Request has been just sent, but the reply is not received. Idle // the transport now. - virtual int idle_after_reply (TAO_Transport *) = 0; + // virtual int idle_after_reply (void) = 0; // Request is sent and the reply is received. Idle the transport // now. - virtual int reply_received (const CORBA::ULong request_id) = 0; + // virtual int reply_received (const CORBA::ULong request_id) = 0; // Check whether the reply has been receieved for the request with // <request_id>. Return 0 if no, 1 on yes and -1 if the request_id // is invalid or there are some errors. + +protected: + TAO_Transport *transport_; + // Cache the transport reference. }; // ********************************************************************* @@ -104,7 +109,7 @@ class TAO_Export TAO_Exclusive_TMS : public TAO_Transport_Mux_Strategy // public: - TAO_Exclusive_TMS (TAO_ORB_Core *orb_core); + TAO_Exclusive_TMS (TAO_Transport *transport); // Constructor. virtual ~TAO_Exclusive_TMS (void); @@ -132,15 +137,15 @@ public: virtual void destroy_message_state (TAO_GIOP_Message_State *); // No op in this strategy. - virtual int idle_after_send (TAO_Transport *transport); + virtual int idle_after_send (void); // Request has been just sent, but the reply is not received. Idle // the transport now. - virtual int idle_after_reply (TAO_Transport *transport); + // virtual int idle_after_reply (void); // Request is sent and the reply is received. Idle the transport // now. - - virtual int reply_received (const CORBA::ULong request_id); + + // virtual int reply_received (const CORBA::ULong request_id); // Check whether the reply has been receieved for the request with // <request_id>. Return 0 if no, 1 on yes and -1 if the request_id // is invalid or there are errors. @@ -172,7 +177,7 @@ class TAO_Export TAO_Muxed_TMS : public TAO_Transport_Mux_Strategy // public: - TAO_Muxed_TMS (TAO_ORB_Core *orb_core); + TAO_Muxed_TMS (TAO_Transport *transport); // Constructor. virtual ~TAO_Muxed_TMS (void); @@ -200,15 +205,15 @@ public: virtual void destroy_message_state (TAO_GIOP_Message_State *); // No op in this strategy. - virtual int idle_after_send (TAO_Transport *transport); + virtual int idle_after_send (void); // Request has been just sent, but the reply is not received. Idle // the transport now. - virtual int idle_after_reply (TAO_Transport *transport); + // virtual int idle_after_reply (void); // Request is sent and the reply is received. Idle the transport // now. - virtual int reply_received (const CORBA::ULong request_id); + // virtual int reply_received (const CORBA::ULong request_id); // Check whether the reply has been receieved for the request with // <request_id>. Return 0 if no, 1 on yes and -1 if the request_id // is invalid or there are errors. diff --git a/TAO/tao/Wait_Strategy.cpp b/TAO/tao/Wait_Strategy.cpp index 8fb141e5e94..215f60e951e 100644 --- a/TAO/tao/Wait_Strategy.cpp +++ b/TAO/tao/Wait_Strategy.cpp @@ -20,7 +20,13 @@ TAO_Wait_Strategy::~TAO_Wait_Strategy (void) int TAO_Wait_Strategy::sending_request (TAO_ORB_Core * /* orb_core */, - int /* two_way */) + int /* two_way */) +{ + return 0; +} + +ACE_SYNCH_CONDITION * +TAO_Wait_Strategy::leader_follower_condition_variable (void) { return 0; } @@ -29,8 +35,8 @@ TAO_Wait_Strategy::sending_request (TAO_ORB_Core * /* orb_core */, // Constructor. TAO_Wait_On_Reactor::TAO_Wait_On_Reactor (TAO_Transport *transport) - : TAO_Wait_Strategy (transport), - reply_received_ (0) + : TAO_Wait_Strategy (transport) + // reply_received_ (0) { } @@ -40,7 +46,8 @@ TAO_Wait_On_Reactor::~TAO_Wait_On_Reactor (void) } int -TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time) +TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time, + int &reply_received) { // Reactor does not change inside the loop. ACE_Reactor* reactor = @@ -49,8 +56,7 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time) // Do the event loop, till we fully receive a reply. int result = 1; // Optimize the first iteration [no access to errno] - this->reply_received_ = 0; - while (this->reply_received_ == 0 + while (reply_received == 0 && (result > 0 || (result == 0 && max_wait_time != 0 @@ -59,14 +65,14 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time) result = reactor->handle_events (max_wait_time); } - if (result == -1 || this->reply_received_ == -1) + if (result == -1 || reply_received == -1) return -1; - // Return an error if there was a problem receiving the reply... + // Return an error if there was a problem receiving the reply. if (max_wait_time != 0) { - if (this->reply_received_ != 1 - && *max_wait_time == ACE_Time_Value::zero) + if (reply_received != 1 && + *max_wait_time == ACE_Time_Value::zero) { result = -1; errno = ETIME; @@ -75,7 +81,7 @@ TAO_Wait_On_Reactor::wait (ACE_Time_Value *max_wait_time) else { result = 0; - if (this->reply_received_ == -1) + if (reply_received == -1) result = -1; } @@ -89,14 +95,14 @@ TAO_Wait_On_Reactor::handle_input (void) if (result == 1) { - this->reply_received_ = 1; + // this->reply_received_ = 1; result = 0; } - if (result == -1) - this->reply_received_ = -1; + // if (result == -1) + // reply_received = -1; - return result; + return result; } // Register the handler with the Reactor. @@ -110,7 +116,27 @@ TAO_Wait_On_Reactor::register_handler (void) // Constructor. TAO_Wait_On_Leader_Follower::TAO_Wait_On_Leader_Follower (TAO_Transport *transport) - : TAO_Wait_Strategy (transport), + : TAO_Wait_Strategy (transport) +{ +} + +// Destructor. +TAO_Wait_On_Leader_Follower::~TAO_Wait_On_Leader_Follower (void) +{ +} + +// Register the handler. +int +TAO_Wait_On_Leader_Follower::register_handler (void) +{ + return this->transport_->register_handler (); +} + +// ********************************************************************* + +// Constructor. +TAO_Exclusive_Wait_On_Leader_Follower::TAO_Exclusive_Wait_On_Leader_Follower (TAO_Transport *transport) + : TAO_Wait_On_Leader_Follower (transport), calling_thread_ (ACE_OS::NULL_thread), cond_response_available_ (0), expecting_response_ (0), @@ -119,7 +145,7 @@ TAO_Wait_On_Leader_Follower::TAO_Wait_On_Leader_Follower (TAO_Transport *transpo } // Destructor. -TAO_Wait_On_Leader_Follower::~TAO_Wait_On_Leader_Follower (void) +TAO_Exclusive_Wait_On_Leader_Follower::~TAO_Exclusive_Wait_On_Leader_Follower (void) { delete this->cond_response_available_; this->cond_response_available_ = 0; @@ -130,7 +156,7 @@ TAO_Wait_On_Leader_Follower::~TAO_Wait_On_Leader_Follower (void) // with the <Transport> object and <two_way> flag wont make sense // at this level since this is common for AMI also. (Alex). int -TAO_Wait_On_Leader_Follower::sending_request (TAO_ORB_Core *orb_core, +TAO_Exclusive_Wait_On_Leader_Follower::sending_request (TAO_ORB_Core *orb_core, int two_way) { { @@ -175,7 +201,8 @@ TAO_Wait_On_Leader_Follower::sending_request (TAO_ORB_Core *orb_core, } int -TAO_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time) +TAO_Exclusive_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, + int &) { // Cache the ORB core, it won't change and is used multiple times // below: @@ -400,7 +427,7 @@ TAO_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time) // Handle the input. Return -1 on error, 0 on success. int -TAO_Wait_On_Leader_Follower::handle_input (void) +TAO_Exclusive_Wait_On_Leader_Follower::handle_input (void) { TAO_ORB_Core* orb_core = this->transport_->orb_core (); @@ -460,15 +487,8 @@ TAO_Wait_On_Leader_Follower::handle_input (void) return result; } -// Register the handler. -int -TAO_Wait_On_Leader_Follower::register_handler (void) -{ - return this->transport_->register_handler (); -} - ACE_SYNCH_CONDITION * -TAO_Wait_On_Leader_Follower::cond_response_available (void) +TAO_Exclusive_Wait_On_Leader_Follower::cond_response_available (void) { // @@ TODO This condition variable should per-ORB-per-thread, not // per-connection, it is a waste to have more than one of this in @@ -485,7 +505,7 @@ TAO_Wait_On_Leader_Follower::cond_response_available (void) } void -TAO_Wait_On_Leader_Follower::wake_up (void) +TAO_Exclusive_Wait_On_Leader_Follower::wake_up (void) { if (ACE_OS::thr_equal (this->calling_thread_, ACE_Thread::self ())) { @@ -534,6 +554,286 @@ TAO_Wait_On_Leader_Follower::wake_up (void) // ********************************************************************* // Constructor. +TAO_Muxed_Wait_On_Leader_Follower::TAO_Muxed_Wait_On_Leader_Follower (TAO_Transport *transport) + : TAO_Wait_On_Leader_Follower (transport) +{ +} + +// Destructor. +TAO_Muxed_Wait_On_Leader_Follower::~TAO_Muxed_Wait_On_Leader_Follower (void) +{ +} + +int +TAO_Muxed_Wait_On_Leader_Follower::sending_request (TAO_ORB_Core *orb_core, + int two_way) +{ + // Register the handler. + // @@ We could probably move this somewhere else, and remove this + // function totally. (Alex). + this->transport_->register_handler (); + + // Send the request. + return this->TAO_Wait_Strategy::sending_request (orb_core, + two_way); +} + +int +TAO_Muxed_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, + int &reply_received) +{ + // Cache the ORB core, it won't change and is used multiple times + // below: + TAO_ORB_Core* orb_core = + this->transport_->orb_core (); + + TAO_Leader_Follower& leader_follower = + orb_core->leader_follower (); + + // Obtain the lock. + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, + leader_follower.lock (), -1); + + leader_follower.set_client_thread (); + + ACE_Countdown_Time countdown (max_wait_time); + + // Check if there is a leader, but the leader is not us + if (leader_follower.leader_available () + && !leader_follower.is_leader_thread ()) + { + // = Wait as a follower. + + // Grab the condtion variable. + ACE_SYNCH_CONDITION* cond = + orb_core->leader_follower_condition_variable (); + + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - wait (follower) on Transport <%x>, cond <%x>\n", + this->transport_, + cond)); + + // Add ourselves to the list, do it only once because we can + // wake up multiple times from the CV loop. And only do it if + // the reply has not been received (it could have arrived while + // we were preparing to receive it). + + if (!reply_received + && leader_follower.leader_available ()) + { + if (leader_follower.add_follower (cond) == -1) + ACE_ERROR ((LM_ERROR, + "TAO (%P|%t) TAO_Muxed_Wait_On_Leader_Follower::wait - " + "add_follower failed for <%x>\n", + cond)); + } + + + while (!reply_received && + leader_follower.leader_available ()) + { + if (max_wait_time == 0) + { + if (cond == 0 || cond->wait () == -1) + { + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - wait (follower) on <%x> " + "cond == 0 || cond->wait () == -1 : cond = %d\n", + this->transport_, (cond == 0) ? 0 : cond)); + return -1; + } + } + else + { + countdown.update (); + ACE_Time_Value tv = ACE_OS::gettimeofday (); + tv += *max_wait_time; + if (cond == 0 || cond->wait (&tv) == -1) + { + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - wait (follower) on <%x> " + "cond == 0 || cond->wait (tv) == -1\n", + this->transport_)); + return -1; + } + } + } + + countdown.update (); + +#if 0 + // Cannot remove the follower here, we *must* remove it when we + // signal it so the same condition is not signalled for both + // wake up as a follower and as the next leader. + if (leader_follower.remove_follower (cond) == -1) + ACE_ERROR ((LM_ERROR, + "TAO (%P|%t) TAO_Muxed_Wait_On_Leader_Follower::wait - " + "remove_follower failed for <%x>\n", cond)); +#endif /* 0 */ + + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - done (follower) on <%x>, reply_received %d\n", + this->transport_, reply_received)); + + // Now somebody woke us up to become a leader or to handle + // our input. We are already removed from the follower queue. + + if (reply_received == 1) + return 0; + + // FALLTHROUGH + // We only get here if we woke up but the reply is not complete + // yet, time to assume the leader role.... + // i.e. ACE_ASSERT (this->reply_received_ == 0); + } + + // = Leader Code. + + // The only way to reach this point is if we must become the leader, + // because there is no leader or we have to update to a leader or we + // are doing nested upcalls in this case we do increase the refcount + // on the leader in TAO_ORB_Core. + + // This might increase the refcount of the leader. + leader_follower.set_leader_thread (); + + int result = 1; + + { + ACE_GUARD_RETURN (ACE_Reverse_Lock<ACE_SYNCH_MUTEX>, rev_mon, + leader_follower.reverse_lock (), -1); + + // @@ Do we need to do this? + // Become owner of the reactor. + orb_core->reactor ()->owner (ACE_Thread::self ()); + + // Run the reactor event loop. + + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - wait (leader):to enter reactor event loop on <%x>\n", + this->transport_)); + + while (result > 0 && reply_received == 0) + result = orb_core->reactor ()->handle_events (max_wait_time); + + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - wait : (leader) : done with reactor event loop on <%x>\n", + this->transport_)); + } + + // Wake up the next leader, we cannot do that in handle_input, + // because the woken up thread would try to get into + // handle_events, which is at the time in handle_input still + // occupied. But do it before checking the error in <result>, even + // if there is an error in our input we should continue running the + // loop in another thread. + + leader_follower.reset_leader_thread (); + leader_follower.reset_client_thread (); + + if (leader_follower.elect_new_leader () == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "TAO:%N:%l:(%P|%t):TAO_Muxed_Wait_On_Leader_Follower::send_request: " + "Failed to unset the leader and wake up a new follower.\n"), + -1); + + if (result == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "TAO:%N:%l:(%P|%t):TAO_Muxed_Wait_On_Leader_Follower::wait: " + "handle_events failed.\n"), + -1); + + // Return an error if there was a problem receiving the reply... + if (max_wait_time != 0) + { + if (reply_received != 1 + && *max_wait_time == ACE_Time_Value::zero) + { + result = -1; + errno = ETIME; + } + } + else + { + result = 0; + if (reply_received == -1) + { + result = -1; + } + } + + return result; +} + +// Handle the input. Return -1 on error, 0 on success. +int +TAO_Muxed_Wait_On_Leader_Follower::handle_input (void) +{ + // Cache the ORB core, it won't change and is used multiple times + // below: + TAO_ORB_Core* orb_core = + this->transport_->orb_core (); + + // Obtain the lock. + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, + orb_core->leader_follower ().lock (), + -1); + + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - reading reply on <%x>\n", + this->transport_)); + + // Receive any data that is available, without blocking... + int result = this->transport_->handle_client_input (0); + + // Data was read, but there the reply has not been completely + // received... + if (result == 0) + return 0; + + if (result == -1) + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Wait_On_LF::handle_input, " + "handle_client_input == -1\n")); + // this->reply_received_ = -1; + } + + if (result == 1) + { + // Change the result value to something that the Reactor can + // understand + result = 0; + + // reply_received_ = 1; + // This would have been done by the dispatch already. + } + + // Wake up any threads waiting for this message, either because the + // message failed or because we really received it. + // this->wake_up (); + // <wake_up> will be done in the <dispatch_reply> + + return result; +} + +ACE_SYNCH_CONDITION * +TAO_Muxed_Wait_On_Leader_Follower::leader_follower_condition_variable (void) +{ + return this->transport_->orb_core ()->leader_follower_condition_variable (); +} + +// ********************************************************************* + +// Constructor. TAO_Wait_On_Read::TAO_Wait_On_Read (TAO_Transport *transport) : TAO_Wait_Strategy (transport) { @@ -546,7 +846,8 @@ TAO_Wait_On_Read::~TAO_Wait_On_Read (void) // Wait on the read operation. int -TAO_Wait_On_Read::wait (ACE_Time_Value * max_wait_time) +TAO_Wait_On_Read::wait (ACE_Time_Value * max_wait_time, + int &) { int reply_complete = 0; while (reply_complete != 1) diff --git a/TAO/tao/Wait_Strategy.h b/TAO/tao/Wait_Strategy.h index 0cc8ea91ade..73b4bdcafb7 100644 --- a/TAO/tao/Wait_Strategy.h +++ b/TAO/tao/Wait_Strategy.h @@ -52,8 +52,10 @@ public: // variables because the reply may arrive *before* the user calls // wait. - virtual int wait (ACE_Time_Value *max_wait_time) = 0; - // Base class virtual method. + virtual int wait (ACE_Time_Value *max_wait_time, + int &reply_received) = 0; + // Base class virtual method. Wait till the <reply_received> flag is + // true or the time expires. virtual int handle_input (void) = 0; // Handle the input. @@ -62,6 +64,11 @@ public: // Register the handler with the Reactor if it makes sense for the // strategy. + virtual ACE_SYNCH_CONDITION *leader_follower_condition_variable (void); + // Return the TSS leader follower condition variable used in the + // Wait Strategy. Muxed Leader Follower implementation returns a + // valid condition variable, others return 0. + protected: TAO_Transport *transport_; // Transport object. @@ -69,7 +76,9 @@ protected: // @@ Alex: we should consider moving these classes to separate files, // that can minimize the footprint of systems that use only one of -// the strategies.... +// the strategies....(coryan). + +// ********************************************************************* class TAO_Export TAO_Wait_On_Reactor : public TAO_Wait_Strategy { @@ -90,16 +99,19 @@ public: // = Documented in TAO_Wait_Strategy. - virtual int wait (ACE_Time_Value *max_wait_time); + virtual int wait (ACE_Time_Value *max_wait_time, + int &reply_received); virtual int handle_input (void); virtual int register_handler (void); private: - int reply_received_; + // int reply_received_; // This flag indicates if a *complete* reply has been received. Used // to exit the event loop. }; +// ********************************************************************* + class TAO_Export TAO_Wait_On_Leader_Follower : public TAO_Wait_Strategy { // = TITLE @@ -117,14 +129,53 @@ public: virtual ~TAO_Wait_On_Leader_Follower (void); // Destructor. + + // = Documented in TAO_Wait_Strategy. + + // virtual int sending_request (TAO_ORB_Core *orb_core, + // int two_way); + + // virtual int wait (ACE_Time_Value *max_wait_time, + // int &reply_received); + + // virtual int handle_input (void); + + virtual int register_handler (void); +}; + +// ********************************************************************* + +class TAO_Export TAO_Exclusive_Wait_On_Leader_Follower : public TAO_Wait_On_Leader_Follower +{ + // = TITLE + // + // Wait according to the Leader-Follower model. Leader does the + // event loop of the Reactor and the Followers wait on the + // condition variable. + // + // = DESCRIPTION + // + // This is strategy is to work with the Exclusive Transport Mux + // Strategy. This was the original implementation of Leader + // Follower before Muxed Transport was introduced. Here the + // state variables such as Condition Variable etc are kept in + // the <Wait Strategy> which is a per Transport object. +public: + TAO_Exclusive_Wait_On_Leader_Follower (TAO_Transport *transport); + // Constructor. + + virtual ~TAO_Exclusive_Wait_On_Leader_Follower (void); + // Destructor. + // = Documented in TAO_Wait_Strategy. virtual int sending_request (TAO_ORB_Core *orb_core, int two_way); - virtual int wait (ACE_Time_Value *max_wait_time); + virtual int wait (ACE_Time_Value *max_wait_time, + int &reply_received); virtual int handle_input (void); - virtual int register_handler (void); + // virtual int register_handler (void); protected: ACE_SYNCH_CONDITION* cond_response_available (void); @@ -151,6 +202,50 @@ protected: // or the reactor event loop. }; +// ********************************************************************* + +class TAO_Export TAO_Muxed_Wait_On_Leader_Follower : public TAO_Wait_On_Leader_Follower +{ + // = TITLE + // + // Wait according to the Leader-Follower model. Leader does the + // event loop of the Reactor and the Followers wait on the + // condition variable. + // + // = DESCRIPTION + // + // This impelementation is to work with the Muxed Transport + // Mechanism. Here the state variables such as <Condition + // Variable> etc cannot be kept in the Wait Strategy, since the + // Wait Strategy is per Transport object and here the Transport + // is Muxed and hence there are multiple threads running in the + // same Transport context. + +public: + TAO_Muxed_Wait_On_Leader_Follower (TAO_Transport *transport); + // Constructor. + + virtual ~TAO_Muxed_Wait_On_Leader_Follower (void); + // Destructor. + + // = Documented in TAO_Wait_Strategy. + + virtual int sending_request (TAO_ORB_Core *orb_core, + int two_way); + + virtual int wait (ACE_Time_Value *max_wait_time, + int &reply_received); + + virtual int handle_input (void); + + // virtual int register_handler (void); + + virtual ACE_SYNCH_CONDITION *leader_follower_condition_variable (void); + // TSS Leader follower condition variable. +}; + +// ********************************************************************* + class TAO_Export TAO_Wait_On_Read : public TAO_Wait_Strategy { // = TITLE @@ -166,7 +261,10 @@ public: virtual ~TAO_Wait_On_Read (void); // Destructor. - virtual int wait (ACE_Time_Value *max_wait_time); + // = Documented in TAO_Wait_Strategy. + + virtual int wait (ACE_Time_Value *max_wait_time, + int &reply_received); virtual int handle_input (void); virtual int register_handler (void); }; diff --git a/TAO/tao/default_client.cpp b/TAO/tao/default_client.cpp index d9e3afd421a..219c8fbbf74 100644 --- a/TAO/tao/default_client.cpp +++ b/TAO/tao/default_client.cpp @@ -175,17 +175,17 @@ TAO_Default_Client_Strategy_Factory::create_profile_lock (void) // Create the correct client transport muxing strategy. TAO_Transport_Mux_Strategy * -TAO_Default_Client_Strategy_Factory::create_transport_mux_strategy (TAO_ORB_Core *orb_core) +TAO_Default_Client_Strategy_Factory::create_transport_mux_strategy (TAO_Transport *transport) { TAO_Transport_Mux_Strategy *tms = 0; if (this->transport_mux_strategy_ == TAO_MUXED_TMS) ACE_NEW_RETURN (tms, - TAO_Muxed_TMS (orb_core), + TAO_Muxed_TMS (transport), 0); else ACE_NEW_RETURN (tms, - TAO_Exclusive_TMS (orb_core), + TAO_Exclusive_TMS (transport), 0); return tms; @@ -205,10 +205,19 @@ TAO_Default_Client_Strategy_Factory::create_wait_strategy (TAO_Transport *transp TAO_Wait_On_Reactor (transport), 0); else - ACE_NEW_RETURN (ws, - TAO_Wait_On_Leader_Follower (transport), - 0); - + { + // = Leader follower model. + + if (this->transport_mux_strategy_ == TAO_EXCLUSIVE_TMS) + ACE_NEW_RETURN (ws, + TAO_Exclusive_Wait_On_Leader_Follower (transport), + 0); + else + ACE_NEW_RETURN (ws, + TAO_Muxed_Wait_On_Leader_Follower (transport), + 0); + } + return ws; } diff --git a/TAO/tao/default_client.h b/TAO/tao/default_client.h index 17955110798..05d557fd293 100644 --- a/TAO/tao/default_client.h +++ b/TAO/tao/default_client.h @@ -50,7 +50,7 @@ public: // = Check Client_Strategy_Factory.h for the documentation of the // following methods. ACE_Lock* create_profile_lock (void); - TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_ORB_Core *orb_core); + TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_Transport *transport); TAO_Wait_Strategy *create_wait_strategy (TAO_Transport *transport); virtual ACE_Lock *create_cached_connector_lock (void); diff --git a/TAO/tests/AMI/README b/TAO/tests/AMI/README index 4c1d0b89859..15a83385c47 100644 --- a/TAO/tests/AMI/README +++ b/TAO/tests/AMI/README @@ -2,13 +2,33 @@ Description: - This is a simple test for AMI callback model. Right now the -IDL compiler does not generate all the code. Therefore, you need to -copy test-handC.cpp onto testC.cpp. - - This is still in a development phase. It is not at all -complete. +This is a simple test for AMI callback model. $ server -o test.ior $ client -k file://test.ior -n 4 -i 1000 -$ simple_client -k file://test_ior + +simple-client: +============= + +$ simple_client -k file://test_ior [-i <niterations] [-x] [-d] \ + -ORBSvcConf {simple-client-muxed.conf, + simple-client-exclusive.conf} + +-d Enable debug messages. +-i Number of iterations. +-k IOR. +-x Call shutdown method. + +Issues <i> number of asynchronous requests. Then it issues a +synchronous request, which collects the replies. + +If you choose Muxed Transport configuration, then the synchronous +request will collect all the asynchronous replies also, since the +replies will arrive in order. + +But in the Exclusive Transport, the synchronous request might now +collect all the AMI replies. It might return as soon as its reply +arrives. + + + diff --git a/TAO/tests/AMI/client.conf b/TAO/tests/AMI/client.conf index 5276fe68900..c0794261618 100644 --- a/TAO/tests/AMI/client.conf +++ b/TAO/tests/AMI/client.conf @@ -1,2 +1,2 @@ -static Client_Strategy_Factory "-ORBiiopprofilelock null -ORBclientconnectionhandler RW" +static Client_Strategy_Factory "-ORBProfileLock null -ORBclientconnectionhandler ST" diff --git a/TAO/tests/AMI/client.cpp b/TAO/tests/AMI/client.cpp index 31527aa0e42..75f324dcf67 100644 --- a/TAO/tests/AMI/client.cpp +++ b/TAO/tests/AMI/client.cpp @@ -9,16 +9,21 @@ ACE_RCSID(MT_Client, client, "$Id$") const char *ior = "file://test.ior"; int nthreads = 5; int niterations = 5; +int debug = 0; +int number_of_replies = 0; int parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "k:n:i:"); + ACE_Get_Opt get_opts (argc, argv, "dk:n:i:"); int c; while ((c = get_opts ()) != -1) switch (c) { + case 'd': + debug = 1; + break; case 'k': ior = get_opts.optarg; break; @@ -32,6 +37,7 @@ parse_args (int argc, char *argv[]) default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " + "-d " "-k <ior> " "-n <nthreads> " "-i <niterations> " @@ -58,22 +64,43 @@ public: virtual int svc (void); // The thread entry point. -private: + // private: Simple_Server_var server_; // The server. int niterations_; // The number of iterations on each client thread. + + AMI_Simple_Server_Handler_var the_handler_; + // Var for ReplyHandler object. }; class Handler : public POA_AMI_Simple_Server_Handler { public: Handler (void) {}; + + void get_put_number (CORBA::Long result, + CORBA::Long out_l, + CORBA::Environment&) + { + if (debug) + { + ACE_DEBUG ((LM_DEBUG, + "(%P | %t) : Callback method called: result <%d>, out_arg <%d>\n", + result, + out_l)); + } + + number_of_replies--; + }; ~Handler (void) {}; }; +// ReplyHandler. +Handler handler; + int main (int argc, char *argv[]) { @@ -129,9 +156,36 @@ main (int argc, char *argv[]) "Cannot activate client threads\n"), 1); + // Main thread collects replies. It needs to collect + // <nthreads*niterations> replies. + number_of_replies = nthreads * niterations; + + if (debug) + { + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) : Entering perform_work loop to receive <%d> replies\n", + number_of_replies)); + } + + // ORB loop. + while (orb->work_pending () && number_of_replies > 0) + { + orb->perform_work (); + } + + if (debug) + { + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) : Exited perform_work loop Received <%d> replies\n", + (nthreads*niterations) - number_of_replies)); + } + + client.thr_mgr ()->wait (); ACE_DEBUG ((LM_DEBUG, "threads finished\n")); + + client.server_->shutdown (); } ACE_CATCHANY { @@ -151,6 +205,7 @@ Client::Client (Simple_Server_ptr server, : server_ (Simple_Server::_duplicate (server)), niterations_ (niterations) { + the_handler_ = handler._this (/* ACE_TRY_ENV */); } int @@ -168,26 +223,21 @@ Client::svc (void) ACE_TRY_CHECK; #endif - Handler handler; - AMI_Simple_Server_Handler_var the_handler = - handler._this (ACE_TRY_ENV); - ACE_TRY_CHECK; - - CORBA::Long number = 0; + CORBA::Long number = 931232; for (int i = 0; i < this->niterations_; ++i) { - server_->sendc_get_number (the_handler.in (), - ACE_TRY_ENV); + server_->sendc_get_put_number (the_handler_.in (), + number, + ACE_TRY_ENV); ACE_TRY_CHECK; - - if (TAO_debug_level > 0 && i % 100 == 0) - ACE_DEBUG ((LM_DEBUG, "(%P|%t) iteration = %d\n", i)); } - - number = server_->get_number (ACE_TRY_ENV); - - ACE_DEBUG ((LM_DEBUG, "(%P | %t) get_number = %d\n", number)); + if (debug) + { + ACE_DEBUG ((LM_DEBUG, + "(%P | %t):<%d> Asynchronous methods issued\n", + niterations)); + } } ACE_CATCHANY { diff --git a/TAO/tests/AMI/client.muxed.conf b/TAO/tests/AMI/client.muxed.conf index e41aabecf7a..9450aa9f905 100644 --- a/TAO/tests/AMI/client.muxed.conf +++ b/TAO/tests/AMI/client.muxed.conf @@ -1,2 +1,4 @@ -static Client_Strategy_Factory "-ORBTransportMuxStrategy MUXED -ORBiiopprofilelock null -ORBclientconnectionhandler MT" +static Client_Strategy_Factory "-ORBTransportMuxStrategy MUXED -ORBIiopProfilelock null" + + diff --git a/TAO/tests/AMI/run_test.pl b/TAO/tests/AMI/run_test.pl index 2c6a97e729e..06363f75467 100755 --- a/TAO/tests/AMI/run_test.pl +++ b/TAO/tests/AMI/run_test.pl @@ -5,59 +5,61 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' # $Id$ # -*- perl -*- -unshift @INC, '../../../bin'; -require ACEutils; + # unshift @INC, '../../../bin'; + # require ACEutils; + # + # $client_conf="client.global.conf"; + # $client_process="client"; + # $debug_level='5'; + # $threads='2'; + # $iterations='1'; + # + # foreach $i (@ARGV) { + # if ($i eq '-tss') { + # $client_conf = "client.tss.conf"; + # } elsif ($i eq '-debug') { + # $debug_level = '1'; + # } elsif ($i eq '-creation') { + # $client_process = 'orb_creation'; + # $threads='2'; + # } + # } + # + # $iorfile = "server.ior"; + # $SV = Process::Create ($EXEPREFIX."server$EXE_EXT ", + # " -ORBsvcconf server.conf -ORBdebuglevel $debug_level" + # . " -o $iorfile"); + # + # if (ACE::waitforfile_timed ($iorfile, 5) == -1) { + # print STDERR "ERROR: cannot find file <$iorfile>\n"; + # $SV->Kill (); $SV->TimedWait (1); + # exit 1; + # } + # + # $CL = Process::Create ($EXEPREFIX."$client_process$EXE_EXT ", + # " -ORBsvcconf $client_conf " + # . "-ORBdebuglevel $debug_level" + # . " -k file://$iorfile " + # . " -n $threads -i $iterations"); + # + # $client = $CL->TimedWait (60); + # if ($client == -1) { + # print STDERR "ERROR: client timedout\n"; + # $CL->Kill (); $CL->TimedWait (1); + # } + # + # $server = $SV->TimedWait (5); + # if ($server == -1) { + # print STDERR "ERROR: server timedout\n"; + # $SV->Kill (); $SV->TimedWait (1); + # } + # + # unlink $iorfile; + # + # if ($server != 0 || $client != 0) { + # exit 1; + # } + # + # exit 0; + # -$client_conf="client.global.conf"; -$client_process="client"; -$debug_level='5'; -$threads='2'; -$iterations='1'; - -foreach $i (@ARGV) { - if ($i eq '-tss') { - $client_conf = "client.tss.conf"; - } elsif ($i eq '-debug') { - $debug_level = '1'; - } elsif ($i eq '-creation') { - $client_process = 'orb_creation'; - $threads='2'; - } -} - -$iorfile = "server.ior"; -$SV = Process::Create ($EXEPREFIX."server$EXE_EXT ", - " -ORBsvcconf server.conf -ORBdebuglevel $debug_level" - . " -o $iorfile"); - -if (ACE::waitforfile_timed ($iorfile, 5) == -1) { - print STDERR "ERROR: cannot find file <$iorfile>\n"; - $SV->Kill (); $SV->TimedWait (1); - exit 1; -} - -$CL = Process::Create ($EXEPREFIX."$client_process$EXE_EXT ", - " -ORBsvcconf $client_conf " - . "-ORBdebuglevel $debug_level" - . " -k file://$iorfile " - . " -n $threads -i $iterations"); - -$client = $CL->TimedWait (60); -if ($client == -1) { - print STDERR "ERROR: client timedout\n"; - $CL->Kill (); $CL->TimedWait (1); -} - -$server = $SV->TimedWait (5); -if ($server == -1) { - print STDERR "ERROR: server timedout\n"; - $SV->Kill (); $SV->TimedWait (1); -} - -unlink $iorfile; - -if ($server != 0 || $client != 0) { - exit 1; -} - -exit 0; diff --git a/TAO/tests/AMI/server.cpp b/TAO/tests/AMI/server.cpp index 9a2dfa93eb3..37f3ccf7595 100644 --- a/TAO/tests/AMI/server.cpp +++ b/TAO/tests/AMI/server.cpp @@ -17,13 +17,13 @@ parse_args (int argc, char *argv[]) switch (c) { case 'o': - ior_output_file = get_opts.optarg; - break; + ior_output_file = get_opts.optarg; + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " - "-o <iorfile>" + "-o <iorfile>" "\n", argv [0]), -1); @@ -66,36 +66,30 @@ main (int argc, char *argv[]) ACE_TRY_CHECK; CORBA::String_var ior = - orb->object_to_string (server.in (), ACE_TRY_ENV); + orb->object_to_string (server.in (), ACE_TRY_ENV); ACE_TRY_CHECK; ACE_DEBUG ((LM_DEBUG, "Activated as <%s>\n", ior.in ())); // If the ior_output_file exists, output the ior to it if (ior_output_file != 0) - { - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: %s", - ior_output_file), - 1); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); - } + { + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); + if (output_file == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file for writing IOR: %s", + ior_output_file), + 1); + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); + } poa_manager->activate (ACE_TRY_ENV); ACE_TRY_CHECK; - CORBA::Long number = 0; - - number = server->get_number (ACE_TRY_ENV); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, "get_number = %d\n", number)); - if (orb->run () == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "orb->run"), -1); + ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); } ACE_CATCHANY diff --git a/TAO/tests/AMI/simple-client-exclusive.conf b/TAO/tests/AMI/simple-client-exclusive.conf new file mode 100644 index 00000000000..c78e5018593 --- /dev/null +++ b/TAO/tests/AMI/simple-client-exclusive.conf @@ -0,0 +1,2 @@ + +static Client_Strategy_Factory "-ORBTransportMuxStrategy EXCLUSIVE -ORBiiopprofilelock null -ORBclientconnectionhandler ST" diff --git a/TAO/tests/AMI/simple-client.conf b/TAO/tests/AMI/simple-client-muxed.conf index 97bca811c1b..97bca811c1b 100644 --- a/TAO/tests/AMI/simple-client.conf +++ b/TAO/tests/AMI/simple-client-muxed.conf diff --git a/TAO/tests/AMI/simple-client.cpp b/TAO/tests/AMI/simple-client.cpp index 9c821f72d1b..3d9a14b5868 100644 --- a/TAO/tests/AMI/simple-client.cpp +++ b/TAO/tests/AMI/simple-client.cpp @@ -8,28 +8,37 @@ ACE_RCSID(MT_Client, client, "$Id$") const char *ior = "file://test.ior"; int niterations = 5; +int shutdown_flag = 0; +int debug = 0; int parse_args (int argc, char *argv[]) { - ACE_Get_Opt get_opts (argc, argv, "k:i:"); + ACE_Get_Opt get_opts (argc, argv, "dk:i:x"); int c; while ((c = get_opts ()) != -1) switch (c) { + case 'd': + debug = 1; + break; case 'k': ior = get_opts.optarg; break; case 'i': niterations = ACE_OS::atoi (get_opts.optarg); break; + case 'x': + shutdown_flag = 1; + break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, "usage: %s " "-k <ior> " "-i <niterations> " + "-x " "\n", argv [0]), -1); @@ -42,8 +51,23 @@ class Handler : public POA_AMI_Simple_Server_Handler { public: Handler (void) {}; - + // Constructor. + + void get_put_number (CORBA::Long result, + CORBA::Long out_l, + CORBA::Environment&) + { + if (debug) + { + ACE_DEBUG ((LM_DEBUG, + "Callback method called: result <%d>, out_arg <%d>\n", + result, + out_l)); + } + }; + ~Handler (void) {}; + // Destructor. }; int @@ -91,27 +115,42 @@ main (int argc, char *argv[]) 1); } + // Instantiate the ReplyHandler and register that with the POA. Handler handler; AMI_Simple_Server_Handler_var the_handler = handler._this (ACE_TRY_ENV); ACE_TRY_CHECK; - - CORBA::Long number = 0; + CORBA::Long l = 931247; + for (ssize_t ni = 0; ni < niterations; ni++) { - - server->sendc_get_number (the_handler.in (), - ACE_TRY_ENV); + server->sendc_get_put_number (the_handler.in (), + l, + ACE_TRY_ENV); ACE_TRY_CHECK; } - number = server->get_number (ACE_TRY_ENV); - ACE_TRY_CHECK; + if (debug) + { + ACE_DEBUG ((LM_DEBUG, + "<%d> Asynchronous methods issued\n", + niterations)); + } + + if (debug) + { + ACE_DEBUG ((LM_DEBUG, + "Issuing a synchronous method to collect the AMI replies\n")); + } - ACE_DEBUG ((LM_DEBUG, - "get_number = %d\n", - number)); + CORBA::Long number = server->get_put_number (l, + l, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + if (shutdown_flag) + server->shutdown (); } ACE_CATCHANY { diff --git a/TAO/tests/AMI/test-handC.cpp b/TAO/tests/AMI/test-handC.cpp index b0bda5a45b0..41d00eaf173 100644 --- a/TAO/tests/AMI/test-handC.cpp +++ b/TAO/tests/AMI/test-handC.cpp @@ -16,50 +16,37 @@ Simple_Server_ptr Simple_Server::_narrow ( CORBA::Object_ptr obj, - CORBA::Environment &env + CORBA::Environment &ACE_TRY_ENV ) { if (CORBA::is_nil (obj)) return Simple_Server::_nil (); - if (!obj->_is_a ("IDL:Simple_Server:1.0", env)) + CORBA::Boolean is_a = obj->_is_a ("IDL:Simple_Server:1.0", ACE_TRY_ENV); + ACE_CHECK_RETURN (Simple_Server::_nil ()); + if (is_a == 0) return Simple_Server::_nil (); - return Simple_Server::_unchecked_narrow (obj, env); + return Simple_Server::_unchecked_narrow (obj, ACE_TRY_ENV); } Simple_Server_ptr Simple_Server::_unchecked_narrow ( CORBA::Object_ptr obj, - CORBA::Environment &ACE_TRY_ENV + CORBA::Environment & ) { - ACE_UNUSED_ARG (ACE_TRY_ENV); if (CORBA::is_nil (obj)) return Simple_Server::_nil (); TAO_Stub* stub = obj->_stubobj (); stub->_incr_refcnt (); - void* servant = 0; - if (obj->_is_collocated () && obj->_servant() != 0) - servant = obj->_servant()->_downcast ("IDL:omg.org/CORBA/Object:1.0"); - if (servant != 0) + if (obj->_is_collocated () && _TAO_collocation_Simple_Server_Stub_Factory_function_pointer != 0) { - Simple_Server_ptr retv = ACE_reinterpret_cast ( - Simple_Server_ptr, - ACE_reinterpret_cast ( - PortableServer::Servant, - servant - ) - ->_create_collocated_objref ( - "IDL:Simple_Server:1.0", - TAO_ORB_Core::ORB_CONTROL, - stub - ) - ); + Simple_Server_ptr retv = _TAO_collocation_Simple_Server_Stub_Factory_function_pointer (obj); if (retv != 0) return retv; } return new Simple_Server(stub); } -Simple_Server_ptr +Simple_Server_ptr Simple_Server::_duplicate (Simple_Server_ptr obj) { if (!CORBA::is_nil (obj)) @@ -67,34 +54,42 @@ Simple_Server::_duplicate (Simple_Server_ptr obj) return obj; } -CORBA::Long Simple_Server::get_number ( +CORBA::Long Simple_Server::get_put_number ( + CORBA::Long_out out_l, + CORBA::Long in_l, CORBA::Environment &ACE_TRY_ENV ) ACE_THROW_SPEC (( CORBA::SystemException )) { - + CORBA::Long _tao_retval = 0; + TAO_Stub *istub = this->_stubobj (); if (istub == 0) ACE_THROW_RETURN (CORBA::INTERNAL (), _tao_retval); - + TAO_GIOP_Twoway_Invocation _tao_call ( istub, - "get_number", + "get_put_number", istub->orb_core () ); - + for (;;) { - ACE_TRY_ENV.clear (); _tao_call.start (ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); + TAO_OutputCDR &_tao_out = _tao_call.out_stream (); + if (!( + (_tao_out << in_l) + )) + ACE_THROW_RETURN (CORBA::MARSHAL (), _tao_retval); + int _invoke_status = _tao_call.invoke (0, 0, ACE_TRY_ENV); ACE_CHECK_RETURN (_tao_retval); @@ -109,42 +104,49 @@ CORBA::Long Simple_Server::get_number ( } break; - + } TAO_InputCDR &_tao_in = _tao_call.inp_stream (); if (!( - (_tao_in >> _tao_retval) + (_tao_in >> _tao_retval) && + (_tao_in >> out_l) )) ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), _tao_retval); return _tao_retval; } void -Simple_Server::sendc_get_number ( +Simple_Server::sendc_get_put_number ( AMI_Simple_Server_Handler_ptr _tao_ami_handler, + CORBA::Long in_l, CORBA::Environment &ACE_TRY_ENV ) { - + TAO_Stub *istub = this->_stubobj (); if (istub == 0) ACE_THROW (CORBA::INV_OBJREF ()); - + TAO_GIOP_Twoway_Asynch_Invocation _tao_call ( istub, - "get_number", + "get_put_number", istub->orb_core (), - &AMI_Simple_Server_Handler::get_number_skel, + &AMI_Simple_Server_Handler::get_put_number_skel, _tao_ami_handler ); - + for (;;) { - ACE_TRY_ENV.clear (); _tao_call.start (ACE_TRY_ENV); ACE_CHECK; + TAO_OutputCDR &_tao_out = _tao_call.out_stream (); + if (!( + (_tao_out << in_l) + )) + ACE_THROW (CORBA::MARSHAL ()); + int _invoke_status = _tao_call.invoke (0, 0, ACE_TRY_ENV); ACE_CHECK; @@ -159,19 +161,66 @@ Simple_Server::sendc_get_number ( } break; - + } return; } -CORBA::Boolean Simple_Server::_is_a (const CORBA::Char *value, CORBA::Environment &env) +void Simple_Server::shutdown ( + CORBA::Environment &ACE_TRY_ENV + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )) +{ + + + + + TAO_Stub *istub = this->_stubobj (); + if (istub == 0) + ACE_THROW (CORBA::INTERNAL ()); + + + TAO_GIOP_Oneway_Invocation _tao_call ( + istub, + "shutdown", + istub->orb_core () + ); + + + for (;;) + { + _tao_call.start (ACE_TRY_ENV); + ACE_CHECK; + + int _invoke_status = + _tao_call.invoke (ACE_TRY_ENV); + ACE_CHECK; + + if (_invoke_status == TAO_INVOKE_RESTART) + continue; + // if (_invoke_status == TAO_INVOKE_EXCEPTION) + // cannot happen + if (_invoke_status != TAO_INVOKE_OK) + { + ACE_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES)); + + } + break; + + } + +} + +CORBA::Boolean Simple_Server::_is_a (const CORBA::Char *value, CORBA::Environment &ACE_TRY_ENV) { if ( (!ACE_OS::strcmp ((char *)value, "IDL:Simple_Server:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env)))) + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/CORBA/Object:1.0"))) return 1; // success using local knowledge else - return this->CORBA_Object::_is_a (value, env); + return this->CORBA_Object::_is_a (value, ACE_TRY_ENV); } const char* Simple_Server::_interface_repository_id (void) const @@ -202,38 +251,23 @@ AMI_Simple_Server_Handler_ptr AMI_Simple_Server_Handler::_narrow ( AMI_Simple_Server_Handler_ptr AMI_Simple_Server_Handler::_unchecked_narrow ( CORBA::Object_ptr obj, - CORBA::Environment &ACE_TRY_ENV + CORBA::Environment & ) { - ACE_UNUSED_ARG (ACE_TRY_ENV); if (CORBA::is_nil (obj)) return AMI_Simple_Server_Handler::_nil (); TAO_Stub* stub = obj->_stubobj (); stub->_incr_refcnt (); - void* servant = 0; - if (obj->_is_collocated () && obj->_servant() != 0) - servant = obj->_servant()->_downcast ("IDL:omg.org/CORBA/Object:1.0"); - if (servant != 0) + if (obj->_is_collocated () && _TAO_collocation_AMI_Simple_Server_Handler_Stub_Factory_function_pointer != 0) { - AMI_Simple_Server_Handler_ptr retv = ACE_reinterpret_cast ( - AMI_Simple_Server_Handler_ptr, - ACE_reinterpret_cast ( - PortableServer::Servant, - servant - ) - ->_create_collocated_objref ( - "IDL:AMI_Simple_Server_Handler:1.0", - TAO_ORB_Core::ORB_CONTROL, - stub - ) - ); + AMI_Simple_Server_Handler_ptr retv = _TAO_collocation_AMI_Simple_Server_Handler_Stub_Factory_function_pointer (obj); if (retv != 0) return retv; } return new AMI_Simple_Server_Handler(stub); } -AMI_Simple_Server_Handler_ptr +AMI_Simple_Server_Handler_ptr AMI_Simple_Server_Handler::_duplicate (AMI_Simple_Server_Handler_ptr obj) { if (!CORBA::is_nil (obj)) @@ -241,153 +275,296 @@ AMI_Simple_Server_Handler::_duplicate (AMI_Simple_Server_Handler_ptr obj) return obj; } -void -AMI_Simple_Server_Handler::get_number ( - CORBA::Long _tao_ami_result, +void +AMI_Simple_Server_Handler::get_put_number ( + CORBA::Long _tao_retval, + CORBA::Long out_l, CORBA::Environment &ACE_TRY_ENV ) ACE_THROW_SPEC ((CORBA::SystemException)) + { - - TAO_Stub *istub = this->_stubobj (); - if (istub == 0) - ACE_THROW (CORBA::INTERNAL ()); - - TAO_GIOP_Twoway_Invocation _tao_call ( - istub, - "get_number", - istub->orb_core () - ); - - for (;;) + TAO_Stub *istub = this->_stubobj (); + if (istub == 0) + ACE_THROW (CORBA::INTERNAL ()); + + TAO_GIOP_Twoway_Invocation _tao_call ( + istub, + "get_put_number", + istub->orb_core () + ); + + + for (;;) + { + ACE_TRY_ENV.clear (); + _tao_call.start (ACE_TRY_ENV); + ACE_CHECK; + TAO_OutputCDR &_tao_out = _tao_call.out_stream (); + if (!( + (_tao_out << _tao_retval) && + (_tao_out << out_l) + )) + ACE_THROW (CORBA::MARSHAL ()); + int _invoke_status = + _tao_call.invoke (0, 0, ACE_TRY_ENV); + ACE_CHECK; + if (_invoke_status == TAO_INVOKE_RESTART) + continue; + // if (_invoke_status == TAO_INVOKE_EXCEPTION) + // cannot happen + if (_invoke_status != TAO_INVOKE_OK) { - ACE_TRY_ENV.clear (); - _tao_call.start (ACE_TRY_ENV); -ACE_CHECK; - TAO_OutputCDR &_tao_out = _tao_call.out_stream (); - if (!( -(_tao_out << _tao_ami_result) - - )) - ACE_THROW (CORBA::MARSHAL ()); - int _invoke_status = - _tao_call.invoke (0, 0, ACE_TRY_ENV); - ACE_CHECK; - if (_invoke_status == TAO_INVOKE_RESTART) - continue; - // if (_invoke_status == TAO_INVOKE_EXCEPTION) - // cannot happen - if (_invoke_status != TAO_INVOKE_OK) - { - ACE_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES)); - } - break; - + ACE_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES)); } - + break; + } +} + + void -AMI_Simple_Server_Handler::get_number_skel (TAO_InputCDR &_tao_reply_cdr, - Messaging::ReplyHandler_ptr _tao_reply_handler, - CORBA::Environment &ACE_TRY_ENV) -{ - // Retrive Reply Handler object. - AMI_Simple_Server_Handler_var _tao_reply_handler_object = - AMI_Simple_Server_Handler::_narrow (_tao_reply_handler, - ACE_TRY_ENV); +AMI_Simple_Server_Handler::get_put_number_skel ( + TAO_InputCDR &_tao_in, + Messaging::ReplyHandler_ptr _tao_reply_handler, + CORBA::Environment &ACE_TRY_ENV +) +{ + + // Retrieve Reply Handler object. + AMI_Simple_Server_Handler_var _tao_reply_handler_object = + AMI_Simple_Server_Handler::_narrow(_tao_reply_handler, ACE_TRY_ENV); ACE_CHECK; - // @@ Error handling. - - // Demarshall all the arguments. - CORBA::Long l; - _tao_reply_cdr >> l; - + // @@ Error handling + + //Demarshall all the arguments. + CORBA::Long _tao_retval = 0; + CORBA::Long out_l; + if (!( + (_tao_in >> _tao_retval) && + (_tao_in >> out_l) + )) + ACE_THROW (CORBA::MARSHAL ()); + // Invoke the call back method. - _tao_reply_handler_object->get_number (l, ACE_TRY_ENV); -} + _tao_reply_handler_object->get_put_number ( + _tao_retval, + out_l, + ACE_TRY_ENV + ); + ACE_CHECK; + +}; + +void +AMI_Simple_Server_Handler::shutdown ( + CORBA::Environment &ACE_TRY_ENV + ) + ACE_THROW_SPEC ((CORBA::SystemException)) + +{ + + + TAO_Stub *istub = this->_stubobj (); + if (istub == 0) + ACE_THROW (CORBA::INTERNAL ()); + + TAO_GIOP_Oneway_Invocation _tao_call ( + istub, + "shutdown", + istub->orb_core () + ); - CORBA::Boolean AMI_Simple_Server_Handler::_is_a (const CORBA::Char *value, CORBA::Environment &env) + + for (;;) { - if ( + ACE_TRY_ENV.clear (); + _tao_call.start (ACE_TRY_ENV); + ACE_CHECK; + int _invoke_status = + _tao_call.invoke (ACE_TRY_ENV); + ACE_CHECK; + if (_invoke_status == TAO_INVOKE_RESTART) + continue; + // if (_invoke_status == TAO_INVOKE_EXCEPTION) + // cannot happen + if (_invoke_status != TAO_INVOKE_OK) + { + ACE_THROW (CORBA::UNKNOWN (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES)); + } + break; + + } + +} + +CORBA::Boolean AMI_Simple_Server_Handler::_is_a (const CORBA::Char *value, CORBA::Environment &env) +{ + if ( (!ACE_OS::strcmp ((char *)value, "IDL:AMI_Simple_Server_Handler:1.0")) || - (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/Messaging/ReplyHandler:1.0")) || - (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env)))) + (!ACE_OS::strcmp ((char *)value, "IDL:omg.org/Messaging/ReplyHandler:1.0")) || + (!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env)))) return 1; // success using local knowledge - else - return this->CORBA_Object::_is_a (value, env); - } + else + return this->CORBA_Object::_is_a (value, env); +} - const char* AMI_Simple_Server_Handler::_interface_repository_id (void) const - { - return "IDL:AMI_Simple_Server_Handler:1.0"; - } +const char* AMI_Simple_Server_Handler::_interface_repository_id (void) const +{ + return "IDL:AMI_Simple_Server_Handler:1.0"; +} - static const CORBA::Long _oc_AMI_Simple_Server_Handler[] = - { - TAO_ENCAP_BYTE_ORDER, // byte order - 34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x414d495f), ACE_NTOHL (0x53696d70), ACE_NTOHL (0x6c655f53), ACE_NTOHL (0x65727665), ACE_NTOHL (0x725f4861), ACE_NTOHL (0x6e646c65), ACE_NTOHL (0x723a312e), ACE_NTOHL (0x30000000), // repository ID = IDL:AMI_Simple_Server_Handler:1.0 - 26, ACE_NTOHL (0x414d495f), ACE_NTOHL (0x53696d70), ACE_NTOHL (0x6c655f53), ACE_NTOHL (0x65727665), ACE_NTOHL (0x725f4861), ACE_NTOHL (0x6e646c65), ACE_NTOHL (0x72000000), // name = AMI_Simple_Server_Handler +static const CORBA::Long _oc_AMI_Simple_Server_Handler[] = +{ + TAO_ENCAP_BYTE_ORDER, // byte order + 34, ACE_NTOHL (0x49444c3a), ACE_NTOHL (0x414d495f), ACE_NTOHL (0x53696d70), ACE_NTOHL (0x6c655f53), ACE_NTOHL (0x65727665), ACE_NTOHL (0x725f4861), ACE_NTOHL (0x6e646c65), ACE_NTOHL (0x723a312e), ACE_NTOHL (0x30000000), // repository ID = IDL:AMI_Simple_Server_Handler:1.0 + 26, ACE_NTOHL (0x414d495f), ACE_NTOHL (0x53696d70), ACE_NTOHL (0x6c655f53), ACE_NTOHL (0x65727665), ACE_NTOHL (0x725f4861), ACE_NTOHL (0x6e646c65), ACE_NTOHL (0x72000000), // name = AMI_Simple_Server_Handler }; - static CORBA::TypeCode _tc_TAO_tc_AMI_Simple_Server_Handler (CORBA::tk_objref, sizeof (_oc_AMI_Simple_Server_Handler), (char *) &_oc_AMI_Simple_Server_Handler, 0, sizeof (AMI_Simple_Server_Handler)); - CORBA::TypeCode_ptr _tc_AMI_Simple_Server_Handler = &_tc_TAO_tc_AMI_Simple_Server_Handler; +static CORBA::TypeCode _tc_TAO_tc_AMI_Simple_Server_Handler (CORBA::tk_objref, sizeof (_oc_AMI_Simple_Server_Handler), (char *) &_oc_AMI_Simple_Server_Handler, 0, sizeof (AMI_Simple_Server_Handler)); +CORBA::TypeCode_ptr _tc_AMI_Simple_Server_Handler = &_tc_TAO_tc_AMI_Simple_Server_Handler; - void operator<<= (CORBA::Any &_tao_any, Simple_Server_ptr _tao_elem) - { - CORBA::Object_ptr *_tao_obj_ptr = 0; - ACE_TRY_NEW_ENV - { - ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); - *_tao_obj_ptr = Simple_Server::_duplicate (_tao_elem); - _tao_any.replace (_tc_Simple_Server, _tao_obj_ptr, 1, ACE_TRY_ENV); - ACE_TRY_CHECK; - } - ACE_CATCHANY +class TAO_AMI_Simple_Server_Handler_Perfect_Hash_OpTable : public TAO_Perfect_Hash_OpTable +{ +private: + unsigned int hash (const char *str, unsigned int len); +public: + const TAO_operation_db_entry * lookup (const char *str, unsigned int len); +}; +/* starting time is 23:22:01 */ +/* C++ code produced by gperf version 2.8 (ACE version) */ +/* Command-line: /project/danzontmp/alex/ami_phase3/sun5_CC/bin/gperf -m -M -J -c -C -D -E -T -f 0 -F 0 -a -o -t -p -K opname_ -L C++ -Z TAO_AMI_Simple_Server_Handler_Perfect_Hash_OpTable -N lookup */ +unsigned int +TAO_AMI_Simple_Server_Handler_Perfect_Hash_OpTable::hash (const char *str, unsigned int len) +{ + static const unsigned char asso_values[] = { - delete _tao_obj_ptr; - } - ACE_ENDTRY; - } +#if defined (ACE_MVS) + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, + 15, 15, 15, 15, 15, 0, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, + 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 0, 0, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, +#else + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 0, 15, 0, 15, 15, + 15, 15, 15, 0, 15, 15, 15, 15, 15, 15, + 0, 15, 15, 15, 0, 0, 0, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, +#endif /* ACE_MVS */ + }; + return len + asso_values[str[len - 1]] + asso_values[str[0]]; +} - CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Simple_Server_ptr &_tao_elem) - { - CORBA::Object_ptr *tmp = 0; - ACE_TRY_NEW_ENV +const class TAO_operation_db_entry * +TAO_AMI_Simple_Server_Handler_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len) +{ + enum { - _tao_elem = Simple_Server::_nil (); - CORBA::TypeCode_var type = _tao_any.type (); - if (!type->equal (_tc_Simple_Server, ACE_TRY_ENV)) return 0; // not equal - ACE_TRY_CHECK; - TAO_InputCDR stream (_tao_any._tao_get_cdr ()); - CORBA::Object_var _tao_obj_var; - ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); - if (stream.decode (_tc_Simple_Server, &_tao_obj_var.out (), 0, ACE_TRY_ENV) - == CORBA::TypeCode::TRAVERSE_CONTINUE) - { - _tao_elem = Simple_Server::_narrow (_tao_obj_var.in (), ACE_TRY_ENV); - ACE_TRY_CHECK; - *tmp = (CORBA::Object_ptr) _tao_elem; // any owns the object - ((CORBA::Any *)&_tao_any)->replace (_tc_Simple_Server, tmp, 1, ACE_TRY_ENV); - ACE_TRY_CHECK; - return 1; - } - // failure + TOTAL_KEYWORDS = 4, + MIN_WORD_LENGTH = 5, + MAX_WORD_LENGTH = 14, + MIN_HASH_VALUE = 5, + MAX_HASH_VALUE = 14, + HASH_VALUE_RANGE = 10, + DUPLICATES = 0 + }; + + static const class TAO_operation_db_entry wordlist[] = + { + {"",0},{"",0},{"",0},{"",0},{"",0}, + {"_is_a", &POA_AMI_Simple_Server_Handler::_is_a_skel}, + {"",0},{"",0}, + {"shutdown", &POA_AMI_Simple_Server_Handler::shutdown_skel}, + {"",0},{"",0},{"",0},{"",0}, + {"_non_existent", &POA_AMI_Simple_Server_Handler::_non_existent_skel}, + {"get_put_number", &POA_AMI_Simple_Server_Handler::get_put_number_skel}, + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + unsigned int key = hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE) + { + const char *s = wordlist[key].opname_; + + if (*str == *s && !strncmp (str + 1, s + 1, len - 1)) + return &wordlist[key]; + } } - ACE_CATCHANY + return 0; +} +/* ending time is 23:22:01 */ +static TAO_AMI_Simple_Server_Handler_Perfect_Hash_OpTable tao_AMI_Simple_Server_Handler_optable; + +AMI_Simple_Server_Handler_ptr _TAO_collocation_POA_AMI_Simple_Server_Handler_Stub_Factory ( + CORBA::Object_ptr obj + ) +{ + TAO_Stub *stub = obj->_stubobj (); + + switch (stub->servant_orb_var ()->orb_core ()->get_collocation_strategy ()) { - delete tmp; - return 0; + case TAO_ORB_Core::THRU_POA: + return new _tao_thru_poa_collocated_AMI_Simple_Server_Handler (stub); + case TAO_ORB_Core::DIRECT: + break; + default: + break; } - ACE_ENDTRY; - return 0; - } + return 0; +} + +int _TAO_collocation_POA_AMI_Simple_Server_Handler_Stub_Factory_Initializer (long dummy) +{ + ACE_UNUSED_ARG (dummy); + + _TAO_collocation_AMI_Simple_Server_Handler_Stub_Factory_function_pointer = + _TAO_collocation_POA_AMI_Simple_Server_Handler_Stub_Factory; + + return 0; +} + +static int _TAO_collocation_POA_AMI_Simple_Server_Handler_Stub_Factory_Initializer_Scarecrow = + _TAO_collocation_POA_AMI_Simple_Server_Handler_Stub_Factory_Initializer (ACE_reinterpret_cast (long, _TAO_collocation_POA_AMI_Simple_Server_Handler_Stub_Factory_Initializer)); // skeleton constructor POA_AMI_Simple_Server_Handler::POA_AMI_Simple_Server_Handler (void) { + this->optable_ = &tao_AMI_Simple_Server_Handler_optable; } // copy ctor @@ -400,8 +577,75 @@ POA_AMI_Simple_Server_Handler::~POA_AMI_Simple_Server_Handler (void) { } +void POA_AMI_Simple_Server_Handler::get_put_number ( + CORBA::Long _tao_retval, + CORBA::Long out_l, + CORBA::Environment &ACE_TRY_ENV + ) + ACE_THROW_SPEC ((CORBA::SystemException)) + +{ + ACE_DEBUG ((LM_DEBUG, + "(%P | %t):POA_AMI_Simple_Server_Handler\n")); + +} + +void POA_AMI_Simple_Server_Handler::get_put_number_skel ( + CORBA::ServerRequest &_tao_server_request, + void *_tao_object_reference, + void * /* context */, + CORBA::Environment &ACE_TRY_ENV +) +{ + TAO_InputCDR &_tao_in = _tao_server_request.incoming (); + POA_AMI_Simple_Server_Handler *_tao_impl = (POA_AMI_Simple_Server_Handler *)_tao_object_reference; + + CORBA::Long _tao_retval = 0; + CORBA::Long out_l; + if (!( + (_tao_in >> _tao_retval) && + (_tao_in >> out_l) + )) + ACE_THROW (CORBA::MARSHAL () ); + + _tao_impl->get_put_number ( + _tao_retval, + out_l, + ACE_TRY_ENV + ); + ACE_CHECK; +_tao_server_request.init_reply (ACE_TRY_ENV); +} + +void POA_AMI_Simple_Server_Handler::shutdown ( + CORBA::Environment &ACE_TRY_ENV + ) + ACE_THROW_SPEC ((CORBA::SystemException)) + +{ + ACE_DEBUG ((LM_DEBUG, + "(%P | %t):POA_AMI_Simple_Server_Handler\n")); + +} + +void POA_AMI_Simple_Server_Handler::shutdown_skel ( + CORBA::ServerRequest &_tao_server_request, + void *_tao_object_reference, + void * /* context */, + CORBA::Environment &ACE_TRY_ENV +) +{ + POA_AMI_Simple_Server_Handler *_tao_impl = (POA_AMI_Simple_Server_Handler *)_tao_object_reference; + + _tao_impl->shutdown ( + ACE_TRY_ENV + ); + ACE_CHECK; +_tao_server_request.init_reply (ACE_TRY_ENV); +} + void POA_AMI_Simple_Server_Handler::_is_a_skel ( - CORBA::ServerRequest &_tao_server_request, + CORBA::ServerRequest &_tao_server_request, void * _tao_object_reference, void * /* context */, CORBA::Environment &ACE_TRY_ENV @@ -413,10 +657,10 @@ void POA_AMI_Simple_Server_Handler::_is_a_skel ( CORBA::String_var value; if (!((_tao_in >> value.out ()))) ACE_THROW (CORBA::MARSHAL ()); - + _tao_retval = _tao_impl->_is_a (value.in (), ACE_TRY_ENV); ACE_CHECK; - + _tao_server_request.init_reply (ACE_TRY_ENV); ACE_CHECK; TAO_OutputCDR &_tao_out = _tao_server_request.outgoing (); @@ -425,7 +669,7 @@ void POA_AMI_Simple_Server_Handler::_is_a_skel ( } void POA_AMI_Simple_Server_Handler::_non_existent_skel ( - CORBA::ServerRequest &_tao_server_request, + CORBA::ServerRequest &_tao_server_request, void * _tao_object_reference, void * /* context */, CORBA::Environment &ACE_TRY_ENV @@ -434,7 +678,7 @@ void POA_AMI_Simple_Server_Handler::_non_existent_skel ( POA_AMI_Simple_Server_Handler *_tao_impl = (POA_AMI_Simple_Server_Handler *) _tao_object_reference; CORBA::Boolean _tao_retval = _tao_impl->_non_existent (ACE_TRY_ENV); ACE_CHECK; - + _tao_server_request.init_reply (ACE_TRY_ENV); ACE_CHECK; TAO_OutputCDR &_tao_out = _tao_server_request.outgoing (); @@ -459,9 +703,9 @@ void* POA_AMI_Simple_Server_Handler::_downcast ( const char* logical_type_id ) { - if (ACE_OS::strcmp (logical_type_id, "IDL:AMI_Simple_Server_Handler:1.0") == 0) +if (ACE_OS::strcmp (logical_type_id, "IDL:AMI_Simple_Server_Handler:1.0") == 0) return ACE_static_cast (POA_AMI_Simple_Server_Handler_ptr, this); - if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0") == 0) + if (ACE_OS::strcmp (logical_type_id, "IDL:omg.org/CORBA/Object:1.0") == 0) return ACE_static_cast(PortableServer::Servant, this); return 0; } @@ -485,161 +729,195 @@ const char* POA_AMI_Simple_Server_Handler::_interface_repository_id (void) const return "IDL:AMI_Simple_Server_Handler:1.0"; } - AMI_Simple_Server_Handler* POA_AMI_Simple_Server_Handler::_this (CORBA_Environment &ACE_TRY_ENV) { TAO_Stub *stub = this->_create_stub (ACE_TRY_ENV); ACE_CHECK_RETURN (0); - return new _tao_collocated_AMI_Simple_Server_Handler (this, stub); + switch (stub->servant_orb_var ()->orb_core ()->get_collocation_strategy ()) + { + case TAO_ORB_Core::THRU_POA: + return new _tao_thru_poa_collocated_AMI_Simple_Server_Handler (stub); + case TAO_ORB_Core::DIRECT: + ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0); + default: + ACE_THROW_RETURN (CORBA::BAD_PARAM (), 0); + } } -void* -POA_AMI_Simple_Server_Handler::_create_collocated_objref (const char* repository_id, CORBA::ULong type, TAO_Stub *stub) +_tao_thru_poa_collocated_AMI_Simple_Server_Handler::_tao_thru_poa_collocated_AMI_Simple_Server_Handler ( + TAO_Stub *stub +) + : AMI_Simple_Server_Handler (), + CORBA_Object (stub, 0, 1) { - if (!ACE_OS::strcmp ("IDL:AMI_Simple_Server_Handler:1.0", repository_id)) - return ACE_static_cast ( - AMI_Simple_Server_Handler_ptr, - new _tao_collocated_AMI_Simple_Server_Handler (this, stub) - ); - return 0; } -void -POA_AMI_Simple_Server_Handler::get_number (CORBA::Long l, CORBA::Environment &) -{ - ACE_DEBUG ((LM_DEBUG, - "(%P | %t):POA_AMI_Simple_Server_Handler::get_number = %d\n", - l)); -} +CORBA::Boolean _tao_thru_poa_collocated_AMI_Simple_Server_Handler::_is_a( + const CORBA::Char *logical_type_id, + CORBA_Environment &ACE_TRY_ENV + ) -void -POA_AMI_Simple_Server_Handler::get_number_skel (CORBA::ServerRequest &_tao_server_request, - void *_tao_object_reference, - void *_tao_context, - CORBA::Environment &ACE_TRY_ENV) { - TAO_InputCDR &_tao_in = _tao_server_request.incoming (); - POA_AMI_Simple_Server_Handler *_tao_impl = (POA_AMI_Simple_Server_Handler *)_tao_object_reference; - - CORBA::Long l; - if (!( - (_tao_in >> l) - )) - ACE_THROW (CORBA::MARSHAL () ); - - _tao_impl->get_number ( - l); - ACE_CHECK; - _tao_server_request.init_reply (ACE_TRY_ENV); + TAO_Object_Adapter::Servant_Upcall servant_upcall ( + *this->_stubobj ()->servant_orb_var ()->orb_core ()->object_adapter () + ); + servant_upcall.prepare_for_upcall ( + this->_object_key (), + "_is_a", + ACE_TRY_ENV + ); + ACE_CHECK_RETURN (0); + return ACE_reinterpret_cast ( + POA_AMI_Simple_Server_Handler_ptr, + servant_upcall.servant ()->_downcast ( + "IDL:AMI_Simple_Server_Handler:1.0" + ) + )->_is_a (logical_type_id, ACE_TRY_ENV); } -// ********************************************************************* -_tao_collocated_AMI_Simple_Server_Handler::_tao_collocated_AMI_Simple_Server_Handler ( - POA_AMI_Simple_Server_Handler_ptr servant, - TAO_Stub *stub +CORBA::Boolean _tao_thru_poa_collocated_AMI_Simple_Server_Handler::_non_existent( + CORBA_Environment &ACE_TRY_ENV ) - : AMI_Simple_Server_Handler (), - CORBA_Object (stub, servant, 1), - servant_ (servant) + { + TAO_Object_Adapter::Servant_Upcall servant_upcall ( + *this->_stubobj ()->servant_orb_var ()->orb_core ()->object_adapter () + ); + servant_upcall.prepare_for_upcall ( + this->_object_key (), + "_non_existent", + ACE_TRY_ENV + ); + ACE_CHECK_RETURN (0); + return ACE_reinterpret_cast ( + POA_AMI_Simple_Server_Handler_ptr, + servant_upcall.servant ()->_downcast ( + "IDL:AMI_Simple_Server_Handler:1.0" + ) + )->_non_existent (ACE_TRY_ENV); } -CORBA::Boolean _tao_collocated_AMI_Simple_Server_Handler::_is_a( - const CORBA::Char *logical_type_id, - CORBA_Environment &ACE_TRY_ENV + +void _tao_thru_poa_collocated_AMI_Simple_Server_Handler::get_put_number ( + CORBA::Long _tao_retval, + CORBA::Long out_l, + CORBA::Environment &ACE_TRY_ENV ) + ACE_THROW_SPEC ((CORBA::SystemException)) { - if (this->_stubobj ()->orb_core ()->get_collocation_strategy () == TAO_ORB_Core::THRU_POA) - { - TAO_Object_Adapter::Servant_Upcall servant_upcall ( - *this->_stubobj ()->servant_orb_var ()->orb_core ()->object_adapter () - ); - servant_upcall.prepare_for_upcall ( - this->_object_key (), - "_is_a", - ACE_TRY_ENV - ); - ACE_CHECK_RETURN (0); - return ACE_reinterpret_cast ( - POA_AMI_Simple_Server_Handler_ptr, - servant_upcall.servant ()->_downcast ( - "IDL:AMI_Simple_Server_Handler:1.0" - ) - )->_is_a (logical_type_id, ACE_TRY_ENV); - } - return this->servant_->_is_a (logical_type_id, ACE_TRY_ENV); + TAO_Object_Adapter::Servant_Upcall servant_upcall ( + *this->_stubobj ()->servant_orb_var ()->orb_core ()->object_adapter () + ); + servant_upcall.prepare_for_upcall ( + this->_object_key (), + "get_put_number", + ACE_TRY_ENV + ); + ACE_CHECK; + ACE_reinterpret_cast ( + POA_AMI_Simple_Server_Handler_ptr, + servant_upcall.servant ()->_downcast ( + "IDL:AMI_Simple_Server_Handler:1.0" + ) + )->get_put_number ( + _tao_retval, + out_l, + ACE_TRY_ENV + ); + return; } +void _tao_thru_poa_collocated_AMI_Simple_Server_Handler::shutdown ( + CORBA::Environment &ACE_TRY_ENV + ) + ACE_THROW_SPEC ((CORBA::SystemException)) -POA_AMI_Simple_Server_Handler_ptr _tao_collocated_AMI_Simple_Server_Handler::_get_servant (void) const { - return this->servant_; + TAO_Object_Adapter::Servant_Upcall servant_upcall ( + *this->_stubobj ()->servant_orb_var ()->orb_core ()->object_adapter () + ); + servant_upcall.prepare_for_upcall ( + this->_object_key (), + "shutdown", + ACE_TRY_ENV + ); + ACE_CHECK; + ACE_reinterpret_cast ( + POA_AMI_Simple_Server_Handler_ptr, + servant_upcall.servant ()->_downcast ( + "IDL:AMI_Simple_Server_Handler:1.0" + ) + )->shutdown ( + ACE_TRY_ENV + ); + return; } -CORBA::Boolean _tao_collocated_AMI_Simple_Server_Handler::_non_existent( - CORBA_Environment &ACE_TRY_ENV - ) + +Simple_Server_ptr (*_TAO_collocation_Simple_Server_Stub_Factory_function_pointer) ( + CORBA::Object_ptr obj + ) = 0; +AMI_Simple_Server_Handler_ptr (*_TAO_collocation_AMI_Simple_Server_Handler_Stub_Factory_function_pointer) ( + CORBA::Object_ptr obj + ) = 0; +void operator<<= (CORBA::Any &_tao_any, Simple_Server_ptr _tao_elem) { - if (this->_stubobj ()->orb_core ()->get_collocation_strategy () == TAO_ORB_Core::THRU_POA) - { - TAO_Object_Adapter::Servant_Upcall servant_upcall ( - *this->_stubobj ()->servant_orb_var ()->orb_core ()->object_adapter () - ); - servant_upcall.prepare_for_upcall ( - this->_object_key (), - "_non_existent", - ACE_TRY_ENV - ); - ACE_CHECK_RETURN (0); - return ACE_reinterpret_cast ( - POA_AMI_Simple_Server_Handler_ptr, - servant_upcall.servant ()->_downcast ( - "IDL:AMI_Simple_Server_Handler:1.0" - ) - )->_non_existent (ACE_TRY_ENV); - } - return this->servant_->_non_existent (ACE_TRY_ENV); + CORBA::Object_ptr *_tao_obj_ptr = 0; + ACE_TRY_NEW_ENV + { + ACE_NEW (_tao_obj_ptr, CORBA::Object_ptr); + *_tao_obj_ptr = Simple_Server::_duplicate (_tao_elem); + _tao_any.replace (_tc_Simple_Server, _tao_obj_ptr, 1, ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + delete _tao_obj_ptr; + } + ACE_ENDTRY; } -void -_tao_collocated_AMI_Simple_Server_Handler::get_number (CORBA::Long l, CORBA::Environment &) +CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, Simple_Server_ptr &_tao_elem) { - ACE_DECLARE_NEW_CORBA_ENV; - - if (this->_stubobj ()->orb_core ()->get_collocation_strategy () == TAO_ORB_Core::THRU_POA) + CORBA::Object_ptr *tmp = 0; + ACE_TRY_NEW_ENV + { + _tao_elem = Simple_Server::_nil (); + CORBA::TypeCode_var type = _tao_any.type (); + if (!type->equal (_tc_Simple_Server, ACE_TRY_ENV)) return 0; // not equal + ACE_TRY_CHECK; + TAO_InputCDR stream (_tao_any._tao_get_cdr ()); + CORBA::Object_var _tao_obj_var; + ACE_NEW_RETURN (tmp, CORBA::Object_ptr, 0); + if (stream.decode (_tc_Simple_Server, &_tao_obj_var.out (), 0, ACE_TRY_ENV) + == CORBA::TypeCode::TRAVERSE_CONTINUE) { - TAO_Object_Adapter::Servant_Upcall servant_upcall ( - *this->_stubobj ()->servant_orb_var ()->orb_core ()->object_adapter () - ); - servant_upcall.prepare_for_upcall ( - this->_object_key (), - "get_number", - ACE_TRY_ENV - ); - ACE_CHECK; - ACE_reinterpret_cast ( - POA_AMI_Simple_Server_Handler_ptr, - servant_upcall.servant ()->_downcast ( - "IDL:AMI_Simple_Server_Handler:1.0" - ) - )->get_number ( - l); - return; + _tao_elem = Simple_Server::_narrow (_tao_obj_var.in (), ACE_TRY_ENV); + ACE_TRY_CHECK; + *tmp = (CORBA::Object_ptr) _tao_elem; // any owns the object + ((CORBA::Any *)&_tao_any)->replace (_tc_Simple_Server, tmp, 1, ACE_TRY_ENV); + ACE_TRY_CHECK; + return 1; } - this->servant_->get_number ( - l ); - + // failure + } + ACE_CATCHANY + { + delete tmp; + return 0; + } + ACE_ENDTRY; + return 0; } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) - template class TAO_Object_Field_T<Simple_Server>; - template class TAO_Object_Field_T<AMI_Simple_Server_Handler>; - #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) - # pragma instantiate TAO_Object_Field_T<Simple_Server> - # pragma instantiate TAO_Object_Field_T<AMI_Simple_Server_Handler> - #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - + template class TAO_Object_Field_T<Simple_Server,Simple_Server_var>; +template class TAO_Object_Manager<Simple_Server,Simple_Server_var>; +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +# pragma instantiate TAO_Object_Field_T<Simple_Server,Simple_Server_var> +# pragma instantiate TAO_Object_Manager<Simple_Server,Simple_Server_var> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tests/AMI/test.idl b/TAO/tests/AMI/test.idl index 376da4a58c6..8fa715984b1 100644 --- a/TAO/tests/AMI/test.idl +++ b/TAO/tests/AMI/test.idl @@ -4,13 +4,9 @@ interface Simple_Server { - // void test_method (); - - long get_number (); - - // void put_number (in long l); - - // long get_put_number (out long out_l, in long in_l); - - // oneway void shutdown (); + long get_put_number (out long out_l, in long in_l); + // Get the number as the return value as well as the out value and + // also puts the value. + + oneway void shutdown (); }; diff --git a/TAO/tests/AMI/test_i.h b/TAO/tests/AMI/test_i.h index c050a2795d8..b6567cec81e 100644 --- a/TAO/tests/AMI/test_i.h +++ b/TAO/tests/AMI/test_i.h @@ -31,21 +31,11 @@ public: // ctor // = The Simple_Server methods. - void test_method (CORBA::Environment&) - ACE_THROW_SPEC ((CORBA::SystemException)); - - CORBA::Long get_number (CORBA::Environment&) - ACE_THROW_SPEC ((CORBA::SystemException)); - - void put_number (CORBA::Long l, - CORBA::Environment &) - ACE_THROW_SPEC ((CORBA::SystemException)); - CORBA::Long get_put_number (CORBA::Long_out out_l, CORBA::Long in_l, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)); - + void shutdown (CORBA::Environment&) ACE_THROW_SPEC ((CORBA::SystemException)); diff --git a/TAO/tests/MT_Client/client_muxed.conf b/TAO/tests/MT_Client/client_muxed.conf new file mode 100644 index 00000000000..05145bd0896 --- /dev/null +++ b/TAO/tests/MT_Client/client_muxed.conf @@ -0,0 +1,3 @@ +# $Id$ + +static Client_Strategy_Factory "-ORBProfileLock null -ORBClientConnectionHandler MT -ORBTransportMuxStrategy MUXED" diff --git a/TAO/tests/MT_Client/simple-client.conf b/TAO/tests/MT_Client/simple-client.conf new file mode 100644 index 00000000000..ed5a9b0379e --- /dev/null +++ b/TAO/tests/MT_Client/simple-client.conf @@ -0,0 +1,3 @@ +# $Id$ + +static Client_Strategy_Factory "-ORBProfileLock null -ORBClientConnectionHandler ST" diff --git a/TAO/tests/NestedUpcall/Simple/client.cpp b/TAO/tests/NestedUpcall/Simple/client.cpp index 5cdfba0d2bf..b7ef73c460a 100644 --- a/TAO/tests/NestedUpcall/Simple/client.cpp +++ b/TAO/tests/NestedUpcall/Simple/client.cpp @@ -21,7 +21,7 @@ static int quiet = 0; static int number_of_threads = 1; // Number of client threads. -class Client_Task : public ACE_Task_Base +class Client_Task { public: Client_Task (client_ptr c, @@ -169,17 +169,8 @@ main (int argc, Client_Task client_tasks (client_object.in (), server.in ()); - - result = client_tasks.activate (THR_BOUND, - number_of_threads); - - if (result != 0) - return result; - - result = ACE_Thread_Manager::instance ()->wait (); - - if (result != 0) - return result; + + client_tasks.svc (); if (shutdown_server) { diff --git a/TAO/tests/NestedUpcall/Simple/simple-client.cpp b/TAO/tests/NestedUpcall/Simple/simple-client.cpp new file mode 100644 index 00000000000..8cfa5b34760 --- /dev/null +++ b/TAO/tests/NestedUpcall/Simple/simple-client.cpp @@ -0,0 +1,195 @@ +// $Id$ + +#include "client_i.h" +#include "ace/Get_Opt.h" +#include "ace/Task.h" + +ACE_RCSID(Simple, client, "$Id$") + +static const char *ior = "file://test.ior"; +// Server IOR. + +static int shutdown_server = 0; +// Flag to tell server to shutdown. + +static CORBA::UShort call_count = 5; +// # of nested calls to be made. + +static int quiet = 0; +// The test is quiet... + +static int number_of_threads = 1; +// Number of client threads. + +class Client_Task +{ +public: + Client_Task (client_ptr c, + server_ptr s); + int svc (void); + +private: + client_var client_; + server_var server_; +}; + +Client_Task::Client_Task (client_ptr c, + server_ptr s) + : client_ (client::_duplicate (c)), + server_ (server::_duplicate (s)) +{ +} + +int +Client_Task::svc (void) +{ + ACE_TRY_NEW_ENV + { + if (!quiet) + ACE_DEBUG ((LM_DEBUG, + "(%t) Client_Task::svc calling start -> time to live = %d\n", + call_count)); + + // Now, we can invoke an operation on the remote side. + this->server_->start (this->client_.in (), + call_count, + ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Client_Task::svc"); + return -1; + } + ACE_ENDTRY; + return 0; +} + +static int +parse_args (int argc, + char **argv) +{ + ACE_Get_Opt get_opts (argc, argv, "qxn:k:t:"); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'q': + quiet = 1; + break; + + case 'x': + shutdown_server = 1; + break; + + case 'n': + call_count = ACE_OS::atoi (get_opts.optarg); + break; + + case 't': + number_of_threads = ACE_OS::atoi (get_opts.optarg); + break; + + case 'k': + ior = get_opts.optarg; + break; + + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s" + " [-n number of nested calls]" + " [-k ior]" + " [-q (quite)]" + " [-x (shutdown server)]" + "\n", + argv[0]), + -1); + } + + if (ior == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "%s: no nested up calls server ior specified\n", + argv[0]), + -1); + + // Indicates successful parsing of command line. + return 0; +} + +int +main (int argc, + char **argv) +{ + ACE_TRY_NEW_ENV + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, + argv, + 0, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + int result = parse_args (argc, + argv); + if (result != 0) + return result; + + CORBA::Object_var object = orb->resolve_initial_references ("RootPOA", + ACE_TRY_ENV); + ACE_TRY_CHECK; + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (object.in (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (ACE_TRY_ENV); + ACE_TRY_CHECK; + + poa_manager->activate (ACE_TRY_ENV); + ACE_TRY_CHECK; + + object = orb->string_to_object (ior, + ACE_TRY_ENV); + ACE_TRY_CHECK; + + server_var server = server::_narrow (object.in (), + ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Create an client object to hand to the other side... + client_i client_servant (quiet, + server.in ()); + + client_var client_object = client_servant._this (ACE_TRY_ENV); + ACE_TRY_CHECK; + + Client_Task client_tasks (client_object.in (), + server.in ()); + + client_tasks.svc (); + + + if (shutdown_server) + { + server->shutdown (ACE_TRY_ENV); + ACE_TRY_CHECK; + } + + root_poa->destroy (1, + 1, + ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "client::main"); + return -1; + } + ACE_ENDTRY; + return 0; +} |