summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-02-04 16:48:59 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-02-04 16:48:59 +0000
commit2113994d0fae30e859524c598741398e7344b774 (patch)
tree10489250153b54a62f537bca7ca6367bbfd61dda /TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp
parentede7cd6ae4c318bd1769e5441aa17a28eeacb851 (diff)
downloadATCD-2113994d0fae30e859524c598741398e7344b774.tar.gz
ChangeLogTag: Mon Feb 4 10:47:52 2002 Jeff Parsons <parsons@cs.wustl.edu>
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp88
1 files changed, 65 insertions, 23 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp
index 73a0a577385..f0e40e41975 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/amh_ss.cpp
@@ -16,7 +16,9 @@
#include "be_visitor_operation.h"
-be_visitor_amh_operation_ss::be_visitor_amh_operation_ss (be_visitor_context *ctx)
+be_visitor_amh_operation_ss::be_visitor_amh_operation_ss (
+ be_visitor_context *ctx
+ )
: be_visitor_operation (ctx)
{
}
@@ -30,13 +32,17 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node)
{
// If there is an argument of type "native", return immediately.
if (node->has_native ())
- return 0;
+ {
+ return 0;
+ }
TAO_OutStream *os = this->ctx_->stream ();
this->ctx_->node (node);
if (this->generate_shared_prologue (node, os, "") == -1)
- return -1;
+ {
+ return -1;
+ }
int argument_count =
node->count_arguments_with_direction (AST_Argument::dir_IN
@@ -60,7 +66,9 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node)
if (argument == 0
|| argument->direction () == AST_Argument::dir_OUT)
- continue;
+ {
+ continue;
+ }
if (vardecl_visitor.visit_argument (argument) == -1)
{
@@ -72,7 +80,6 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node)
}
}
-
*os << be_nl
<< "TAO_InputCDR &_tao_in ="
<< " _tao_server_request.incoming ();\n" << be_nl
@@ -92,9 +99,12 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node)
{
be_argument *argument =
be_argument::narrow_from_decl (sj.item ());
+
if (argument == 0
|| argument->direction () == AST_Argument::dir_OUT)
- continue;
+ {
+ continue;
+ }
*os << "&& ";
@@ -106,6 +116,7 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node)
"codegen for demarshal failed\n"),
-1);
}
+
*os << be_nl;
}
@@ -120,11 +131,14 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node)
"(%N:%l) gen_raise_exception failed\n"),
-1);
}
+
*os << be_uidt << "\n";
}
if (this->generate_shared_section (node, os) == -1)
- return -1;
+ {
+ return -1;
+ }
{
be_visitor_context ctx (*this->ctx_);
@@ -138,11 +152,15 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node)
{
be_argument *argument =
be_argument::narrow_from_decl (i.item ());
+
if (argument == 0
|| argument->direction () == AST_Argument::dir_OUT)
- continue;
+ {
+ continue;
+ }
*os << ",";
+
if (argument->accept (&visitor) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
@@ -151,13 +169,17 @@ be_visitor_amh_operation_ss::visit_operation (be_operation *node)
"codegen for upcall args failed\n"),
-1);
}
+
*os << be_nl;
}
+
*os << "ACE_ENV_ARG_PARAMETER";
}
if (this->generate_shared_epilogue (os) == -1)
- return -1;
+ {
+ return -1;
+ }
return 0;
@@ -170,33 +192,43 @@ be_visitor_amh_operation_ss::visit_attribute (be_attribute *node)
this->ctx_->node (node);
if (this->generate_shared_prologue (node, os, "_get_") == -1)
- return -1;
+ {
+ return -1;
+ }
if (this->generate_shared_section (node, os) == -1)
- return -1;
+ {
+ return -1;
+ }
*os << "ACE_ENV_ARG_PARAMETER";
if (this->generate_shared_epilogue (os) == -1)
- return -1;
+ {
+ return -1;
+ }
if (node->readonly ())
- return 0;
+ {
+ return 0;
+ }
if (this->generate_shared_prologue (node, os, "_set_") == -1)
- return -1;
+ {
+ return -1;
+ }
be_argument the_argument (AST_Argument::dir_IN,
node->field_type (),
node->name ());
- {
be_visitor_context ctx (*this->ctx_);
be_visitor_args_vardecl_ss visitor (&ctx);
if (visitor.visit_argument (&the_argument) == -1)
- return -1;
- }
+ {
+ return -1;
+ }
*os << be_nl
<< "TAO_InputCDR &_tao_in ="
@@ -211,7 +243,9 @@ be_visitor_amh_operation_ss::visit_attribute (be_attribute *node)
be_visitor_args_marshal_ss visitor (&ctx);
if (visitor.visit_argument (&the_argument) == -1)
- return -1;
+ {
+ return -1;
+ }
}
*os << be_uidt_nl << "))" << be_idt_nl;
@@ -225,16 +259,21 @@ be_visitor_amh_operation_ss::visit_attribute (be_attribute *node)
"(%N:%l) gen_raise_exception failed\n"),
-1);
}
+
*os << be_uidt << "\n";
if (this->generate_shared_section (node, os) == -1)
- return -1;
+ {
+ return -1;
+ }
*os << ", " << node->local_name ()
<< be_nl << "ACE_ENV_ARG_PARAMETER";
if (this->generate_shared_epilogue (os) == -1)
- return -1;
+ {
+ return -1;
+ }
return 0;
}
@@ -267,7 +306,8 @@ be_visitor_amh_operation_ss::generate_shared_prologue (be_decl *node,
intf->compute_full_name ("AMH_", "", buf);
ACE_CString amh_skel_name ("POA_");
amh_skel_name += buf;
- delete[] buf;
+ delete [] buf;
+ buf = 0;
os->indent ();
*os << "void" << be_nl
@@ -306,12 +346,14 @@ be_visitor_amh_operation_ss::generate_shared_section (be_decl *node,
char *buf;
intf->compute_full_name ("AMH_", "ResponseHandler", buf);
ACE_CString response_handler_name (buf);
- delete[] buf;
+ delete [] buf;
+ buf = 0;
intf->compute_full_name ("TAO_AMH_", "ResponseHandler", buf);
ACE_CString response_handler_implementation_name ("POA_");
response_handler_implementation_name += buf;
- delete[] buf;
+ delete [] buf;
+ buf = 0;
*os << be_nl << response_handler_name.c_str ()
<< "_var _tao_rh =" << be_idt_nl