2 //=============================================================================
6 * Visitor generating code for a facet servant class in the
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 ()
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 () ||
36 const char *lname
= node
->local_name ();
39 dynamic_cast<be_scope
*> (node
->defined_in ())->decl ();
40 ACE_CString
suffix (scope
->flat_name ());
44 suffix
= ACE_CString ("_") + suffix
;
48 << "namespace CIAO_FACET" << suffix
.c_str () << be_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 ();";
71 dynamic_cast<be_interface
*> (node
);
73 be_global
->in_facet_servant (true);
76 intf
->traverse_inheritance_graph (
77 be_interface::op_attr_decl_helper
,
80 be_global
->in_facet_servant (false);
84 ACE_ERROR_RETURN ((LM_ERROR
,
85 ACE_TEXT ("be_provides::gen_facet - ")
86 ACE_TEXT ("traverse_inheritance_graph()")
87 ACE_TEXT (" failed\n")),
92 os_
<< be_uidt_nl
<< "};" << be_nl
<< be_uidt_nl
;
96 node
->svnt_hdr_facet_gen (true);