2 //=============================================================================
6 * Visitor generating code for the Root in the client inline
8 * @author Aniruddha Gokhale
10 //=============================================================================
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 ()
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")),
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")),
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")),
52 (void) tao_cg
->end_client_inline ();
58 be_visitor_root_ci::init ()
60 /// First open the client-side file for writing
62 tao_cg
->start_client_inline (
63 be_global
->be_get_client_inline_fname ());
67 ACE_ERROR_RETURN ((LM_ERROR
,
68 ACE_TEXT ("be_visitor_root_ci::init - ")
69 ACE_TEXT ("Error opening client inline file\n")),
73 /// Initialize the stream.
74 this->ctx_
->stream (tao_cg
->client_inline ());
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
);