2
// cdr_op_ci.cpp,v 1.6 2002/09/28 02:35:42 parsons Exp
5
// ================================================================
14
// Visitor generating code for CDR operators for forward
15
// declarations of valuetypes. This uses compiled marshaling.
18
// Torsten Kuepper based on code from
19
// Aniruddha Gokhale & Carlos O'Ryan (cdr_op_ci.cpp)
21
// ================================================================
23
ACE_RCSID (be_visitor_valuetype_fwd,
25
"cdr_op_ci.cpp,v 1.6 2002/09/28 02:35:42 parsons Exp")
27
// ****************************************************************
28
// Interface visitor for generating CDR operator declarations in the
30
// ****************************************************************
32
be_visitor_valuetype_fwd_cdr_op_ci::be_visitor_valuetype_fwd_cdr_op_ci (
33
be_visitor_context *ctx
35
: be_visitor_decl (ctx)
39
be_visitor_valuetype_fwd_cdr_op_ci::~be_visitor_valuetype_fwd_cdr_op_ci (
46
be_visitor_valuetype_fwd_cdr_op_ci::visit_valuetype_fwd (
47
be_valuetype_fwd *node
50
AST_Interface *fd = node->full_definition ();
51
be_valuetype *bfd = be_valuetype::narrow_from_decl (fd);
53
// Check if it's imported vt or CDR ops already generated.
54
if (node->cli_inline_cdr_op_gen () || node->imported ())
59
// Is we are defined leater then let the real VT to generate
61
if (bfd->is_defined ())
66
// Generate helper functions declaration.
67
if (bfd->gen_helper_inline () == -1)
69
ACE_ERROR_RETURN ((LM_ERROR,
70
"(%N:%l) be_visitor_valuetype_cdr_op_ch::"
72
"codegen for helper functions failed\n"), -1);
75
TAO_OutStream *os = this->ctx_->stream ();
77
// generate the CDR << and >> operator declarations (prototypes)
79
//@@ Boris: Can I move this to be_valuetype? (as with _var, _out, etc?)
81
*os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
82
<< "// " << __FILE__ << ":" << __LINE__
85
//This is just declaration so no ACE_INLINE
86
*os << be_global->stub_export_macro ()
87
<< " CORBA::Boolean operator<< (TAO_OutputCDR &, const "
88
<< node->full_name () << " *);" << be_nl;
90
*os << be_global->stub_export_macro ()
91
<< " CORBA::Boolean operator>> (TAO_InputCDR &, "
92
<< node->full_name () << " *&);";
95
node->cli_inline_cdr_op_gen (I_TRUE);