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_svth.cpp
blob50aa72bc27406f3f9b8fb4044e361b7488adb610
2 //=============================================================================
3 /**
4 * @file component_svth.cpp
6 * Visitor generating code for Components in the servant header.
8 * @author Marcel Smit
9 */
10 //=============================================================================
12 #include "component.h"
14 be_visitor_component_svth::be_visitor_component_svth (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_svth::~be_visitor_component_svth ()
33 int
34 be_visitor_component_svth::visit_component (be_component *node)
36 if (node->imported ())
38 return 0;
41 /// Fills in the node's has_* members, for use in minimizing
42 /// code generation.
43 node->scan (node);
45 /// Use 'CIAO_' + component's flat name.
46 os_ << be_nl_2
47 << "namespace CIAO_" << node->flat_name ()
48 << "_Impl" << be_nl
49 << "{" << be_idt;
51 // Generate the context class declaration.
52 be_visitor_context_svth context_visitor (this->ctx_);
54 if (context_visitor.visit_component (node) == -1)
56 ACE_ERROR_RETURN ((LM_ERROR,
57 ACE_TEXT ("be_visitor_component_svth::")
58 ACE_TEXT ("visit_component - ")
59 ACE_TEXT ("context visitor failed\n")),
60 -1);
62 // // Generate the servant class declaration.
63 // be_visitor_servant_svh servant_visitor (this->ctx_);
65 // if (servant_visitor.visit_component (node) == -1)
66 // {
67 // ACE_ERROR_RETURN ((LM_ERROR,
68 // ACE_TEXT ("be_visitor_component_svth::")
69 // ACE_TEXT ("visit_component - ")
70 // ACE_TEXT ("servant visitor failed\n")),
71 // -1);
72 // }
74 os_ << be_uidt_nl
75 << "}";
77 return 0;
80 int
81 be_visitor_component_svth::visit_connector (be_connector *node)
83 return this->visit_component (node);