summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_operation
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_operation')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_arglist.cpp12
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist.cpp4
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist_ch.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation.cpp2
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_ch.cpp22
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation_cs.cpp57
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_servant_operation_ss.cpp55
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_skeleton_cs.cpp38
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_ss.cpp32
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/argument.cpp70
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/compiled_marshal.cpp14
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp4
14 files changed, 185 insertions, 131 deletions
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 fa0efac3f45..fcf5904ab8e 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_arglist.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_arglist.cpp
@@ -96,7 +96,7 @@ be_visitor_operation_ami_arglist::visit_operation (be_operation *node)
*os << "CORBA::Environment &ACE_TRY_ENV";
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CH)
+ if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_OPERATION_ARGLIST_CH)
{
*os << " = " << be_idt_nl
<< "TAO_default_environment ()"
@@ -106,7 +106,7 @@ be_visitor_operation_ami_arglist::visit_operation (be_operation *node)
// Done with the argument list.
*os << be_uidt_nl << ")" << be_uidt;
- if (this->ctx_->state () == TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CH)
+ if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_OPERATION_ARGLIST_CH)
*os << ";";
*os << "\n";
@@ -155,12 +155,12 @@ be_visitor_operation_ami_arglist::visit_argument (be_argument *node)
switch (this->ctx_->state ())
{
- case TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CH:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI_ARGLIST_CH);
+ case TAO_CodeGen::TAO_AMI_OPERATION_ARGLIST_CH:
+ ctx.state (TAO_CodeGen::TAO_AMI_ARGUMENT_ARGLIST_CH);
break;
- case TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI_ARGLIST_CS);
+ case TAO_CodeGen::TAO_AMI_OPERATION_ARGLIST_CS:
+ ctx.state (TAO_CodeGen::TAO_AMI_ARGUMENT_ARGLIST_CS);
break;
default:
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp
index dc8aa70a9af..11f7e9e4cbf 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_ch.cpp
@@ -72,7 +72,7 @@ be_visitor_operation_ami_ch::visit_operation (be_operation *node)
// mapping. For these we grab a visitor that generates the
// parameter listing.
be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CH);
+ ctx.state (TAO_CodeGen::TAO_AMI_OPERATION_ARGLIST_CH);
be_visitor *visitor = tao_cg->make_visitor (&ctx);
if (!visitor)
{
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 4a46c106c85..8820a07184e 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_cs.cpp
@@ -93,7 +93,7 @@ be_visitor_operation_ami_cs::visit_operation (be_operation *node)
// Generate the argument list with the appropriate mapping (same as
// in the header file)
ctx = *this->ctx_;
- ctx.state (TAO_CodeGen::TAO_OPERATION_AMI_ARGLIST_CS);
+ ctx.state (TAO_CodeGen::TAO_AMI_OPERATION_ARGLIST_CS);
visitor = tao_cg->make_visitor (&ctx);
if ((!visitor) || (node->accept (visitor) == -1))
{
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 4670062f2df..cbb919ea578 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
@@ -266,10 +266,10 @@ be_visitor_operation_ami_handler_arglist::visit_argument (be_argument *node)
switch (this->ctx_->state ())
{
case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CH:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CH);
+ ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_ARGLIST_CH);
break;
case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST_CS:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST_CS);
+ ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_ARGLIST_CS);
break;
default:
{
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist_ch.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist_ch.cpp
index 121f7509a5b..ad510501fdb 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_arglist_ch.cpp
@@ -129,7 +129,7 @@ be_visitor_operation_ami_handler_arglist_ch::visit_argument (be_argument *node)
switch (this->ctx_->state ())
{
case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARGLIST:
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_AMI_HANDLER_ARGLIST);
+ ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_ARGUMENT_ARGLIST);
break;
default:
{
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation.cpp
index 30f38acf344..e171415a018 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_operation.cpp
@@ -133,7 +133,7 @@ be_visitor_operation_ami_handler_operation_ch::visit_operation (be_operation *no
<< ");" << be_uidt << "\n\n";
break;
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CH:
+ case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_CH:
*os << "TAO_InputCDR &_tao_reply_cdr, " << be_nl
<< "Messaging::ReplyHandler_ptr _tao_reply_handler, " << be_nl
<< "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
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 ea3ecea5600..a8609c9dc01 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
@@ -59,7 +59,7 @@ be_visitor_operation_ami_handler_operation_ch::visit_operation (be_operation *no
*os << "void ";
// STEP 2: generate the operation name.
- *os << " " << node->local_name ();
+ *os << node->local_name ();
// STEP 3: generate the argument list with the appropriate
// mapping. For these we grab a visitor that generates the
@@ -91,7 +91,8 @@ be_visitor_operation_ami_handler_operation_ch::visit_operation (be_operation *no
// Skeleton not necessary for collocated class.
if (this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_THRU_POA_COLLOCATED_SH
- || this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_DIRECT_COLLOCATED_SH)
+ || this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_DIRECT_COLLOCATED_SH
+ || this->ctx_->state () == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_TIE_SH)
{
return 0;
/* NOT REACHED */
@@ -101,13 +102,14 @@ be_visitor_operation_ami_handler_operation_ch::visit_operation (be_operation *no
// operation only if there was no "native" type.
if (!node->has_native ())
{
- // Next line.
- *os << be_nl;
-
+
// Indent.
os->indent ();
- *os << "static void ";
+ // Next line.
+ *os << be_nl
+ << "static void ";
+
// Check if we are an attribute node in disguise
if (this->ctx_->attribute ())
{
@@ -117,14 +119,14 @@ be_visitor_operation_ami_handler_operation_ch::visit_operation (be_operation *no
else
*os << "_get_";
}
- *os << node->local_name () <<
- "_skel (" << be_idt << be_idt_nl;
+ *os << node->local_name ()
+ << "_skel (" << be_idt << be_idt_nl;
// Different skeletons for the AMI Handler class and the servant
// class.
switch (this->ctx_->state ())
{
- case TAO_CodeGen::TAO_AMI_HANDLER_SERVANT_OPERATION_SH:
+ case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_SH:
*os << "CORBA::ServerRequest &_tao_req, " << be_nl
<< "void *_tao_obj, " << be_nl
<< "void *_tao_context, " << be_nl
@@ -134,7 +136,7 @@ be_visitor_operation_ami_handler_operation_ch::visit_operation (be_operation *no
<< ");" << be_uidt << "\n\n";
break;
- case TAO_CodeGen::TAO_AMI_HANDLER_STUB_OPERATION_CH:
+ case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_CH:
*os << "TAO_InputCDR &_tao_reply_cdr, " << be_nl
<< "Messaging::ReplyHandler_ptr _tao_reply_handler, " << be_nl
<< "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl
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 f58cf14e9d1..a50f71569da 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
@@ -93,17 +93,8 @@ be_visitor_operation_ami_handler_operation_cs::visit_operation (be_operation *no
// 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;
- }
+ // Genereate scope name.
+ *os << parent->compute_name ("AMI_", "_Handler");
// Generate the operation name.
*os << "::" << node->local_name ();
@@ -709,34 +700,36 @@ gen_marshal_and_invoke (be_operation *node,
<< be_nl
<< "if (!(\n" << be_idt << be_idt << be_idt;
- // 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);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
- if (!visitor || (node->accept (visitor) == -1))
+ if (!this->void_return_type (bt))
{
+ // 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);
+ 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_demarshal_params - "
+ "codegen for demarshal failed\n"),
+ -1);
+ }
delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_handler_operation_cs::"
- "gen_demarshal_params - "
- "codegen for demarshal 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";
+ // 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_;
+ be_visitor_context ctx (*this->ctx_);
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);
+ be_visitor *visitor = tao_cg->make_visitor (&ctx);
if (!visitor || (node->accept (visitor) == -1))
{
delete visitor;
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_servant_operation_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_servant_operation_ss.cpp
index c966237390a..5301033d275 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_servant_operation_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_servant_operation_ss.cpp
@@ -97,17 +97,8 @@ be_visitor_operation_ami_handler_servant_operation_ss::visit_operation (be_opera
// 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 () << " ";
+ *os << "void " << intf->full_skel_name () << "::"
+ << 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);
@@ -229,6 +220,9 @@ be_visitor_operation_ami_handler_servant_operation_ss::visit_operation (be_opera
ctx = *this->ctx_;
ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS);
+ if (this->has_param_type (node, AST_Argument::dir_INOUT)
+ || this->has_param_type (node, AST_Argument::dir_OUT))
+ ctx.sub_state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_HAS_ARGUMENTS);
visitor = tao_cg->make_visitor (&ctx);
if (!visitor || (node->accept (visitor) == -1))
{
@@ -622,27 +616,30 @@ be_compiled_visitor_operation_ami_handler_servant_operation_ss::gen_demarshal_pa
// 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))
+ if (!this->void_return_type (bt))
{
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_compiled_visitor_operation_ami_handler_servant_operation_ss::"
- "gen_demarshal_params - "
- "codegen for demarshal failed\n"),
- -1);
+ // 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_ss::"
+ "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";
}
- // 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);
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 d88846b4e0b..f46c704e60e 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
@@ -95,7 +95,17 @@ be_visitor_operation_ami_handler_skeleton_cs::visit_operation (be_operation *nod
*os << parent->compute_name ("AMI_", "_Handler");
// Generate the operation name.
- *os << "::" << node->local_name () << "_skel (" << be_idt_nl;
+ *os << "::";
+ // 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_nl;
// Generate the argument list.
*os << "TAO_InputCDR &_tao_in, " << be_nl
@@ -391,8 +401,8 @@ be_compiled_visitor_operation_ami_handler_skeleton_cs::gen_pre_stub_info (be_ope
int
be_compiled_visitor_operation_ami_handler_skeleton_cs::
-gen_marshal_and_invoke (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 = 0;
@@ -424,13 +434,15 @@ gen_marshal_and_invoke (be_operation *node,
-1);
}
delete visitor;
+
+ if (this->has_param_type (node, AST_Argument::dir_INOUT) ||
+ this->has_param_type (node, AST_Argument::dir_OUT))
+ *os << " &&\n";
}
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);
@@ -454,16 +466,24 @@ gen_marshal_and_invoke (be_operation *node,
// Invoke the callback method
*os << "// Invoke the call back method." << be_nl
- << "_tao_reply_handler_object->"
- << node->local_name () << " (" << be_idt_nl;
+ << "_tao_reply_handler_object->";
+ *os << 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";
+ {
+ *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);
+
+ if (this->has_param_type (node, AST_Argument::dir_INOUT)
+ || this->has_param_type (node, AST_Argument::dir_OUT))
+ ctx.sub_state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_HAS_ARGUMENTS);
+ // generate the argument list containing the inout and inout arguments
visitor = tao_cg->make_visitor (&ctx);
if (!visitor || (node->accept (visitor) == -1))
{
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_ss.cpp
index a867498e201..ae3079dd271 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/ami_handler_thru_poa_collocated_ss.cpp
@@ -168,6 +168,9 @@ int be_visitor_operation_ami_handler_thru_poa_collocated_ss::gen_invoke (be_visi
ctx = *this->ctx_;
ctx.state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_CS);
+ if (this->has_param_type (node, AST_Argument::dir_INOUT)
+ || this->has_param_type (node, AST_Argument::dir_OUT))
+ ctx.sub_state (TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_HAS_ARGUMENTS);
be_visitor *visitor = tao_cg->make_visitor (&ctx);
if (!visitor || (node->accept (visitor) == -1))
{
@@ -198,3 +201,32 @@ be_visitor_operation_ami_handler_thru_poa_collocated_ss::void_return_type (be_ty
else
return 0;
}
+
+int
+be_visitor_operation_ami_handler_thru_poa_collocated_ss::has_param_type (be_operation *node,
+ AST_Argument::Direction dir)
+{
+ // proceed if the number of members in our scope is greater than 0
+ if (node->nmembers () > 0)
+ {
+ // initialize an iterator to iterate thru our scope
+ UTL_ScopeActiveIterator *si;
+ ACE_NEW_RETURN (si,
+ UTL_ScopeActiveIterator (node,
+ UTL_Scope::IK_decls),
+ 0);
+ // continue until each element is visited
+ while (!si->is_done ())
+ {
+ be_argument *bd = be_argument::narrow_from_decl (si->item ());
+ if (bd && (bd->direction () == dir))
+ return 1;
+
+ si->next ();
+ } // end of while loop
+ delete si;
+ } // end of if
+
+ // not of the type we are looking for
+ 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 c50bd87c007..96161ae9b4b 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/argument.cpp
@@ -48,38 +48,38 @@ be_visitor_operation_argument::post_process (be_decl *bd)
{
TAO_OutStream *os = this->ctx_->stream ();
+
// if we are not the last parameter, we insert a comma. This is only
// applicable for the upcalls or the call to (de)marshal that we use in the
// interpreted marshaling.
- if (!this->last_node (bd))
+ switch (this->ctx_->state ())
{
- switch (this->ctx_->state ())
- {
- case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
- 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:
+ case TAO_CodeGen::TAO_OPERATION_ARG_UPCALL_SS:
+ 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:
+ if (!this->last_node (bd))
*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
- // 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. 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)
- *os << ",\n";
- }
- break;
- default:
- break;
+ break;
+ case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_COLLOCATED_ARG_UPCALL_CS:
+ case TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_ARG_UPCALL_CS:
+ if (!this->last_inout_or_out_node (bd))
+ {
+ // @@ 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. 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)
+ *os << ",\n";
}
+ break;
+ default:
+ break;
}
return 0;
}
@@ -109,18 +109,28 @@ be_visitor_operation_argument::visit_operation (be_operation *node)
case TAO_CodeGen::TAO_OPERATION_COLLOCATED_ARG_UPCALL_SS:
// applicable only to these cases where the actual upcall is made
- // last argument is the environment
if (node->argument_count () > 0)
- // insert a comma only if there were previous parameters
- *os << ",\n";
+ {
+ // insert a comma only if there were previous parameters
+ *os << ",\n";
+ }
+
+ // last argument is the environment
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:
+ // applicable only to these cases where the actual upcall is made
+ if (this->ctx_->sub_state () == TAO_CodeGen::TAO_AMI_HANDLER_OPERATION_HAS_ARGUMENTS)
+ {
+ // insert a comma only if there were previous parameters
+ *os << ",\n";
+ }
+ // last argument is the environment
os->indent ();
*os << "ACE_TRY_ENV";
- break;
+ break;
default:
break;
}
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 1861f81be63..22b4fcf87e5 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/compiled_marshal.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/compiled_marshal.cpp
@@ -296,7 +296,7 @@ int be_visitor_operation_rettype_compiled_marshal::visit_predefined_type (be_pre
default:
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_operation_rettype_compiled_marshal::"
- "visit_array - "
+ "visit_predefined_type - "
"Bad predefined type\n"),
-1);
}
@@ -337,7 +337,7 @@ int be_visitor_operation_rettype_compiled_marshal::visit_predefined_type (be_pre
default:
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_operation_rettype_compiled_marshal::"
- "visit_array - "
+ "visit_predefined_type - "
"Bad predefined type\n"),
-1);
}
@@ -346,7 +346,7 @@ int be_visitor_operation_rettype_compiled_marshal::visit_predefined_type (be_pre
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_operation_rettype_compiled_marshal::"
- "visit_array - "
+ "visit_predefined_type - "
"Bad substate\n"),
-1);
}
@@ -369,7 +369,7 @@ int be_visitor_operation_rettype_compiled_marshal::visit_sequence (be_sequence *
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_operation_rettype_compiled_marshal::"
- "visit_interface - "
+ "visit_sequence - "
"Bad substate\n"),
-1);
}
@@ -427,7 +427,7 @@ int be_visitor_operation_rettype_compiled_marshal::visit_string (be_string *node
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_operation_rettype_compiled_marshal::"
- "visit_interface - "
+ "visit_string - "
"Bad substate\n"),
-1);
}
@@ -456,7 +456,7 @@ int be_visitor_operation_rettype_compiled_marshal::visit_structure (be_structure
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_operation_rettype_compiled_marshal::"
- "visit_interface - "
+ "visit_structure - "
"Bad substate\n"),
-1);
}
@@ -485,7 +485,7 @@ int be_visitor_operation_rettype_compiled_marshal::visit_union (be_union *node)
{
ACE_ERROR_RETURN ((LM_ERROR,
"be_visitor_operation_rettype_compiled_marshal::"
- "visit_interface - "
+ "visit_union - "
"Bad substate\n"),
-1);
}
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp
index 874c8fa989b..c19d19f9dfc 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/thru_poa_collocated_ss.cpp
@@ -100,8 +100,8 @@ int be_visitor_operation_thru_poa_collocated_ss::visit_operation (be_operation *
}
delete visitor;
- *os << " " << intf->full_coll_name (be_interface::THRU_POA) << "::"
- << node->local_name () << " ";
+ *os << " " << intf->full_coll_name (be_interface::THRU_POA) << "::";
+ *os << node->local_name () << " ";
// STEP 4: generate the argument list with the appropriate mapping (same as
// in the header file)