Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_operation / tie_sh.cpp
blob39fb690509faad58434b655e8cd223b1c5ac52c7
2 //=============================================================================
3 /**
4 * @file tie_sh.cpp
6 * Visitor generating code for operations of the TIE class in the header
7 * file.
9 * @author Aniruddha Gokhale
11 //=============================================================================
13 #include "operation.h"
15 be_visitor_operation_tie_sh::be_visitor_operation_tie_sh (
16 be_visitor_context *ctx)
17 : be_visitor_scope (ctx)
21 be_visitor_operation_tie_sh::~be_visitor_operation_tie_sh ()
25 int
26 be_visitor_operation_tie_sh::visit_operation (be_operation *node)
28 /// These implied IDL operations are not to be processed on
29 /// the skeleton side.
30 if (node->is_sendc_ami ())
32 return 0;
35 TAO_OutStream *os = this->ctx_->stream ();
36 this->ctx_->node (node);
38 // STEP I: generate the return type.
39 be_type *bt = dynamic_cast<be_type*> (node->return_type ());
41 if (!bt)
43 ACE_ERROR_RETURN ((LM_ERROR,
44 "(%N:%l) be_visitor_operation_tie_sh::"
45 "visit_operation - "
46 "Bad return type\n"),
47 -1);
50 TAO_INSERT_COMMENT (os);
52 be_visitor_context ctx (*this->ctx_);
53 be_visitor_operation_rettype oro_visitor (&ctx);
55 if (bt->accept (&oro_visitor) == -1)
57 ACE_ERROR_RETURN ((LM_ERROR,
58 "(%N:%l) be_visitor_operation_tie_sh::"
59 "visit_operation - "
60 "codegen for return type failed\n"),
61 -1);
64 // STEP 2: generate the operation name.
65 *os << " " << this->ctx_->port_prefix ().c_str ()
66 << node->local_name ();
68 // STEP 3: generate the argument list with the appropriate mapping. For these
69 // we grab a visitor that generates the parameter listing
70 ctx = *this->ctx_;
71 // We use this state here as a flag to leave out the param names in the
72 // arglist, to avoid a possible clash with the TIE class template
73 // parameter name.
74 ctx.state (TAO_CodeGen::TAO_TIE_OPERATION_ARGLIST_SH);
75 be_visitor_operation_arglist oa_visitor (&ctx);
77 if (node->accept (&oa_visitor) == -1)
79 ACE_ERROR_RETURN ((LM_ERROR,
80 "(%N:%l) be_visitor_operation_tie_sh::"
81 "visit_operation - "
82 "codegen for argument list failed\n"),
83 -1);
86 return 0;