summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp85
1 files changed, 33 insertions, 52 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp
index 5bac20cfb3f..cf792b4bbf8 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_rh_ss.cpp
@@ -96,9 +96,9 @@ be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node)
// Step 3: Generate actual code for the method
*os << "{" << be_idt_nl
- << "init_reply ();" << be_nl;
+ << "init_reply ();" << be_nl << be_nl;
- //marshal_params (node);
+ marshal_params (node);
*os << "send_reply ();" << be_uidt_nl
<< "}" << be_nl;
@@ -111,58 +111,39 @@ be_visitor_amh_rh_operation_ss::visit_operation (be_operation *node)
int
be_visitor_amh_rh_operation_ss::marshal_params (be_operation *node)
{
- if (node->nmembers () > 0)
+ TAO_OutStream *os = this->ctx_->stream ();
+ be_visitor *visitor;
+ be_visitor_context ctx;
+
+ // Now make sure that we have some in and inout parameters. Otherwise, there
+ // is nothing to be marshaled out.
+ if (this->has_param_type (node, AST_Argument::dir_IN) ||
+ this->has_param_type (node, AST_Argument::dir_INOUT))
{
- // Initialize an iterator to iterate over our scope.
- UTL_ScopeActiveIterator *si;
- ACE_NEW_RETURN (si,
- UTL_ScopeActiveIterator (node,
- UTL_Scope::IK_decls),
- -1);
-
- while (!si->is_done ())
+ os->indent ();
+
+ // marshal the in and inout arguments
+ *os << "if (!(\n" << be_idt;
+
+ // Marshal each in and inout argument.
+ ctx = *this->ctx_;
+ ctx.state (TAO_CodeGen::TAO_OPERATION_ARG_INVOKE_CS);
+ ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
+ visitor = tao_cg->make_visitor (&ctx);
+
+ if (!visitor || (node->accept (visitor) == -1))
{
- AST_Decl *d = si->item ();
-
- if (d == 0)
- {
- delete si;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_scope::visit_scope - "
- "bad node in this scope\n"),
- -1);
-
- }
- be_decl *decl = be_decl::narrow_from_decl (d);
-
- be_visitor_context ctx (*this->ctx_);
- ctx.state (TAO_CodeGen::TAO_ARGUMENT_INVOKE_CS);
- ctx.sub_state (TAO_CodeGen::TAO_CDR_OUTPUT);
- be_visitor *visitor = tao_cg->make_visitor (&ctx);
-
- if (!visitor)
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "be_visitor_operation_amh_sh::"
- "visit_operation - "
- "Bad visitor to return type\n"),
- -1);
- }
-
- if (decl->accept (visitor) == -1)
- {
- delete visitor;
- ACE_ERROR_RETURN ((LM_ERROR,
- "(%N:%l) be_visitor_operation_sh::"
- "visit_operation - "
- "codegen for argument list failed\n"),
- -1);
- }
-
delete visitor;
- si->next ();
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "(%N:%l) be_compiled_visitor_operation_ss::"
+ "gen_demarshal_params - "
+ "codegen for demarshal failed\n"),
+ -1);
}
- }
-
- return 1;
+
+ *os << be_uidt_nl << "))"
+ << "ACE_THROW (CORBA::MARSHAL());" << be_nl << be_nl;
+ };
+
+ return 0;
}