Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_root / root_sh.cpp
blob86a90fb6c77d3afea7e2031d5ef74f8f1a27723c
2 //=============================================================================
3 /**
4 * @file root_sh.cpp
6 * Visitor generating code for Root in the server header
8 * @author Aniruddha Gokhale
9 */
10 //=============================================================================
12 #include "root.h"
14 be_visitor_root_sh::be_visitor_root_sh (be_visitor_context *ctx)
15 : be_visitor_root (ctx)
19 be_visitor_root_sh::~be_visitor_root_sh ()
23 int
24 be_visitor_root_sh::visit_root (be_root *node)
26 if (this->init () == -1)
28 ACE_ERROR_RETURN ((LM_ERROR,
29 ACE_TEXT ("be_visitor_root_sh::init - ")
30 ACE_TEXT ("failed to initialize\n")),
31 -1);
34 if (be_global->gen_arg_traits ())
36 if (this->gen_arg_traits (node) == -1)
38 /// Error message already output.
39 return -1;
43 /// The SI and SS cases are caught in BE_produce(). We
44 /// want to generate an empty skeleton header file, which
45 /// has been done, so -SS can flag a skip of the scope
46 /// traversal, but we want to generate the skeleton
47 /// end-of-header file stuff, so we don't bail completely.
48 if (be_global->gen_skel_files ())
50 if (this->visit_scope (node) == -1)
52 ACE_ERROR_RETURN ((LM_ERROR,
53 ACE_TEXT ("be_visitor_root_sh::visit_root - ")
54 ACE_TEXT ("codegen for scope failed\n")),
55 -1);
59 (void) tao_cg->end_server_header ();
61 return 0;
64 int
65 be_visitor_root_sh::init ()
67 /// First open the server-side file for writing
68 int status =
69 tao_cg->start_server_header (
70 be_global->be_get_server_hdr_fname ());
72 if (status == -1)
74 ACE_ERROR_RETURN ((LM_ERROR,
75 ACE_TEXT ("be_visitor_root_sh::init - ")
76 ACE_TEXT ("Error opening server header file\n")),
77 -1);
80 /// Initialize the stream.
81 this->ctx_->stream (tao_cg->server_header ());
82 return 0;
85 int
86 be_visitor_root_sh::gen_arg_traits (be_root *node)
88 be_visitor_context ctx = *this->ctx_;
89 be_visitor_arg_traits arg_visitor ("S", &ctx);
90 int status = node->accept (&arg_visitor);
92 if (status == -1)
94 ACE_ERROR_RETURN ((LM_ERROR,
95 ACE_TEXT ("be_visitor_root_sh::")
96 ACE_TEXT ("gen_arg_traits - failed to ")
97 ACE_TEXT ("generate skeleton arg traits\n")),
98 -1);
101 return 0;