2
// any_op_ch.cpp,v 1.12 2002/09/25 16:25:37 parsons Exp
5
// ============================================================================
14
// Visitor generating code for Any operators for structures
19
// ============================================================================
21
ACE_RCSID (be_visitor_structure,
23
"any_op_ch.cpp,v 1.12 2002/09/25 16:25:37 parsons Exp")
25
// ***************************************************************************
26
// Structure visitor for generating Any operator declarations in the client header
27
// ***************************************************************************
29
be_visitor_structure_any_op_ch::be_visitor_structure_any_op_ch (
30
be_visitor_context *ctx
32
: be_visitor_structure (ctx)
36
be_visitor_structure_any_op_ch::~be_visitor_structure_any_op_ch (void)
41
be_visitor_structure_any_op_ch::visit_structure (be_structure *node)
43
if (node->cli_hdr_any_op_gen ()
49
TAO_OutStream *os = this->ctx_->stream ();
51
*os << be_nl << be_nl << "// TAO_IDL - Generated from" << be_nl
52
<< "// " << __FILE__ << ":" << __LINE__ << be_nl << be_nl;
54
*os << be_global->stub_export_macro () << " void"
55
<< " operator<<= (CORBA::Any &, const " << node->name ()
56
<< " &); // copying version" << be_nl;
57
*os << be_global->stub_export_macro () << " void"
58
<< " operator<<= (CORBA::Any &, " << node->name ()
59
<< "*); // noncopying version" << be_nl;
60
*os << be_global->stub_export_macro () << " CORBA::Boolean"
61
<< " operator>>= (const CORBA::Any &, "
62
<< node->name () << " *&); // deprecated\n";
63
*os << be_global->stub_export_macro () << " CORBA::Boolean"
64
<< " operator>>= (const CORBA::Any &, const "
65
<< node->name () << " *&);";
68
// All we have to do is to visit the scope and generate code.
69
if (this->visit_scope (node) == -1)
71
ACE_ERROR_RETURN ((LM_ERROR,
72
"(%N:%l) be_visitor_structure::visit_structure - "
73
"codegen for scope failed\n"),
77
node->cli_hdr_any_op_gen (1);
82
be_visitor_structure_any_op_ch::visit_field (be_field *node)
86
// First generate the type information.
87
bt = be_type::narrow_from_decl (node->field_type ());
91
ACE_ERROR_RETURN ((LM_ERROR,
92
"(%N:%l) be_visitor_structure_any_op_ch::"
98
if (bt->accept (this) == -1)
100
ACE_ERROR_RETURN ((LM_ERROR,
101
"(%N:%l) be_visitor_structure_any_op_ch::"
103
"codegen for field type failed\n"),
111
be_visitor_structure_any_op_ch::visit_union (be_union *node)
113
if (node->cli_hdr_any_op_gen ()
114
|| node->imported ())
119
be_visitor_union_any_op_ch visitor (this->ctx_);
121
if (node->accept (&visitor) == -1)
123
ACE_ERROR_RETURN ((LM_ERROR,
124
"(%N:%l) be_visitor_structure_any_op_ch::"
126
"codegen for field type failed\n"),
134
be_visitor_structure_any_op_ch::visit_enum (be_enum *node)
136
if (node->cli_hdr_any_op_gen ()
137
|| node->imported ())
142
be_visitor_enum_any_op_ch visitor (this->ctx_);
144
if (node->accept (&visitor) == -1)
146
ACE_ERROR_RETURN ((LM_ERROR,
147
"(%N:%l) be_visitor_structure_any_op_ch::"
149
"codegen for field type failed\n"),