Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_root / root_svth.cpp
blobe235b9255c241a0d44e814091f5d4d83ef816f6a
2 //=============================================================================
3 /**
4 * @file root_svth.cpp
6 * Visitor generating code for Root in the CIAO template servant header
8 * @author Marcel Smit
9 */
10 //=============================================================================
12 #include "root.h"
14 be_visitor_root_svth::be_visitor_root_svth (be_visitor_context *ctx)
15 : be_visitor_root (ctx)
19 be_visitor_root_svth::~be_visitor_root_svth ()
23 int
24 be_visitor_root_svth::visit_root (be_root *node)
26 if (this->init () == -1)
28 ACE_ERROR_RETURN ((LM_ERROR,
29 ACE_TEXT ("be_visitor_root_svth::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_svth::visit_root - ")
38 ACE_TEXT ("codegen for scope failed\n")),
39 -1);
42 (void) tao_cg->end_ciao_svnt_template_header ();
44 return 0;
47 int
48 be_visitor_root_svth::init ()
50 /// First open the file for writing.
51 int const status =
52 tao_cg->start_ciao_svnt_template_header (
53 be_global->be_get_ciao_tmpl_svnt_hdr_fname ());
55 if (status == -1)
57 ACE_ERROR_RETURN ((LM_ERROR,
58 ACE_TEXT ("be_visitor_root_svth::init - ")
59 ACE_TEXT ("Error opening CIAO servant ")
60 ACE_TEXT ("header file\n")),
61 -1);
64 /// Initialize the stream.
65 this->ctx_->stream (tao_cg->ciao_svnt_template_header ());
67 return 0;