Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_root / root_ci.cpp
blobaedb03c7454583fed77b04ff2638be3019d6cc0a
2 //=============================================================================
3 /**
4 * @file root_ci.cpp
6 * Visitor generating code for the Root in the client inline
8 * @author Aniruddha Gokhale
9 */
10 //=============================================================================
12 #include "root.h"
14 be_visitor_root_ci::be_visitor_root_ci (be_visitor_context *ctx)
15 : be_visitor_root (ctx)
19 be_visitor_root_ci::~be_visitor_root_ci ()
23 int
24 be_visitor_root_ci::visit_root (be_root *node)
26 if (this->init () == -1)
28 ACE_ERROR_RETURN ((LM_ERROR,
29 ACE_TEXT ("be_visitor_root_ci::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_ci::visit_root - ")
38 ACE_TEXT ("codegen for scope failed\n")),
39 -1);
43 if (this->gen_obv_defns (node) == -1)
45 ACE_ERROR_RETURN ((LM_ERROR,
46 ACE_TEXT ("be_visitor_root_ci::")
47 ACE_TEXT ("visit_root - ")
48 ACE_TEXT ("failed to generate OBV_ defns\n")),
49 -1);
52 (void) tao_cg->end_client_inline ();
54 return 0;
57 int
58 be_visitor_root_ci::init ()
60 /// First open the client-side file for writing
61 int status =
62 tao_cg->start_client_inline (
63 be_global->be_get_client_inline_fname ());
65 if (status == -1)
67 ACE_ERROR_RETURN ((LM_ERROR,
68 ACE_TEXT ("be_visitor_root_ci::init - ")
69 ACE_TEXT ("Error opening client inline file\n")),
70 -1);
73 /// Initialize the stream.
74 this->ctx_->stream (tao_cg->client_inline ());
75 return 0;
78 int
79 be_visitor_root_ci::gen_obv_defns (be_root *node)
81 be_visitor_context ctx = *this->ctx_;
82 ctx.state (TAO_CodeGen::TAO_MODULE_OBV_CI);
83 be_visitor_obv_module obv_visitor (&ctx);
84 return obv_visitor.visit_scope (node);