1
// operation_is.cpp,v 1.11 2003/06/09 18:58:19 parsons Exp
3
// ============================================================================
12
// Visitor generating code for Operation in the implementation skeleton
15
// Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
17
// ============================================================================
19
ACE_RCSID (be_visitor_operation,
21
"operation_is.cpp,v 1.11 2003/06/09 18:58:19 parsons Exp")
23
// ************************************************************
24
// Operation visitor for implementation skeleton
25
// ************************************************************
27
be_visitor_operation_is::be_visitor_operation_is (be_visitor_context *ctx)
28
: be_visitor_operation (ctx)
32
be_visitor_operation_is::~be_visitor_operation_is (void)
37
be_visitor_operation_is::visit_operation (be_operation *node)
39
TAO_OutStream *os = this->ctx_->stream ();
40
be_interface *intf = this->ctx_->interface ();
42
this->ctx_->node (node); // save the node
44
// STEP I: generate the return type
45
be_type *bt = be_type::narrow_from_decl (node->return_type ());
49
ACE_ERROR_RETURN ((LM_ERROR,
50
"(%N:%l) be_visitor_operation_is::"
56
*os << "// TAO_IDL - Generated from" << be_nl
57
<< "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
59
be_visitor_context ctx (*this->ctx_);
60
be_visitor_operation_rettype oro_visitor (&ctx);
62
if (bt->accept (&oro_visitor) == -1)
64
ACE_ERROR_RETURN ((LM_ERROR,
65
"(%N:%l) be_visitor_operation_is::"
67
"codegen for return type failed\n"),
71
const char *classname = 0;
76
classname = intf->flat_name ();
80
classname = ScopeAsDecl (node->defined_in ())->flat_name ();
83
// STEP 2: generate the operation name
84
*os << " " << be_global->impl_class_prefix () << classname
85
<< be_global->impl_class_suffix () << "::" << node->local_name ();
87
// STEP 3: generate the argument list with the appropriate mapping. For these
88
// we grab a visitor that generates the parameter listing
90
ctx.state (TAO_CodeGen::TAO_OPERATION_ARGLIST_IS);
91
be_visitor_operation_arglist oa_visitor (&ctx);
93
if (node->accept (&oa_visitor) == -1)
95
ACE_ERROR_RETURN ((LM_ERROR,
96
"(%N:%l) be_visitor_operation_is::"
98
"codegen for argument list failed\n"),
102
*os << be_nl << "{" << be_idt_nl;
103
*os << "// Add your implementation here" << be_uidt_nl;
104
*os << "}" << be_nl << be_nl;