2 //=============================================================================
4 * @file component_exs.cpp
6 * Visitor generating code for Components in the exec impl source.
10 //=============================================================================
12 #include "component.h"
14 be_visitor_component_exs::be_visitor_component_exs (
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_exs::~be_visitor_component_exs ()
30 be_visitor_component_exs::visit_component (be_component
*node
)
32 if (node
->imported ())
39 /// Use 'CIAO_' + component's flat name.
41 << "namespace CIAO_" << node
->flat_name ()
45 be_visitor_facet_exs
facet_visitor (this->ctx_
);
46 facet_visitor
.node (node
);
48 if (facet_visitor
.visit_component_scope (node
) == -1)
50 ACE_ERROR_RETURN ((LM_ERROR
,
51 ACE_TEXT ("be_visitor_component_exs::")
52 ACE_TEXT ("visit_component - ")
53 ACE_TEXT ("facet visitor failed\n")),
57 be_visitor_executor_exs
exec_visitor (this->ctx_
);
58 exec_visitor
.node (node
);
60 if (exec_visitor
.visit_component (node
) == -1)
62 ACE_ERROR_RETURN ((LM_ERROR
,
63 ACE_TEXT ("be_visitor_component_exs::")
64 ACE_TEXT ("visit_component - ")
65 ACE_TEXT ("exec visitor failed\n")),
69 /// Generate the empty ops for the AMI4CCM reply handlers,
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_exs")
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_exs
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_exs")
127 ACE_TEXT ("::visit_component - ")
128 ACE_TEXT ("AMI reply handler generation ")
129 ACE_TEXT ("failed\n")),
135 this->gen_exec_entrypoint_defn ();
143 // ==================================================
145 Component_Exec_Op_Attr_Generator::Component_Exec_Op_Attr_Generator (
146 be_visitor_scope
* visitor
)
152 Component_Exec_Op_Attr_Generator::emit (be_interface
* /*derived_interface */,
153 TAO_OutStream
* /* os */,
154 be_interface
* base_interface
)
156 AST_Decl::NodeType nt
= base_interface
->node_type ();
158 if (nt
== AST_Decl::NT_component
|| nt
== AST_Decl::NT_connector
)
163 return visitor_
->visit_scope (base_interface
);