Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_root / root_ss.cpp
blob7155616850e82b328a9e8d3184c8b733cd714c75
2 //=============================================================================
3 /**
4 * @file root_ss.cpp
6 * Visitor generating code for the Root in the server skeletons file
8 * @author Aniruddha Gokhale
9 */
10 //=============================================================================
12 #include "root.h"
14 be_visitor_root_ss::be_visitor_root_ss (be_visitor_context *ctx)
15 : be_visitor_root (ctx)
19 be_visitor_root_ss::~be_visitor_root_ss (void)
23 int
24 be_visitor_root_ss::visit_root (be_root *node)
26 if (this->init () == -1)
28 ACE_ERROR_RETURN ((LM_ERROR,
29 ACE_TEXT ("be_visitor_root_ss::init - ")
30 ACE_TEXT ("failed to initialize\n")),
31 -1);
34 if (this->visit_scope (node) == -1)
36 ACE_ERROR_RETURN ((LM_ERROR,
37 ACE_TEXT ("be_visitor_root_ss::visit_root - ")
38 ACE_TEXT ("codegen for scope failed\n")),
39 -1);
42 if (be_global->gen_tie_classes ())
44 (void) tao_cg->end_server_template_skeletons ();
47 (void) tao_cg->end_server_skeletons ();
49 return 0;
52 int
53 be_visitor_root_ss::init (void)
55 /// First open the server-side file for writing
56 int status =
57 tao_cg->start_server_skeletons (
58 be_global->be_get_server_skeleton_fname ());
60 if (status == -1)
62 ACE_ERROR_RETURN ((LM_ERROR,
63 ACE_TEXT ("be_visitor_root_ss::init - ")
64 ACE_TEXT ("Error opening server header file\n")),
65 -1);
68 if (be_global->gen_tie_classes ())
70 status =
71 tao_cg->start_server_template_skeletons (
72 be_global->be_get_server_template_skeleton_fname ());
74 if (status == -1)
76 ACE_ERROR_RETURN ((LM_ERROR,
77 ACE_TEXT ("be_visitor_root_ss::init - ")
78 ACE_TEXT ("Error opening server ")
79 ACE_TEXT ("template skeleton file\n")),
80 -1);
84 // set stream
85 this->ctx_->stream (tao_cg->server_skeletons ());
86 return 0;