Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_interface / facet_svth.cpp
blob3dca9ccc316b7ee70e9a607fd1cb286269f3f9bf
2 //=============================================================================
3 /**
4 * @file facet_svth.cpp
6 * Visitor generating code for a facet servant class in the
7 * servant header.
9 * @author Jeff Parsons
11 //=============================================================================
13 #include "interface.h"
15 be_visitor_facet_svth::be_visitor_facet_svth (be_visitor_context *ctx)
16 : be_visitor_interface (ctx)
20 be_visitor_facet_svth::~be_visitor_facet_svth ()
24 int
25 be_visitor_facet_svth::visit_interface (be_interface *node)
27 if (node->imported () ||
28 node->svnt_src_facet_gen () ||
29 idl_global->ami_connector_seen_ ||
30 node->original_interface () ||
31 node->is_local ())
33 return 0;
36 const char *lname = node->local_name ();
38 be_decl *scope =
39 dynamic_cast<be_scope*> (node->defined_in ())->decl ();
40 ACE_CString suffix (scope->flat_name ());
42 if (suffix != "")
44 suffix = ACE_CString ("_") + suffix;
47 os_ << be_nl_2
48 << "namespace CIAO_FACET" << suffix.c_str () << be_nl
49 << "{" << be_idt_nl;
51 bool is_intf = node->node_type () == AST_Decl::NT_interface;
53 os_ << "template <typename BASE, typename EXEC, typename CONTEXT>" << be_nl
54 << "class " << lname << "_Servant_T" << be_idt_nl
55 << ": public ::CIAO::Facet_Servant_Base_T<BASE, EXEC, "
56 << "CONTEXT>" << be_uidt_nl << "{" << be_nl
57 << "public:" << be_idt_nl;
59 AST_Decl *s = ScopeAsDecl (node->defined_in ());
60 ACE_CString sname_str (s->full_name ());
62 os_ << lname << "_Servant_T (" << be_idt_nl
63 << "typename EXEC::_ptr_type executor," << be_nl
64 << "::Components::CCMContext_ptr ctx);" << be_uidt_nl << be_nl;
66 os_ << "virtual ~" << lname << "_Servant_T ();";
68 if (is_intf)
70 be_interface *intf =
71 dynamic_cast<be_interface*> (node);
73 be_global->in_facet_servant (true);
75 int status =
76 intf->traverse_inheritance_graph (
77 be_interface::op_attr_decl_helper,
78 &os_);
80 be_global->in_facet_servant (false);
82 if (status == -1)
84 ACE_ERROR_RETURN ((LM_ERROR,
85 ACE_TEXT ("be_provides::gen_facet - ")
86 ACE_TEXT ("traverse_inheritance_graph()")
87 ACE_TEXT (" failed\n")),
88 -1);
92 os_ << be_uidt_nl << "};" << be_nl << be_uidt_nl;
94 os_ << "}";
96 node->svnt_hdr_facet_gen (true);
97 return 0;