Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_component / component_svts.cpp
blobfa96d5794987565a853337147f53768250b5f9ef
2 //=============================================================================
3 /**
4 * @file component_svts.cpp
6 * Visitor generating code for Components in the templated servant source.
8 * @author Marcel Smit
9 */
10 //=============================================================================
12 #include "component.h"
14 be_visitor_component_svts::be_visitor_component_svts (be_visitor_context *ctx)
15 : be_visitor_component (ctx),
16 os_ (*ctx->stream ()),
17 export_macro_ (be_global->svnt_export_macro ())
19 /// All existing CIAO examples set the servant export values in the CIDL
20 /// compiler to equal the IDL compiler's skel export values. Below is a
21 /// partial effort to decouple them, should be completely decoupled
22 /// sometime. See comment in codegen.cpp, line 1173.
23 if (export_macro_ == "")
25 export_macro_ = be_global->skel_export_macro ();
29 be_visitor_component_svts::~be_visitor_component_svts ()
33 int
34 be_visitor_component_svts::visit_component (be_component *node)
36 if (node->imported ())
38 return 0;
41 /// Use 'CIAO_' + component's flat name.
42 os_ << be_nl_2
43 << "namespace CIAO_" << node->flat_name ()
44 << "_Impl" << be_nl
45 << "{" << be_idt;
47 be_visitor_context_svts context_visitor (this->ctx_);
49 if (context_visitor.visit_component (node) == -1)
51 ACE_ERROR_RETURN ((LM_ERROR,
52 ACE_TEXT ("be_visitor_component_svts::")
53 ACE_TEXT ("visit_component - ")
54 ACE_TEXT ("context visitor failed\n")),
55 -1);
58 // be_visitor_servant_svs servant_visitor (this->ctx_);
60 // if (servant_visitor.visit_component (node) == -1)
61 // {
62 // ACE_ERROR_RETURN ((LM_ERROR,
63 // ACE_TEXT ("be_visitor_component_svts::")
64 // ACE_TEXT ("visit_component - ")
65 // ACE_TEXT ("servant visitor failed\n")),
66 // -1);
67 // }
69 os_ << be_uidt_nl
70 << "}";
72 return 0;
75 int
76 be_visitor_component_svts::visit_connector (be_connector *node)
78 return this->visit_component (node);