Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_union / union_ci.cpp
blob09d5c0df80b95690eeb5dd5332a8d932dc2d5b80
2 //=============================================================================
3 /**
4 * @file union_ci.cpp
6 * Visitor generating code for Union in the client inline file
8 * @author Aniruddha Gokhale
9 */
10 //=============================================================================
12 #include "union.h"
14 be_visitor_union_ci::be_visitor_union_ci (be_visitor_context *ctx)
15 : be_visitor_union (ctx)
19 be_visitor_union_ci::~be_visitor_union_ci ()
23 int be_visitor_union_ci::visit_union (be_union *node)
25 if (node->cli_inline_gen () || node->imported ())
27 return 0;
30 be_visitor_context ctx (*this->ctx_);
31 ctx.node (node);
33 TAO_OutStream *os = this->ctx_->stream ();
35 TAO_INSERT_COMMENT (os);
37 *os << "// *************************************************************"
38 << be_nl;
39 *os << "// Inline operations for union " << node->name () << be_nl;
40 *os << "// *************************************************************";
42 // the discriminant type may have to be defined here if it was an enum
43 // declaration inside of the union statement.
45 be_type *bt = dynamic_cast<be_type*> (node->disc_type ());
47 if (!bt)
49 ACE_ERROR_RETURN ((LM_ERROR,
50 "(%N:%l) be_visitor_union_ci::"
51 "visit_union - "
52 "bad discriminant type\n"),
53 -1);
56 be_visitor_union_discriminant_ci visitor (&ctx);
58 if (bt->accept (&visitor) == -1)
60 ACE_ERROR_RETURN ((LM_ERROR,
61 "(%N:%l) be_visitor_union_ci::"
62 "visit union - "
63 "codegen for discrminant failed\n"),
64 -1);
67 // Now generate the implementation of the access methods for the
68 // union. For this set our state.
69 if (this->visit_scope (node) == -1)
71 ACE_ERROR_RETURN ((LM_ERROR,
72 "(%N:%l) be_visitor_union_ci::"
73 "visit_union - "
74 "codegen for scope failed\n"),
75 -1);
78 node->cli_inline_gen (true);
79 return 0;