2 //=============================================================================
4 * @file component_exh.cpp
6 * Visitor generating code for Components in the exec impl header.
10 //=============================================================================
12 #include "component.h"
14 be_visitor_component_exh::be_visitor_component_exh (
15 be_visitor_context
*ctx
)
16 : be_visitor_component_scope (ctx
)
18 // This is initialized in the base class to svnt_export_macro()
19 // or skel_export_macro(), since there are many more visitor
20 // classes generating servant code. So we can just override
22 export_macro_
= be_global
->exec_export_macro ();
25 be_visitor_component_exh::~be_visitor_component_exh ()
30 be_visitor_component_exh::visit_component (be_component
*node
)
32 if (node
->imported ())
39 /// Use 'CIAO_' + component's flat name.
41 << "/// Namespace for implementation of " << node
->full_name () << " component" << be_nl
42 << "namespace CIAO_" << node
->flat_name ()
46 be_visitor_facet_exh
facet_visitor (this->ctx_
);
47 facet_visitor
.node (node
);
49 if (facet_visitor
.visit_component_scope (node
) == -1)
51 ACE_ERROR_RETURN ((LM_ERROR
,
52 ACE_TEXT ("be_visitor_component_exh::")
53 ACE_TEXT ("visit_component - ")
54 ACE_TEXT ("facet visitor failed\n")),
58 be_visitor_executor_exh
exec_visitor (this->ctx_
);
60 if (exec_visitor
.visit_component (node
) == -1)
62 ACE_ERROR_RETURN ((LM_ERROR
,
63 ACE_TEXT ("be_visitor_component_exh::")
64 ACE_TEXT ("visit_component - ")
65 ACE_TEXT ("exec visitor failed\n")),
69 /// If this list has members, then we can assume that the
70 /// artifacts from -GC exist.
71 for (ACE_Unbounded_Queue
<char *>::CONST_ITERATOR
i (
72 idl_global
->ciao_ami_recep_names ());
76 char **item
= nullptr;
80 FE_Utils::string_to_scoped_name (*item
);
83 idl_global
->scopes ().top_non_null ();
85 AST_Decl
*d
= s
->lookup_by_name (sn
, true);
89 idl_global
->err ()->lookup_error (sn
);
102 be_uses
*u
= dynamic_cast<be_uses
*> (d
);
106 ACE_ERROR_RETURN ((LM_ERROR
,
107 ACE_TEXT ("be_visitor_component_exh")
108 ACE_TEXT ("::visit_component - ")
109 ACE_TEXT ("narrow to AMI receptacle ")
110 ACE_TEXT ("failed\n")),
115 dynamic_cast<be_component
*> (
116 ScopeAsDecl (u
->defined_in ()));
120 be_visitor_context
ctx (*this->ctx_
);
121 be_visitor_component_ami_rh_exh
ami_rh_visitor (&ctx
);
123 if (ami_rh_visitor
.visit_uses (u
) == -1)
125 ACE_ERROR_RETURN ((LM_ERROR
,
126 ACE_TEXT ("be_visitor_component_exh")
127 ACE_TEXT ("::visit_component - ")
128 ACE_TEXT ("AMI reply handler generation ")
129 ACE_TEXT ("failed\n")),
135 this->gen_exec_entrypoint_decl ();