Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_root / root_is.cpp
blob59cf3774f95750c55e51b6a760ef27f20b323637
1 //=============================================================================
2 /**
3 * @file root_is.cpp
5 * Visitor generating code for the Root in the implementation skeletons file
7 * @author Yamuna Krishnamurthy (yamuna@cs.wustl.edu)
8 */
9 //=============================================================================
11 #include "root.h"
13 be_visitor_root_is::be_visitor_root_is (be_visitor_context *ctx)
14 : be_visitor_root (ctx)
18 be_visitor_root_is::~be_visitor_root_is ()
22 int
23 be_visitor_root_is::visit_root (be_root *node)
25 if (this->init () == -1)
27 ACE_ERROR_RETURN ((LM_ERROR,
28 ACE_TEXT ("be_visitor_root_is::init - ")
29 ACE_TEXT ("failed to initialize\n")),
30 -1);
33 if (this->visit_scope (node) == -1)
35 ACE_ERROR_RETURN ((LM_ERROR,
36 ACE_TEXT ("be_visitor_root_is::visit_root - ")
37 ACE_TEXT ("codegen for scope failed\n")),
38 -1);
41 return 0;
44 int
45 be_visitor_root_is::init ()
47 /// First open the file for writing.
48 int status =
49 tao_cg->start_implementation_skeleton (
50 be_global->be_get_implementation_skel_fname ());
52 if (status == -1)
54 ACE_ERROR_RETURN ((LM_ERROR,
55 ACE_TEXT ("be_visitor_root_is::init - ")
56 ACE_TEXT ("Error opening impl source file\n")),
57 -1);
60 /// Initialize the stream.
61 this->ctx_->stream (tao_cg->implementation_skeleton ());
62 return 0;