2 //=============================================================================
4 * @file operation_ih.cpp
6 * Visitor generating code for Operation in the implementation header
8 * @author Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
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 ()
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 ())
32 TAO_OutStream
*os
= this->ctx_
->stream ();
33 this->ctx_
->node (node
);
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 ());
50 ACE_ERROR_RETURN ((LM_ERROR
,
51 "(%N:%l) be_visitor_operation_ih::"
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::"
66 "codegen for return type failed\n"),
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
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::"
84 "codegen for argument list failed\n"),