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 / operation_ih.cpp
blobf72f65c46d481e5794d7040a1a6e72b3534b7cf2
2 //=============================================================================
3 /**
4 * @file operation_ih.cpp
6 * Visitor generating code for Operation in the implementation header
8 * @author Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
9 */
10 //=============================================================================
12 #include "operation.h"
14 be_visitor_operation_ih::be_visitor_operation_ih (be_visitor_context *ctx)
15 : be_visitor_operation (ctx)
19 be_visitor_operation_ih::~be_visitor_operation_ih ()
23 int
24 be_visitor_operation_ih::visit_operation (be_operation *node)
26 // Impl classes shouldn't have implied AMI operations.
27 if (node->is_sendc_ami ())
29 return 0;
32 TAO_OutStream *os = this->ctx_->stream ();
33 this->ctx_->node (node);
35 *os << be_nl_2;
37 if (be_global->gen_impl_debug_info ())
39 TAO_INSERT_COMMENT (os);
42 // every operation is declared virtual in the client code
43 *os << "virtual" << be_nl;
45 // STEP I: generate the return type
46 be_type *bt = dynamic_cast<be_type*> (node->return_type ());
48 if (!bt)
50 ACE_ERROR_RETURN ((LM_ERROR,
51 "(%N:%l) be_visitor_operation_ih::"
52 "visit_operation - "
53 "Bad return type\n"),
54 -1);
57 // grab the right visitor to generate the return type
58 be_visitor_context ctx (*this->ctx_);
59 be_visitor_operation_rettype oro_visitor (&ctx);
61 if (bt->accept (&oro_visitor) == -1)
63 ACE_ERROR_RETURN ((LM_ERROR,
64 "(%N:%l) be_visitor_operation_ih::"
65 "visit_operation - "
66 "codegen for return type failed\n"),
67 -1);
70 // STEP 2: generate the operation name
71 *os << " " << node->local_name ();
73 // STEP 3: generate the argument list with the appropriate mapping. For these
74 // we grab a visitor that generates the parameter listing
75 ctx = *this->ctx_;
76 ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_IH);
77 be_visitor_operation_arglist oa_visitor (&ctx);
79 if (node->accept (&oa_visitor) == -1)
81 ACE_ERROR_RETURN ((LM_ERROR,
82 "(%N:%l) be_visitor_operation_ih::"
83 "visit_operation - "
84 "codegen for argument list failed\n"),
85 -1);
88 return 0;