2 //=============================================================================
4 * @file structure_cs.cpp
6 * Visitor generating code for Structures in the client stubs file.
8 * @author Aniruddha Gokhale
10 //=============================================================================
12 #include "structure.h"
14 // ***************************************************************************
16 // ***************************************************************************
18 be_visitor_structure_cs::be_visitor_structure_cs (be_visitor_context
*ctx
)
19 : be_visitor_structure (ctx
)
23 be_visitor_structure_cs::~be_visitor_structure_cs ()
28 be_visitor_structure_cs::visit_structure (be_structure
*node
)
30 if (node
->cli_stub_gen () || node
->imported ())
35 if (be_global
->tc_support ())
37 be_visitor_context
ctx (*this->ctx_
);
38 TAO::be_visitor_struct_typecode
visitor (&ctx
);
40 if (visitor
.visit_structure (node
) == -1)
42 ACE_ERROR_RETURN ((LM_ERROR
,
43 "(%N:%l) be_visitor_structure_cs::"
45 "TypeCode definition failed\n"),
50 if (be_global
->any_support ())
52 TAO_OutStream
*os
= this->ctx_
->stream ();
55 TAO_INSERT_COMMENT (os
);
57 *os
<< "void" << be_nl
59 << "::_tao_any_destructor (" << be_idt
<< be_idt_nl
60 << "void *_tao_void_pointer)" << be_uidt
63 << node
->local_name () << " *_tao_tmp_pointer =" << be_idt_nl
64 << "static_cast<" << node
->local_name ()
65 << " *> (_tao_void_pointer);" << be_uidt_nl
66 << "delete _tao_tmp_pointer;" << be_uidt_nl
70 // Do any code generation required for the scope members
71 // all we have to do is to visit the scope.
72 if (this->visit_scope (node
) == -1)
74 ACE_ERROR_RETURN ((LM_ERROR
,
75 "(%N:%l) be_visitor_structure_cs::"
77 "codegen for scope failed\n"),
81 node
->cli_stub_gen (true);