Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_interface / amh_ch.cpp
blob98ef62a49d4c727c8a5d3dd6e4133e0d994177c4
1 //=============================================================================
2 /**
3 * @file amh_ch.cpp
5 * Specialized interface visitor for AMH-RH generates code that is
6 * specific to AMH interfaces.
8 * @author Mayur Deshpande <mayur@ics.uci.edu>
9 */
10 //=============================================================================
12 #include "interface.h"
14 be_visitor_amh_interface_ch::be_visitor_amh_interface_ch (
15 be_visitor_context *ctx)
16 : be_visitor_interface (ctx)
20 be_visitor_amh_interface_ch::~be_visitor_amh_interface_ch ()
24 int
25 be_visitor_amh_interface_ch::visit_interface (be_interface *node)
27 // If not already generated and not imported.
28 if (node->cli_hdr_gen () || node->imported ())
30 return 0;
33 // This will be a no-op if it has already been done by a forward
34 // declaration.
35 node->gen_var_out_seq_decls ();
37 TAO_OutStream *os = this->ctx_->stream ();
39 // Now generate the class definition.
40 *os << "class " << be_global->stub_export_macro ()
41 << " " << node->local_name () << be_idt_nl
42 << ": " ;
44 // If node interface inherits from other interfaces.
45 if (node->n_inherits () > 0)
47 *os << be_idt;
49 for (int i = 0; i < node->n_inherits (); i++)
51 *os << "public virtual "
52 << node->inherits ()[i]->name ();
54 if (i < node->n_inherits () - 1)
56 // Node has multiple inheritance, so put a comma.
57 *os << "," << be_nl;
61 *os << be_uidt << be_uidt_nl;
63 else
65 // We do not inherit from anybody, hence we do so from the base
66 // CORBA::Object class.
67 *os << "public virtual ::CORBA::Object" << be_uidt_nl;
70 // Generate the body.
72 *os << "{" << be_nl
73 << "public:" << be_idt_nl
75 // Generate the _ptr_type and _var_type typedefs.
76 << "typedef " << node->local_name () << "_ptr _ptr_type;"
77 << be_nl
78 << "typedef " << node->local_name () << "_var _var_type;"
79 << be_nl
80 << "typedef " << node->local_name () << "_out _out_type;"
81 << be_nl;
83 // Generate code for the interface definition by traversing thru the
84 // elements of its scope. We depend on the front-end to have made sure
85 // that only legal syntactic elements appear in our scope.
87 if (this->visit_scope (node) == -1)
89 ACE_ERROR_RETURN ((LM_ERROR,
90 "(%N:%l) be_visitor_interface_ch::"
91 "visit_interface - "
92 "codegen for scope failed\n"), -1);
95 node->cli_hdr_gen (true);
96 return 0;