From c12ae5091e44b9144a46457ffb3e0d18bcaaceff Mon Sep 17 00:00:00 2001 From: mk1 Date: Mon, 5 Jul 1999 23:06:22 +0000 Subject: Added Handler Skeleton Code Generation --- TAO/TAO_IDL/be/be_visitor_argument.cpp | 4 + .../be_visitor_argument/ami_handler_result_arg.cpp | 28 +- .../be/be_visitor_argument/compiled_marshal_cs.cpp | 465 ++++++--------------- .../be/be_visitor_argument/compiled_marshal_ss.cpp | 8 +- TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp | 54 --- TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp | 84 ---- TAO/TAO_IDL/be/be_visitor_factory.cpp | 60 ++- TAO/TAO_IDL/be/be_visitor_operation.cpp | 3 + .../be_visitor_operation/ami_handler_arglist.cpp | 12 +- .../ami_handler_operation_cs.cpp | 50 ++- .../ami_handler_skeleton_cs.cpp | 346 ++++----------- TAO/TAO_IDL/be/be_visitor_operation/argument.cpp | 37 +- .../be/be_visitor_operation/compiled_marshal.cpp | 3 +- .../be/be_visitor_operation/rettype_vardecl_cs.cpp | 125 ++---- .../be/be_visitor_operation/rettype_vardecl_ss.cpp | 20 +- TAO/TAO_IDL/be_include/be_codegen.h | 14 +- TAO/TAO_IDL/be_include/be_visitor_argument.h | 4 + TAO/TAO_IDL/be_include/be_visitor_operation.h | 2 + 18 files changed, 395 insertions(+), 924 deletions(-) diff --git a/TAO/TAO_IDL/be/be_visitor_argument.cpp b/TAO/TAO_IDL/be/be_visitor_argument.cpp index a7633cdaa07..b6c726568ba 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument.cpp @@ -41,5 +41,9 @@ #include "be_visitor_argument/ami_arglist.cpp" #include "be_visitor_argument/ami_handler_arglist.cpp" #include "be_visitor_argument/ami_handler_result_arg.cpp" +#include "be_visitor_argument/ami_handler_compiled_marshal_cs.cpp" +#include "be_visitor_argument/ami_handler_upcall_cs.cpp" +#include "be_visitor_argument/ami_handler_vardecl_cs.cpp" + ACE_RCSID(be, be_visitor_argument, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_result_arg.cpp b/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_result_arg.cpp index 32d02a5f433..b17196a86dd 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_result_arg.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/ami_handler_result_arg.cpp @@ -45,7 +45,7 @@ int be_visitor_args_ami_handler_result_arg::visit_array (be_array *node) { TAO_OutStream *os = this->ctx_->stream (); // get output stream - *os << "const " << this->type_name (node) << " _tao_ami_result, "; + *os << "const " << this->type_name (node) << " _tao_retval, "; return 1; } @@ -53,7 +53,7 @@ int be_visitor_args_ami_handler_result_arg::visit_enum (be_enum *node) { TAO_OutStream *os = this->ctx_->stream (); // get output stream - *os << this->type_name (node) << " _tao_ami_result"; + *os << this->type_name (node) << " _tao_retval"; return 1; } @@ -61,7 +61,7 @@ int be_visitor_args_ami_handler_result_arg::visit_interface (be_interface *node) { TAO_OutStream *os = this->ctx_->stream (); // get output stream - *os << this->type_name (node, "_ptr") << " _tao_ami_result"; + *os << this->type_name (node, "_ptr") << " _tao_retval"; return 1; } @@ -69,7 +69,7 @@ int be_visitor_args_ami_handler_result_arg::visit_interface_fwd (be_interface_fwd *node) { TAO_OutStream *os = this->ctx_->stream (); // get output stream - *os << this->type_name (node, "_ptr") << " _tao_ami_result"; + *os << this->type_name (node, "_ptr") << " _tao_retval"; return 1; } @@ -77,7 +77,7 @@ int be_visitor_args_ami_handler_result_arg::visit_native (be_native *node) { TAO_OutStream *os = this->ctx_->stream (); // get output stream - *os << this->type_name (node) << " _tao_ami_result"; + *os << this->type_name (node) << " _tao_retval"; return 1; } @@ -95,15 +95,15 @@ be_visitor_args_ami_handler_result_arg::visit_predefined_type (be_predefined_typ // Check if the type is an any. if (node->pt () == AST_PredefinedType::PT_any) { - *os << "const " << this->type_name (node) << " &" << " _tao_ami_result"; + *os << "const " << this->type_name (node) << " &" << " _tao_retval"; } else if (node->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object { - *os << this->type_name (node, "_ptr") << " _tao_ami_result"; + *os << this->type_name (node, "_ptr") << " _tao_retval"; } else { - *os << this->type_name (node) << " _tao_ami_result"; + *os << this->type_name (node) << " _tao_retval"; } return 1; @@ -113,7 +113,7 @@ int be_visitor_args_ami_handler_result_arg::visit_sequence (be_sequence *node) { TAO_OutStream *os = this->ctx_->stream (); // get the stream - *os << "const " << this->type_name (node) << " &" << " _tao_ami_result"; + *os << "const " << this->type_name (node) << " &" << " _tao_retval"; return 1; } @@ -121,7 +121,7 @@ int be_visitor_args_ami_handler_result_arg::visit_string (be_string *) { TAO_OutStream *os = this->ctx_->stream (); // get the stream - *os << "const char *" << " _tao_ami_result"; + *os << "const char *" << " _tao_retval"; return 1; } @@ -129,7 +129,7 @@ int be_visitor_args_ami_handler_result_arg::visit_structure (be_structure *node) { TAO_OutStream *os = this->ctx_->stream (); // get the stream - *os << "const " << this->type_name (node) << " &" << " _tao_ami_result"; + *os << "const " << this->type_name (node) << " &" << " _tao_retval"; return 1; } @@ -137,7 +137,7 @@ int be_visitor_args_ami_handler_result_arg::visit_union (be_union *node) { TAO_OutStream *os = this->ctx_->stream (); // get the stream - *os << "const " << this->type_name (node) << " &" << " _tao_ami_result"; + *os << "const " << this->type_name (node) << " &" << " _tao_retval"; return 1; } @@ -164,7 +164,7 @@ int be_visitor_args_ami_handler_result_arg::visit_valuetype (be_valuetype *node) { TAO_OutStream *os = this->ctx_->stream (); // get the stream - *os << this->type_name (node) << " *" << " _tao_ami_result"; + *os << this->type_name (node) << " *" << " _tao_retval"; return 1; } @@ -172,7 +172,7 @@ int be_visitor_args_ami_handler_result_arg::visit_valuetype_fwd (be_valuetype_fwd *node) { TAO_OutStream *os = this->ctx_->stream (); // get the stream - *os << "const " << this->type_name (node) << " *" << " _tao_ami_result"; + *os << "const " << this->type_name (node) << " *" << " _tao_retval"; return 1; } diff --git a/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_cs.cpp b/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_cs.cpp index 0ba6ecc052f..18cae73c4c9 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_cs.cpp @@ -60,33 +60,18 @@ int be_visitor_args_compiled_marshal_cs::visit_argument (be_argument *node) TAO_OutStream *os = this->ctx_->stream (); // get output stream + os->indent (); + if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - os->indent (); - *os << "(_tao_out << "; - break; - } - } - else + switch (this->direction ()) { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - os->indent (); - *os << "(_tao_out << "; - break; - case AST_Argument::dir_OUT: - break; - } + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + *os << "(_tao_out << "; + break; + case AST_Argument::dir_OUT: + break; } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -97,7 +82,6 @@ int be_visitor_args_compiled_marshal_cs::visit_argument (be_argument *node) break; case AST_Argument::dir_INOUT: case AST_Argument::dir_OUT: - os->indent (); *os << "(_tao_in >> "; break; } @@ -122,29 +106,14 @@ int be_visitor_args_compiled_marshal_cs::visit_argument (be_argument *node) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << ")"; - break; - } - } - else + switch (this->direction ()) { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << ")"; - break; - case AST_Argument::dir_OUT: - break; - } + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + *os << ")"; + break; + case AST_Argument::dir_OUT: + break; } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -179,36 +148,19 @@ int be_visitor_args_compiled_marshal_cs::visit_array (be_array *node) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << node->name () << "_forany (" - << "(" << node->name () << "_slice *)" - << arg->local_name () << ")"; - break; - } - } - else + switch (this->direction ()) { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - *os << node->name () << "_forany (" - << "(" << node->name () << "_slice *)" - << arg->local_name () << ")"; - break; - case AST_Argument::dir_INOUT: - *os << node->name () << "_forany (" - << arg->local_name () << ")"; + case AST_Argument::dir_IN: + *os << node->name () << "_forany (" + << "(" << node->name () << "_slice *)" + << arg->local_name () << ")"; + break; + case AST_Argument::dir_INOUT: + *os << node->name () << "_forany (" + << arg->local_name () << ")"; + break; + case AST_Argument::dir_OUT: break; - case AST_Argument::dir_OUT: - break; - } } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -251,29 +203,14 @@ int be_visitor_args_compiled_marshal_cs::visit_enum (be_enum *) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name (); - break; - } - } - else + switch (this->direction ()) { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + *os << arg->local_name (); + break; + case AST_Argument::dir_OUT: + break; } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -307,30 +244,15 @@ int be_visitor_args_compiled_marshal_cs::visit_interface (be_interface *) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) + switch (this->direction ()) { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name (); - break; - } + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + *os << arg->local_name (); + break; + case AST_Argument::dir_OUT: + break; } - else - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } - } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -365,29 +287,14 @@ int be_visitor_args_compiled_marshal_cs::visit_interface_fwd (be_interface_fwd * if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name (); - break; - } - } - else + switch (this->direction ()) { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + *os << arg->local_name (); + break; + case AST_Argument::dir_OUT: + break; } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -425,29 +332,14 @@ int be_visitor_args_compiled_marshal_cs::visit_valuetype (be_valuetype *) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name (); - break; - } - } - else + switch (this->direction ()) { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + *os << arg->local_name (); + break; + case AST_Argument::dir_OUT: + break; } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -484,29 +376,14 @@ be_visitor_args_compiled_marshal_cs::visit_valuetype_fwd (be_valuetype_fwd *) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name (); - break; - } - } - else + switch (this->direction ()) { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + *os << arg->local_name (); + break; + case AST_Argument::dir_OUT: + break; } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -543,96 +420,47 @@ int be_visitor_args_compiled_marshal_cs::visit_predefined_type (be_predefined_ty if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) + switch (this->direction ()) { - switch (this->direction ()) + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + switch (node->pt ()) { - case AST_Argument::dir_IN: + case AST_PredefinedType::PT_pseudo: + case AST_PredefinedType::PT_any: + case AST_PredefinedType::PT_long: + case AST_PredefinedType::PT_ulong: + case AST_PredefinedType::PT_longlong: + case AST_PredefinedType::PT_ulonglong: + case AST_PredefinedType::PT_short: + case AST_PredefinedType::PT_ushort: + case AST_PredefinedType::PT_float: + case AST_PredefinedType::PT_double: + case AST_PredefinedType::PT_longdouble: + *os << arg->local_name (); break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - switch (node->pt ()) - { - case AST_PredefinedType::PT_pseudo: - case AST_PredefinedType::PT_any: - case AST_PredefinedType::PT_long: - case AST_PredefinedType::PT_ulong: - case AST_PredefinedType::PT_longlong: - case AST_PredefinedType::PT_ulonglong: - case AST_PredefinedType::PT_short: - case AST_PredefinedType::PT_ushort: - case AST_PredefinedType::PT_float: - case AST_PredefinedType::PT_double: - case AST_PredefinedType::PT_longdouble: - *os << arg->local_name (); - break; - case AST_PredefinedType::PT_char: - *os << "CORBA::Any::from_char (" << arg->local_name () << ")"; - break; - case AST_PredefinedType::PT_wchar: - *os << "CORBA::Any::from_wchar (" << arg->local_name () << ")"; - break; - case AST_PredefinedType::PT_boolean: - *os << "CORBA::Any::from_boolean (" << arg->local_name () << ")"; - break; - case AST_PredefinedType::PT_octet: - *os << "CORBA::Any::from_octet (" << arg->local_name () << ")"; - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_compiled_marshal_cs::" - "visit_predefined_type - " - "Bad predefined type\n"), - -1); - } + case AST_PredefinedType::PT_char: + *os << "CORBA::Any::from_char (" << arg->local_name () << ")"; break; - } - } - else - { - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - switch (node->pt ()) - { - case AST_PredefinedType::PT_pseudo: - case AST_PredefinedType::PT_any: - case AST_PredefinedType::PT_long: - case AST_PredefinedType::PT_ulong: - case AST_PredefinedType::PT_longlong: - case AST_PredefinedType::PT_ulonglong: - case AST_PredefinedType::PT_short: - case AST_PredefinedType::PT_ushort: - case AST_PredefinedType::PT_float: - case AST_PredefinedType::PT_double: - case AST_PredefinedType::PT_longdouble: - *os << arg->local_name (); - break; - case AST_PredefinedType::PT_char: - *os << "CORBA::Any::from_char (" << arg->local_name () << ")"; - break; - case AST_PredefinedType::PT_wchar: - *os << "CORBA::Any::from_wchar (" << arg->local_name () << ")"; - break; - case AST_PredefinedType::PT_boolean: - *os << "CORBA::Any::from_boolean (" << arg->local_name () << ")"; - break; - case AST_PredefinedType::PT_octet: - *os << "CORBA::Any::from_octet (" << arg->local_name () << ")"; - break; - default: - ACE_ERROR_RETURN ((LM_ERROR, - "be_visitor_args_compiled_marshal_cs::" - "visit_predefined_type - " - "Bad predefined type\n"), - -1); - } + case AST_PredefinedType::PT_wchar: + *os << "CORBA::Any::from_wchar (" << arg->local_name () << ")"; break; - case AST_Argument::dir_OUT: + case AST_PredefinedType::PT_boolean: + *os << "CORBA::Any::from_boolean (" << arg->local_name () << ")"; + break; + case AST_PredefinedType::PT_octet: + *os << "CORBA::Any::from_octet (" << arg->local_name () << ")"; break; + default: + ACE_ERROR_RETURN ((LM_ERROR, + "be_visitor_args_compiled_marshal_cs::" + "visit_predefined_type - " + "Bad predefined type\n"), + -1); } + break; + case AST_Argument::dir_OUT: + break; } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -738,29 +566,14 @@ int be_visitor_args_compiled_marshal_cs::visit_sequence (be_sequence *) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name (); - break; - } - } - else + switch (this->direction ()) { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + *os << arg->local_name (); + break; + case AST_Argument::dir_OUT: break; - } } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) @@ -796,18 +609,6 @@ int be_visitor_args_compiled_marshal_cs::visit_string (be_string *node) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name (); - break; - } - } switch (this->direction ()) { case AST_Argument::dir_IN: @@ -875,30 +676,15 @@ int be_visitor_args_compiled_marshal_cs::visit_structure (be_structure *node) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name (); - break; - } - } - else - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } - } + switch (this->direction ()) + { + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + *os << arg->local_name (); + break; + case AST_Argument::dir_OUT: + break; + } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { @@ -936,29 +722,14 @@ int be_visitor_args_compiled_marshal_cs::visit_union (be_union *node) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS) - { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - break; - case AST_Argument::dir_INOUT: - case AST_Argument::dir_OUT: - *os << arg->local_name (); - break; - } - } - else + switch (this->direction ()) { - switch (this->direction ()) - { - case AST_Argument::dir_IN: - case AST_Argument::dir_INOUT: - *os << arg->local_name (); - break; - case AST_Argument::dir_OUT: - break; - } + case AST_Argument::dir_IN: + case AST_Argument::dir_INOUT: + *os << arg->local_name (); + break; + case AST_Argument::dir_OUT: + break; } } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) diff --git a/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_ss.cpp index 3291a6c4757..012dc96724f 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/compiled_marshal_ss.cpp @@ -60,10 +60,6 @@ int be_visitor_args_compiled_marshal_ss::visit_argument (be_argument *node) TAO_OutStream *os = this->ctx_->stream (); // get output stream - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGS_DEMARSHAL_CS) - return 0; - if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) { switch (this->direction ()) @@ -367,13 +363,13 @@ int be_visitor_args_compiled_marshal_ss::visit_valuetype_fwd (be_valuetype_fwd * { case AST_Argument::dir_IN: case AST_Argument::dir_INOUT: - *os << arg->local_name () << "out ()"; + *os << arg->local_name () << ".out ()"; break; case AST_Argument::dir_OUT: break; } } - else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) + else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { switch (this->direction ()) { diff --git a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp index be63bc8dbec..63761225591 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/upcall_ss.cpp @@ -75,12 +75,6 @@ int be_visitor_args_upcall_ss::visit_array (be_array *node) be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument // node - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS) - return 0; - os->indent (); switch (this->direction ()) { @@ -125,12 +119,6 @@ int be_visitor_args_upcall_ss::visit_interface (be_interface *) TAO_OutStream *os = this->ctx_->stream (); // get output stream be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument // node - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS) - return 0; - os->indent (); switch (this->direction ()) { @@ -165,12 +153,6 @@ int be_visitor_args_upcall_ss::visit_interface_fwd (be_interface_fwd *) TAO_OutStream *os = this->ctx_->stream (); // get output stream be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument // node - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS) - return 0; - os->indent (); switch (this->direction ()) { @@ -207,12 +189,6 @@ int be_visitor_args_upcall_ss::visit_valuetype (be_valuetype *) TAO_OutStream *os = this->ctx_->stream (); // get output stream be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument // node - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS) - return 0; - os->indent (); switch (this->direction ()) { @@ -247,12 +223,6 @@ int be_visitor_args_upcall_ss::visit_valuetype_fwd (be_valuetype_fwd *) TAO_OutStream *os = this->ctx_->stream (); // get output stream be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument // node - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS) - return 0; - os->indent (); switch (this->direction ()) { @@ -290,12 +260,6 @@ int be_visitor_args_upcall_ss::visit_predefined_type (be_predefined_type *node) TAO_OutStream *os = this->ctx_->stream (); // get output stream be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument // node - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS) - return 0; - os->indent (); // check if the type is an any if (node->pt () == AST_PredefinedType::PT_any) @@ -363,12 +327,6 @@ int be_visitor_args_upcall_ss::visit_sequence (be_sequence *) TAO_OutStream *os = this->ctx_->stream (); // get the stream be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument // node - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS) - return 0; - os->indent (); switch (this->direction ()) { @@ -392,12 +350,6 @@ int be_visitor_args_upcall_ss::visit_string (be_string *) TAO_OutStream *os = this->ctx_->stream (); // get the stream be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument // node - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS) - return 0; - os->indent (); switch (this->direction ()) { @@ -463,12 +415,6 @@ int be_visitor_args_upcall_ss::visit_union (be_union *node) TAO_OutStream *os = this->ctx_->stream (); // get the stream be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument // node - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS) - return 0; - os->indent (); switch (this->direction ()) { diff --git a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp index bf7f3a5bc36..43bb2a120b3 100644 --- a/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_argument/vardecl_ss.cpp @@ -81,12 +81,6 @@ int be_visitor_args_vardecl_ss::visit_array (be_array *node) else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - switch (this->direction ()) { case AST_Argument::dir_IN: @@ -128,12 +122,6 @@ int be_visitor_args_vardecl_ss::visit_enum (be_enum *node) else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - switch (this->direction ()) { case AST_Argument::dir_IN: @@ -186,12 +174,6 @@ int be_visitor_args_vardecl_ss::visit_interface (be_interface *node) else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - switch (this->direction ()) { case AST_Argument::dir_IN: @@ -239,16 +221,6 @@ int be_visitor_args_vardecl_ss::visit_interface_fwd (be_interface_fwd *node) else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - - switch (this->direction ()) - { - case AST_Argument::dir_IN: - switch (this->direction ()) { case AST_Argument::dir_IN: @@ -311,13 +283,6 @@ int be_visitor_args_vardecl_ss::visit_predefined_type (be_predefined_type *node) else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - - // check if the type is an any if (node->pt () == AST_PredefinedType::PT_any) { @@ -402,12 +367,6 @@ int be_visitor_args_vardecl_ss::visit_sequence (be_sequence *node) else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - switch (this->direction ()) { case AST_Argument::dir_IN: @@ -437,12 +396,6 @@ int be_visitor_args_vardecl_ss::visit_string (be_string *) TAO_OutStream *os = this->ctx_->stream (); // get output stream be_argument *arg = this->ctx_->be_node_as_argument (); // get the argument // node - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - switch (this->direction ()) { case AST_Argument::dir_IN: @@ -486,12 +439,6 @@ int be_visitor_args_vardecl_ss::visit_structure (be_structure *node) else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - switch (this->direction ()) { case AST_Argument::dir_IN: @@ -534,12 +481,6 @@ int be_visitor_args_vardecl_ss::visit_union (be_union *node) else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - switch (this->direction ()) { case AST_Argument::dir_IN: @@ -615,12 +556,6 @@ int be_compiled_visitor_args_vardecl_ss::visit_interface (be_interface *node) else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - switch (this->direction ()) { case AST_Argument::dir_IN: @@ -649,13 +584,6 @@ int be_compiled_visitor_args_vardecl_ss::visit_interface_fwd (be_interface_fwd * else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - - switch (this->direction ()) { case AST_Argument::dir_IN: @@ -687,12 +615,6 @@ int be_compiled_visitor_args_vardecl_ss::visit_valuetype (be_valuetype *node) else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - switch (this->direction ()) { case AST_Argument::dir_IN: @@ -722,12 +644,6 @@ be_compiled_visitor_args_vardecl_ss::visit_valuetype_fwd (be_valuetype_fwd *node else bt = node; - // If we use it in conjunction with AMI Reply Handlers we do - // not want to generate declarations for IN arguments - if (this->direction () == AST_Argument::dir_IN - && this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_VARDECL_CS) - return 0; - switch (this->direction ()) { case AST_Argument::dir_IN: diff --git a/TAO/TAO_IDL/be/be_visitor_factory.cpp b/TAO/TAO_IDL/be/be_visitor_factory.cpp index 30b10a4418e..9087264ea73 100644 --- a/TAO/TAO_IDL/be/be_visitor_factory.cpp +++ b/TAO/TAO_IDL/be/be_visitor_factory.cpp @@ -531,8 +531,10 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx) return new be_visitor_operation_rettype (new_ctx); case TAO_CodeGen::TAO_OPERATION_RETTYPE_IS: return new be_visitor_operation_rettype_is (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: return new be_visitor_operation_rettype_vardecl_cs (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS: return new be_visitor_operation_rettype_pre_docall_cs (new_ctx); @@ -541,17 +543,24 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_OPERATION_RETVAL_POST_INVOKE_CS: return new be_visitor_operation_rettype_post_docall_cs (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: return new be_visitor_operation_rettype_return_cs (new_ctx); + case TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS: return new be_visitor_operation_exceptlist_cs (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS: return new be_visitor_operation_rettype_vardecl_ss (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_DEMARSHAL_SS: case TAO_CodeGen::TAO_OPERATION_RETVAL_MARSHAL_SS: return new be_visitor_operation_rettype_marshal_ss (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: return new be_visitor_operation_rettype_assign_ss (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_POST_UPCALL_SS: return new be_visitor_operation_rettype_post_upcall_ss (new_ctx); case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH: @@ -565,7 +574,7 @@ 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: - case TAO_CodeGen::TAO_AMI_HANDLER_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: @@ -575,6 +584,7 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS: case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS: case TAO_CodeGen::TAO_OPERATION_ARG_POST_MARSHAL_SS: + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DECL_CS: return new be_visitor_operation_argument (new_ctx); case TAO_CodeGen::TAO_OPERATION_TIE_SH: @@ -591,7 +601,7 @@ 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: - case TAO_CodeGen::TAO_AMI_HANDLER_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: @@ -645,6 +655,9 @@ TAO_Interpretive_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CS: return new be_visitor_args_ami_handler_arglist (new_ctx); + case TAO_CodeGen::TAO_AMI_HANDLER_SKELETON_CS: + return new be_interpretive_visitor_operation_ami_handler_skeleton_cs (new_ctx); + default: // cannot handle it; delegate it to the common visitor factory delete new_ctx; @@ -699,11 +712,14 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_OPERATION_COLLOCATED_SS: return new be_visitor_operation_collocated_ss (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETTYPE_CH: case TAO_CodeGen::TAO_OPERATION_RETTYPE_OTHERS: return new be_visitor_operation_rettype (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: return new be_visitor_operation_rettype_vardecl_cs (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_PRE_INVOKE_CS: return new be_visitor_operation_rettype_pre_invoke_cs (new_ctx); @@ -713,23 +729,33 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_OPERATION_RETVAL_POST_INVOKE_CS: // this is a NO-OP return new be_visitor_decl (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: return new be_visitor_operation_rettype_return_cs (new_ctx); + case TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS: return new be_visitor_operation_exceptlist_cs (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS: return new be_compiled_visitor_operation_rettype_vardecl_ss (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_DEMARSHAL_SS: // this is a NO-OP return new be_visitor_decl (new_ctx); case TAO_CodeGen::TAO_OPERATION_RETVAL_MARSHAL_SS: + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_MARSHAL_CS: + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DEMARSHAL_CS: return new be_visitor_operation_rettype_compiled_marshal (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: return new be_visitor_operation_rettype_assign_ss (new_ctx); + case TAO_CodeGen::TAO_OPERATION_RETVAL_POST_UPCALL_SS: // this is a NO-OP return new be_visitor_decl (new_ctx); + case TAO_CodeGen::TAO_OPERATION_ARGLIST_CH: case TAO_CodeGen::TAO_OPERATION_ARGLIST_SH: case TAO_CodeGen::TAO_OPERATION_ARGLIST_IH: @@ -746,19 +772,26 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_OPERATION_ARG_POST_UPCALL_SS: case TAO_CodeGen::TAO_OPERATION_ARG_DECL_SS: 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: 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: - case TAO_CodeGen::TAO_AMI_HANDLER_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); @@ -771,25 +804,41 @@ 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: - case TAO_CodeGen::TAO_AMI_HANDLER_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: return new be_visitor_args_post_docall_compiled_cs (new_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); + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: 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); + case TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS: 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); @@ -831,6 +880,9 @@ TAO_Compiled_Visitor_Factory::make_visitor (be_visitor_context *ctx) case TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CS: return new be_visitor_args_ami_handler_arglist (new_ctx); + case TAO_CodeGen::TAO_AMI_HANDLER_SKELETON_CS: + return new be_compiled_visitor_operation_ami_handler_skeleton_cs (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_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation.cpp index 71876661134..01fe9188e69 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation.cpp @@ -60,4 +60,7 @@ #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_skeleton_cs.cpp" +#include "be_visitor_operation/ami_handler_argument_marshal.cpp" + ACE_RCSID(be, be_visitor_operation, "$Id$") diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist.cpp index fdf4d51e7aa..e3deceff7cb 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist.cpp @@ -125,7 +125,7 @@ be_visitor_operation_ami_handler_arglist::visit_operation (be_operation *node) { TAO_OutStream *os = this->ctx_->stream (); - *os << " (" << be_idt << be_idt << "\n"; + *os << " (" << be_idt << be_idt << be_nl; // First argument is a the return value of the operation. @@ -149,7 +149,6 @@ be_visitor_operation_ami_handler_arglist::visit_operation (be_operation *node) // Set the state. ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RESULT_ARG); - be_visitor *visitor = tao_cg->make_visitor (&ctx); // Pass the visitor. @@ -162,6 +161,8 @@ be_visitor_operation_ami_handler_arglist::visit_operation (be_operation *node) "Bad return type\n"), -1); } + delete visitor; + visitor = 0; if (result_printed) *os << ", " << be_nl; @@ -209,15 +210,16 @@ be_visitor_operation_ami_handler_arglist::visit_operation (be_operation *node) *os << be_uidt_nl << ")" << be_uidt; // Now generate the throw specs. - *os << be_idt_nl << "ACE_THROW_SPEC ((CORBA::SystemException))"; + *os << be_idt_nl << "ACE_THROW_SPEC ((CORBA::SystemException))" + << be_uidt_nl; switch (this->ctx_->state ()) { case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH: - *os << ";\n\n"; + *os << ";" << be_nl << be_nl; break; default: - *os << "\n"; + *os << be_nl; } return 0; } 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 306722328df..cb1fb9975ff 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 @@ -112,6 +112,7 @@ be_visitor_operation_ami_handler_operation_cs::visit_operation (be_operation *no } delete visitor; + os->indent (); // Generate the actual code for the stub. However, if any of the argument // types is "native", we flag a MARSHAL exception. // last argument - is always CORBA::Environment @@ -121,7 +122,7 @@ be_visitor_operation_ami_handler_operation_cs::visit_operation (be_operation *no // alternate mapping. Since our code uses the ACE_TRY_ENV variable in a // number of places, for the true exception case, we will have to explicitly // declare the ACE_TRY_ENV variable. - *os << this->gen_environment_var () << "\n"; + *os << this->gen_environment_var () << be_nl; // Generate any pre stub info if and only if none of our parameters is of the // native type. @@ -159,6 +160,7 @@ be_visitor_operation_ami_handler_operation_cs::visit_operation (be_operation *no } else { + os->indent (); // Generate code that retrieves the underlying stub object and then // invokes do_static_call on it. *os << be_nl @@ -167,9 +169,9 @@ be_visitor_operation_ami_handler_operation_cs::visit_operation (be_operation *no // If the stub object was bad, then we raise a system // exception. - *os << "ACE_THROW (CORBA::INTERNAL ());"; + *os << "ACE_THROW (CORBA::INTERNAL ());\n\n"; - *os << be_uidt_nl << be_nl; + *os << be_uidt; // do any pre marshal and invoke stuff with arguments ctx = *this->ctx_; @@ -201,14 +203,13 @@ be_visitor_operation_ami_handler_operation_cs::visit_operation (be_operation *no } // end of if (!native) - *os << be_uidt_nl << "}\n\n"; + *os << be_uidt_nl << "}" << be_nl << be_nl; -#if 0 // Generate the skeleton method. ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_SKELETON_CS); - visitor = tao_cg->make_visitor (&Ctx); + visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) { @@ -220,8 +221,7 @@ be_visitor_operation_ami_handler_operation_cs::visit_operation (be_operation *no -1); } delete visitor; - visitor = 0; -#endif /* 0 */ + return 0; } @@ -332,7 +332,7 @@ be_visitor_operation_ami_handler_operation_cs::gen_check_exception (be_type *bt) "codegen failed\n"), -1); } - *os << ");\n"; + *os << ");" << be_nl; } return 0; @@ -393,7 +393,9 @@ be_interpretive_visitor_operation_ami_handler_operation_cs::gen_pre_stub_info (b "visit scope failed\n"), -1); } - *os << "\n"; + + os->indent (); + *os << be_nl; os->decr_indent (); *os << "}; // " << node->flatname () << "_paramdata\n\n"; @@ -527,6 +529,8 @@ gen_marshal_and_invoke (be_operation*node, "codegen for return var in do_static_call failed\n"), -1); } + delete visitor; + visitor=0; // call do_static_call with appropriate number of arguments os->indent (); @@ -571,6 +575,8 @@ gen_marshal_and_invoke (be_operation*node, "codegen for args post do_static_call failed\n"), -1); } + delete visitor; + visitor = 0; // do any post processing for the retval ctx = *this->ctx_; @@ -585,6 +591,7 @@ gen_marshal_and_invoke (be_operation*node, "codegen for return type post do_static_call failed\n"), -1); } + delete visitor; return 0; } @@ -620,6 +627,7 @@ be_compiled_visitor_operation_ami_handler_operation_cs::gen_pre_stub_info (be_op 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::" @@ -627,6 +635,7 @@ be_compiled_visitor_operation_ami_handler_operation_cs::gen_pre_stub_info (be_op "Exceptionlist generation error\n"), -1); } + delete visitor; } return 0; @@ -674,7 +683,7 @@ gen_marshal_and_invoke (be_operation *node, << "{" << be_idt_nl; *os << "ACE_TRY_ENV.clear ();" << be_nl; - *os << "_tao_call.start (ACE_TRY_ENV);\n"; + *os << "_tao_call.start (ACE_TRY_ENV);" << be_nl; // Check if there is an exception. *os << "ACE_CHECK;"; @@ -690,27 +699,29 @@ 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 << "(_tao_out << _tao_ami_result)"; + 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 << " &&"; + *os << " &&\n"; } - *os << be_nl; - + #if 0 - // @@ This for giving the _tao_ami_result argument only. But + // @@ 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_RESULT_INVOKE_CS); + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_MARSHAL_CS); ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT); visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) @@ -728,7 +739,7 @@ gen_marshal_and_invoke (be_operation *node, // Marshal each out and inout argument. ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_INVOKE_CS); + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_MARSHAL_CS); ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT); visitor = tao_cg->make_visitor (&ctx); if (!visitor || (node->accept (visitor) == -1)) @@ -740,6 +751,9 @@ gen_marshal_and_invoke (be_operation *node, "codegen for return var in do_static_call failed\n"), -1); } + delete visitor; + visitor = 0; + *os << be_uidt << be_uidt_nl << "))" << be_nl; 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 8a386dc6212..ef9b1963ef0 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 @@ -57,14 +57,11 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod TAO_OutStream *os; // output stream be_type *bt; // type node be_visitor_context ctx; // visitor context - be_visitor *visitor; // visitor + be_visitor *visitor = 0; // visitor os = this->ctx_->stream (); this->ctx_->node (node); // save the node for future use - // Start with the current indentation level. - os->indent (); - // Init the return type variable. bt = be_type::narrow_from_decl (node->return_type ()); if (!bt) @@ -76,8 +73,12 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod -1); } + // Start with the current indentation level. + os->indent (); + + // Generate the return type. Return type is simply void. - *os << "void " << be_nl; + *os << be_nl << "void" << be_nl; // Get the scope name. be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); @@ -97,7 +98,7 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod *os << "::" << node->local_name () << "_skel (" << be_idt_nl; // Generate the argument list. - *os << "TAO_InputCDR &_tao_reply_cdr, " << be_nl + *os << "TAO_InputCDR &_tao_in, " << be_nl << "Messaging::ReplyHandler_ptr _tao_reply_handler," << be_nl << "CORBA::Environment &ACE_TRY_ENV"<< be_uidt << be_uidt_nl << ")" << be_nl; @@ -105,13 +106,13 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod // Generate the actual code for the stub. However, if any of the argument // types is "native", we flag a MARSHAL exception. // last argument - is always CORBA::Environment - *os << "{" << be_idt_nl; + *os << "{\n" << be_idt; // Deal with differences between IDL mapping for true C++ exceptions and // alternate mapping. Since our code uses the ACE_TRY_ENV variable in a // number of places, for the true exception case, we will have to explicitly // declare the ACE_TRY_ENV variable. - *os << this->gen_environment_var () << "\n"; + *os << this->gen_environment_var () << be_nl; // Generate any pre stub info if and only if none of our parameters is of the // native type. @@ -138,18 +139,18 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod *os << parent->compute_name ("AMI_", "_Handler") << "_var " << "_tao_reply_handler_object =" << be_idt_nl; - *os << parent->compute_name ("AMI_", "_Handler") << - << "::_narrow(_tao_reply_handler, ACE_TRY_ENV);" << be_uidt_nl; + *os << parent->compute_name ("AMI_", "_Handler"); + *os << "::_narrow(_tao_reply_handler, ACE_TRY_ENV);" << be_uidt_nl; - +os << "ACE_CHECK;" << be_nl << be_nl + *os << "ACE_CHECK;" << be_nl << be_nl << "// @@ Error handling " << be_nl << be_nl; - *os << "//Demarshall all the arguments." << be_nl; + *os << "//Demarshall all the arguments.\n"; // declare a return type variable - be_visitor_context ctx = *this->ctx_; + ctx = *this->ctx_; ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS); - be_visitor *visitor = tao_cg->make_visitor (&ctx); + visitor = tao_cg->make_visitor (&ctx); if (!visitor || (bt->accept (visitor) == -1)) { delete visitor; @@ -159,6 +160,8 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod "codegen for return var decl failed\n"), -1); } + delete visitor; + visitor = 0; // declare variables for arguments ctx = *this->ctx_; @@ -173,9 +176,11 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod "codegen for return var decl failed\n"), -1); } + delete visitor; + visitor = 0; // Demarshal parameters - if (this->gen_demarshal_params (node, bt) == -1) + if (this->gen_marshal_and_invoke (node, bt) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%1) ami_handler_skeleton_cs::" @@ -184,34 +189,7 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod -1); } - // Invoke the callback method - *os << "// Invoke the call back method." << be_nl - << "_tao_reply_handler_object->" - << node->local_name () << " (" << be_idt_nl; - - // if we have a non-void return type then pass it as the first argument - if (!this->void_return_type (bt)) - *os << "_tao_ami_result," << be_nl; - - 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) ami_handler_skeleton_cs::" - "visit_operation - " - "codegen for making upcall failed\n"), - -1); - } - *os << be_uidt_nl << ");" << be_nl; - - *os << "ACE_CHECK;" << be_nl; - - *os << be_uidt_nl << "}" << be_nl << be_nl; - - // Generate the skeleton method. + *os << be_uidt_nl << "};" << be_nl << be_nl; return 0; } @@ -330,7 +308,7 @@ be_visitor_operation_ami_handler_skeleton_cs::gen_check_exception (be_type *bt) } // ************************************************************ -// Operation visitor for interpretive client stubs +// Operation visitor for interpretive client skeletons of the AMI reply handler // ************************************************************ be_interpretive_visitor_operation_ami_handler_skeleton_cs:: @@ -349,129 +327,7 @@ int be_interpretive_visitor_operation_ami_handler_skeleton_cs::gen_pre_stub_info (be_operation *node, be_type *bt) { - TAO_OutStream *os = this->ctx_->stream (); - be_visitor *visitor; - be_visitor_context ctx; - - // Generate the TAO_Param_Data table - os->indent (); - *os << "static const TAO_Param_Data "; - // 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->flatname () << - "_paramdata [] = " << be_nl; - *os << "{\n"; - os->incr_indent (); - - // entry for the return type - *os << "{" << bt->tc_name () << ", PARAM_RETURN, 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_interpretive_visitor_operation_ami_handler_skeleton_cs::" - "gen_pre_stub_info - " - "visit scope failed\n"), - -1); - } - *os << "\n"; - os->decr_indent (); - *os << "}; // " << node->flatname () << "_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 - // attributes - if (!this->ctx_->attribute ()) - { - ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_OPERATION_EXCEPTLIST_CS); - visitor = tao_cg->make_visitor (&ctx); - if (!visitor || (node->accept (visitor) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) " - "be_interpretive_visitor_operation_ami_handler_skeleton_cs::" - "gen_pre_stub_info - " - "Exceptionlist generation error\n"), - -1); - } - } - - // now generate the calldata table - os->indent (); - *os << "static const TAO_Call_Data "; - // 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->flatname () - << "_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 - // first 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->flatname () << "_paramdata, "; - - // insert exception list (if any) - node for attributes - if (this->ctx_->attribute ()) - *os << "0, 0};\n\n"; - else - { - if (node->exceptions ()) - { - *os << node->exceptions ()->length () - << ", _tao_" << node->flatname () << "_exceptiondata};\n\n"; - } - else - *os << "0, 0};\n\n"; - } + // @@ Michael: To be done. return 0; } @@ -480,108 +336,12 @@ be_interpretive_visitor_operation_ami_handler_skeleton_cs:: 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 (); - *os << "void* _tao_arguments[" - << node->argument_count () + 1 << "];" << be_nl - << "const void** _tao_arg = ACE_const_cast (const void**,_tao_arguments);" << be_nl - << "*_tao_arg = "; - - // pass the appropriate return value to docall - ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_INVOKE_CS); - visitor = tao_cg->make_visitor (&ctx); - if (!visitor || (bt->accept (visitor) == -1)) - { - delete visitor; - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interpretive_visitor_operation_ami_handler_skeleton_cs::" - "gen_marshal_and_invoke - " - "codegen for return var in do_static_call failed\n"), - -1); - } - *os << "; _tao_arg++;\n"; - - // pass each argument to do_static_call - ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS); - visitor = tao_cg->make_visitor (&ctx); - if (!visitor || (node->accept (visitor) == -1)) - { - delete visitor; - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interpretive_visitor_operation_ami_handler_skeleton_cs::" - "gen_marshal_and_invoke - " - "codegen for return var in do_static_call failed\n"), - -1); - } - - // call do_static_call with appropriate number of arguments - os->indent (); - *os << "istub->do_static_call (" << 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->flatname () << "_calldata," << be_nl - << "_tao_arguments" << be_uidt_nl - << ");\n"; - - os->indent (); - // check if there is an exception - if (this->gen_check_exception (bt) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interpretive_visitor_operation_ami_handler_skeleton_cs::" - "gen_marshal_and_invoke - " - "codegen for checking exception failed\n"), - -1); - - } - - // do any post processing for the arguments - ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_POST_INVOKE_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_skeleton_cs::" - "visit_operation - " - "codegen for args post do_static_call failed\n"), - -1); - } - - // do any post processing for the retval - ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_OPERATION_RETVAL_POST_INVOKE_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_skeleton_cs::" - "visit_operation - " - "codegen for return type post do_static_call failed\n"), - -1); - } - + // @@ Michael: To be done. return 0; } // ************************************************************ -// Operation visitor for compiled client stubs +// Operation visitor for compiled client skeletons of the AMI reply handler // ************************************************************ be_compiled_visitor_operation_ami_handler_skeleton_cs:: @@ -611,6 +371,7 @@ be_compiled_visitor_operation_ami_handler_skeleton_cs::gen_pre_stub_info (be_ope 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_skeleton_cs::" @@ -618,6 +379,7 @@ be_compiled_visitor_operation_ami_handler_skeleton_cs::gen_pre_stub_info (be_ope "Exceptionlist generation error\n"), -1); } + delete visitor; } return 0; @@ -625,12 +387,16 @@ be_compiled_visitor_operation_ami_handler_skeleton_cs::gen_pre_stub_info (be_ope int be_compiled_visitor_operation_ami_handler_skeleton_cs:: -gen_demarshal_params (be_operation *node, - be_type *bt) +gen_marshal_and_invoke (be_operation *node, + be_type *bt) { TAO_OutStream *os = this->ctx_->stream (); - be_visitor *visitor; + be_visitor *visitor = 0; be_visitor_context ctx; + + os->indent (); + + *os << "if (!(\n" << be_idt << be_idt << be_idt; if (!this->void_return_type (bt)) { @@ -649,7 +415,12 @@ gen_demarshal_params (be_operation *node, -1); } delete visitor; - visitor= 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"; } if (this->has_param_type (node, AST_Argument::dir_INOUT) || @@ -657,7 +428,7 @@ gen_demarshal_params (be_operation *node, { // demarshal each in and inout argument ctx = *this->ctx_; - ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_MARSHAL_CS); + 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)) @@ -670,11 +441,40 @@ gen_demarshal_params (be_operation *node, -1); } delete visitor; - visitor = 0; - } + } - *os << be_uidt_nl << "))\n" << be_idt; + *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->" + << node->local_name () << " (" << be_idt_nl; + // if we have a non-void return type then pass it as the first argument + if (!this->void_return_type (bt)) + *os << "_tao_retval,\n"; + // generate the argument list containing the inout and inout arguments + 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) ami_handler_skeleton_cs::" + "visit_operation - " + "codegen for making upcall failed\n"), + -1); + } + delete visitor; + visitor = 0; + + *os << be_nl << ");" << be_uidt_nl; + + *os << "ACE_CHECK;" << be_nl; + 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 35dfb1fe475..a36fd00d9a4 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp @@ -56,11 +56,24 @@ be_visitor_operation_argument::post_process (be_decl *bd) switch (this->ctx_->state ()) { case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS: - case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS: case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS: case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS: case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS: - *os << "," << be_nl; + *os << ",\n"; + break; + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS: + { + // @@ Michael + // In the case of of AMI, we do not want to + // 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. + be_argument *arg = this->ctx_->be_node_as_argument (); + ACE_ASSERT (arg != 0); + if (arg->direction () != AST_Argument::dir_IN) + *os << ",\n"; + } break; default: break; @@ -91,8 +104,8 @@ be_visitor_operation_argument::visit_operation (be_operation *node) switch (this->ctx_->state ()) { case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS: - case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS: 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 @@ -160,9 +173,9 @@ 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; - case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_INVOKE_CS: - ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_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; @@ -175,9 +188,15 @@ be_visitor_operation_argument::visit_argument (be_argument *node) case TAO_CodeGen::TAO_OPERATION_ARG_DEMARSHAL_SS: ctx.state (TAO_CodeGen::TAO_ARGUMENT_DEMARSHAL_SS); break; + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS: + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_DEMARSHAL_CS); + break; case TAO_CodeGen::TAO_OPERATION_ARG_MARSHAL_SS: ctx.state (TAO_CodeGen::TAO_ARGUMENT_MARSHAL_SS); break; + case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_MARSHAL_CS: + ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_MARSHAL_CS); + break; case TAO_CodeGen::TAO_OPERATION_ARG_PRE_UPCALL_SS: ctx.state (TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS); break; @@ -196,9 +215,9 @@ 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; + // 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/compiled_marshal.cpp b/TAO/TAO_IDL/be/be_visitor_operation/compiled_marshal.cpp index f7773ed8d99..675a5807d94 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/compiled_marshal.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/compiled_marshal.cpp @@ -68,8 +68,7 @@ visit_operation (be_operation *node) if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_OUTPUT) { - os->indent (); - + os->indent (); *os << "(_tao_out << "; } else if (this->ctx_->sub_state () == TAO_CodeGen::TAO_CDR_INPUT) diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp index 1093490547c..5873b0d412f 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_cs.cpp @@ -57,10 +57,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_array (be_array *node) os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "_slice *_tao_ami_result;"; - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "_slice *_tao_retval = 0;"; + *os << bt->name () << "_slice *_tao_retval = 0;"; *os << be_nl << be_nl; @@ -79,10 +76,8 @@ be_visitor_operation_rettype_vardecl_cs::visit_enum (be_enum *node) bt = node; os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << " _tao_ami_result;"; - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << " _tao_retval = (" << bt->name () << ")0;"; + + *os << bt->name () << " _tao_retval = (" << bt->name () << ")0;"; *os << be_nl << be_nl; @@ -101,10 +96,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_interface (be_interface *node) bt = node; os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "_ptr _tao_ami_result;"; - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();"; + *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();"; *os << be_nl << be_nl; @@ -123,10 +115,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_interface_fwd (be_interface_fwd * bt = node; os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "_ptr _tao_ami_result;"; - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();"; + *os << bt->name () << "_ptr _tao_retval = " << bt->name () << "::_nil ();"; *os << be_nl << be_nl; @@ -148,10 +137,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_valuetype (be_valuetype *node) os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "* _tao_ami_result;"; - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "* _tao_retval = 0;"; + *os << bt->name () << "* _tao_retval = 0;"; *os << be_nl << be_nl; @@ -170,10 +156,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_valuetype_fwd (be_valuetype_fwd * bt = node; os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "* _tao_ami_result;"; - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "* _tao_retval = 0;"; + *os << bt->name () << "* _tao_retval = 0;"; *os << be_nl << be_nl; @@ -197,26 +180,17 @@ be_visitor_operation_rettype_vardecl_cs::visit_predefined_type (be_predefined_ty { case AST_PredefinedType::PT_pseudo: os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "_ptr _tao_ami_result;"; - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "_ptr _tao_retval = 0;"; + *os << bt->name () << "_ptr _tao_retval = 0;"; break; case AST_PredefinedType::PT_any: os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "* _tao_ami_result;"; - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "* _tao_retval = 0;"; + *os << bt->name () << "* _tao_retval = 0;"; break; case AST_PredefinedType::PT_void: break; default: os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << " _tao_ami_result;"; - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << " _tao_retval = 0;"; + *os << bt->name () << " _tao_retval = 0;"; break; } @@ -239,10 +213,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_sequence (be_sequence *node) bt = node; os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "* _tao_ami_result;"; - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "* _tao_retval = 0;"; + *os << bt->name () << "* _tao_retval = 0;"; *os << be_nl << be_nl; return 0; @@ -254,10 +225,7 @@ be_visitor_operation_rettype_vardecl_cs::visit_string (be_string * /* node*/) TAO_OutStream *os = this->ctx_->stream (); // grab the out stream os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - *os << bt->name () << "char* _tao_ami_result;"; - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - *os << "char* _tao_retval = 0;"; + *os << "char* _tao_retval = 0;"; *os << be_nl << be_nl; return 0; @@ -276,34 +244,19 @@ be_visitor_operation_rettype_vardecl_cs::visit_structure (be_structure *node) os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) - { - // based on whether we are variable or not, we return a pointer or the - // aggregate type - if (node->size_type () == be_decl::VARIABLE) - { - *os << bt->name () << "* _tao_ami_result;" << be_nl; - } - else - { - *os << bt->name () << " _tao_ami_result;" << be_nl; - } - } - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) - { - // based on whether we are variable or not, we return a pointer or the - // aggregate type - if (node->size_type () == be_decl::VARIABLE) - { - *os << bt->name () << "* _tao_retval = 0;" << be_nl; - } - else - { - *os << bt->name () << " _tao_retval;" << be_nl; - *os << "ACE_OS::memset (&_tao_retval, 0, sizeof (" << bt->name () << "));" - << be_nl; - } - } + // based on whether we are variable or not, we return a pointer or the + // aggregate type + if (node->size_type () == be_decl::VARIABLE) + { + *os << bt->name () << "* _tao_retval = 0;" << be_nl; + } + else + { + *os << bt->name () << " _tao_retval;" << be_nl; + *os << "ACE_OS::memset (&_tao_retval, 0, sizeof (" << bt->name () << "));" + << be_nl; + } + return 0; } @@ -336,31 +289,15 @@ be_visitor_operation_rettype_vardecl_cs::visit_union (be_union *node) os->indent (); - if (this->ctx_->state() == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_RETVAL_DECL_CS) + // based on whether we are variable or not, we return a pointer or the + // aggregate type + if (node->size_type () == be_decl::VARIABLE) { - // based on whether we are variable or not, we return a pointer or the - // aggregate type - if (node->size_type () == be_decl::VARIABLE) - { - *os << bt->name () << "* _tao_ami_result = 0;"; - } - else - { - *os << bt->name () << " _tao_ami_result;"; - } + *os << bt->name () << "* _tao_retval = 0;"; } - else if (this->ctx_->state() == TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS) + else { - // based on whether we are variable or not, we return a pointer or the - // aggregate type - if (node->size_type () == be_decl::VARIABLE) - { - *os << bt->name () << "* _tao_retval = 0;"; - } - else - { - *os << bt->name () << " _tao_retval;"; - } + *os << bt->name () << " _tao_retval;"; } *os << be_nl; diff --git a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp index b368ff8fc43..88901556894 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/rettype_vardecl_ss.cpp @@ -89,7 +89,7 @@ be_visitor_operation_rettype_vardecl_ss::visit_interface (be_interface *) // return type may be some derived class *os << "CORBA::Object_var _tao_retval = CORBA::Object::_nil ();\n"; #if 0 /* ASG */ - *os << "CORBA::Object_var _tao_retval = CORBA::Object::_nil ();" << be_nl; + *os << "CORBA::Object_var _tao_retval = CORBA::Object::_nil ();\n"; *os << "CORBA::Object_ptr &_tao_ptr_retval = _tao_retval.out ();\n"; #endif return 0; @@ -107,10 +107,10 @@ visit_interface_fwd (be_interface_fwd *) // CORBA::Object_ptr as the type for the return value even though the actual // return type may be some derived class #if 0 /* ASG */ - *os << "CORBA::Object_var _tao_retval = CORBA::Object::_nil ();" << be_nl; + *os << "CORBA::Object_var _tao_retval = CORBA::Object::_nil ();\n"; *os << "CORBA::Object_ptr &_tao_ptr_retval = _tao_retval.out ();\n"; #endif - *os << "CORBA::Object_var _tao_retval = CORBA::Object::_nil ();" << be_nl; + *os << "CORBA::Object_var _tao_retval = CORBA::Object::_nil ();\n"; return 0; } @@ -156,7 +156,7 @@ visit_predefined_type (be_predefined_type *node) case AST_PredefinedType::PT_pseudo: os->indent (); #if 0 /* ASG */ - *os << bt->name () << "_var _tao_retval;" << be_nl; + *os << bt->name () << "_var _tao_retval;\n"; *os << bt->name () << "_ptr &_tao_ptr_retval = _tao_retval.out ();\n"; #endif *os << bt->name () << "_var _tao_retval;\n"; @@ -164,7 +164,7 @@ visit_predefined_type (be_predefined_type *node) case AST_PredefinedType::PT_any: os->indent (); #if 0 /* ASG */ - *os << bt->name () << "_var _tao_retval;" << be_nl; + *os << bt->name () << "_var _tao_retval;\n"; *os << bt->name () << "_ptr &_tao_ptr_retval = _tao_retval.out ();\n"; #endif *os << bt->name () << "_var _tao_retval;\n"; @@ -194,7 +194,7 @@ be_visitor_operation_rettype_vardecl_ss::visit_sequence (be_sequence *node) os->indent (); #if 0 /* ASg */ - *os << bt->name () << "_var _tao_retval;" << be_nl; + *os << bt->name () << "_var _tao_retval;\n"; *os << bt->name () << " *&_tao_ptr_retval = _tao_retval.out ();\n"; #endif *os << bt->name () << "_var _tao_retval;\n"; @@ -208,7 +208,7 @@ be_visitor_operation_rettype_vardecl_ss::visit_string (be_string * /* node*/) os->indent (); #if 0 /* ASG */ - *os << "CORBA::String_var _tao_retval;" << be_nl; + *os << "CORBA::String_var _tao_retval;\n"; *os << "char *&_tao_ptr_retval = _tao_retval.out ();\n"; #endif *os << "CORBA::String_var _tao_retval;\n"; @@ -232,7 +232,7 @@ be_visitor_operation_rettype_vardecl_ss::visit_structure (be_structure *node) if (node->size_type () == be_decl::VARIABLE) { #if 0 /* ASG */ - *os << bt->name () << "_var _tao_retval;" << be_nl; + *os << bt->name () << "_var _tao_retval;\n"; *os << bt->name () << " *&_tao_ptr_retval = _tao_retval.out ();\n"; #endif *os << bt->name () << "_var _tao_retval;\n"; @@ -275,10 +275,10 @@ be_visitor_operation_rettype_vardecl_ss::visit_union (be_union *node) if (node->size_type () == be_decl::VARIABLE) { #if 0 /* ASG */ - *os << bt->name () << "_var _tao_retval;" << be_nl; + *os << bt->name () << "_var _tao_retval;\n"; *os << bt->name () << " *&_tao_ptr_retval = _tao_retval.out ();\n"; #endif - *os << bt->name () << "_var _tao_retval;" << be_nl; + *os << bt->name () << "_var _tao_retval;\n"; } else *os << bt->name () << " _tao_retval;\n"; diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h index ee2a717b0da..ff2ce30a833 100644 --- a/TAO/TAO_IDL/be_include/be_codegen.h +++ b/TAO/TAO_IDL/be_include/be_codegen.h @@ -298,7 +298,7 @@ public: TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CH, TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CS, TAO_ARGUMENT_ARGLIST_AMI_HANDLER, - TAO_AMI_HANDLER_OPERATION_RESULT_ARG, + TAO_AMI_HANDLER_OPERATION_RESULT_ARG, TAO_AMI_HANDLER_TYPECODE_DECL, // Typecode decl for the AMI_*_Handler. @@ -306,9 +306,9 @@ public: TAO_COLLOCATED_AMI_HANDLER_OPERATION_CH, // Operation insidee collocated handler. - TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS, +// @@ Michael TAO_AMI_HANDLER_ARGUMENT_INVOKE_CS, - TAO_AMI_HANDLER_OPERATION_ARG_INVOKE_CS, +// @@ Michael TAO_AMI_HANDLER_OPERATION_ARG_INVOKE_CS, TAO_AMI_HANDLER_STUB_OPERATION_CS, @@ -330,11 +330,17 @@ public: // (only out and inout arguments) TAO_AMI_HANDLER_ARGUMENT_UPCALL_CS, // State derived out of the above + TAO_AMI_HANDLER_OPERATION_RETVAL_MARSHAL_CS, // Marshalling the return value + TAO_AMI_HANDLER_OPERATION_RETVAL_DEMARSHAL_CS, // Demarshalling the return value + TAO_AMI_HANDLER_OPERATION_ARG_MARSHAL_CS, // Marshalling the inout and out arguments + + TAO_AMI_HANDLER_ARGUMENT_MARSHAL_CS, // State derived out of the above + TAO_AMI_HANDLER_OPERATION_ARG_DEMARSHAL_CS, // Demarshalling the inout and out arguments - TAO_AMI_HANDLER_SKELETON_CS, + TAO_AMI_HANDLER_ARGUMENT_DEMARSHAL_CS, // State derived out of the above // Emitting code for root. TAO_ROOT_CH, diff --git a/TAO/TAO_IDL/be_include/be_visitor_argument.h b/TAO/TAO_IDL/be_include/be_visitor_argument.h index 58ae9a6f47e..78f39acb854 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_argument.h +++ b/TAO/TAO_IDL/be_include/be_visitor_argument.h @@ -42,4 +42,8 @@ #include "be_visitor_argument/ami_arglist.h" #include "be_visitor_argument/ami_handler_arglist.h" #include "be_visitor_argument/ami_handler_result_arg.h" +#include "be_visitor_argument/ami_handler_compiled_marshal_cs.h" +#include "be_visitor_argument/ami_handler_upcall_cs.h" +#include "be_visitor_argument/ami_handler_vardecl_cs.h" + #endif /* _BE_VISITOR_ARGUMENT_H */ diff --git a/TAO/TAO_IDL/be_include/be_visitor_operation.h b/TAO/TAO_IDL/be_include/be_visitor_operation.h index 02b18b50bee..fd87c65c805 100644 --- a/TAO/TAO_IDL/be_include/be_visitor_operation.h +++ b/TAO/TAO_IDL/be_include/be_visitor_operation.h @@ -59,4 +59,6 @@ #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_skeleton_cs.h" +#include "be_visitor_operation/ami_handler_argument_marshal.h" #endif // TAO_BE_VISITOR_OPERATION_H -- cgit v1.2.1