Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / TAO_IDL / be / be_visitor_map / map_ch.cpp
blobf552c5d7db3fd8494580b180b00403a5d4929a6e
2 //=============================================================================
3 /**
4 * @file map_ch.cpp
6 * Visitor generating code for Map in the client header
8 * @author Tyler Mayoff
9 */
10 //=============================================================================
12 #include "map.h"
14 // Root visitor for client header.
15 be_visitor_map_ch::be_visitor_map_ch (be_visitor_context *ctx)
16 : be_visitor_decl (ctx)
20 int be_visitor_map_ch::visit_map (be_map *node)
22 if (node->defined_in () == nullptr)
24 // The node is a nested map, and has had no scope defined.
25 node->set_defined_in (DeclAsScope (this->ctx_->scope ()->decl ()));
28 // First create a name for ourselves.
29 if (node->create_name (this->ctx_->tdef ()) == -1)
31 ACE_ERROR_RETURN ((LM_ERROR,
32 ACE_TEXT ("be_visitor_map_ch::")
33 ACE_TEXT ("visit_map - ")
34 ACE_TEXT ("failed creating name\n")),
35 -1);
38 TAO_OutStream *os = this->ctx_->stream ();
40 *os << be_nl_2;
42 TAO_INSERT_COMMENT (os);
44 os->gen_ifdef_macro (node->flat_name ());
46 *os << be_nl_2;
48 *os << "using " << node->local_name () << " = std::map<";
50 be_type* kt = node->key_type();
51 be_type* vt = node->value_type();
53 // Generate the base type for the buffer.
54 be_visitor_context ctx (*this->ctx_);
55 ctx.state (TAO_CodeGen::TAO_MAP_BUFFER_TYPE_CH);
56 be_visitor_map_buffer_type bt_visitor (&ctx);
58 if (kt->accept (&bt_visitor) == -1)
60 ACE_ERROR_RETURN ((LM_ERROR,
61 ACE_TEXT ("be_visitor_map_ch::")
62 ACE_TEXT ("visit_map - ")
63 ACE_TEXT ("buffer type visit failed\n")),
64 -1);
67 *os << ", ";
69 if (vt->accept (&bt_visitor) == -1)
71 ACE_ERROR_RETURN ((LM_ERROR,
72 ACE_TEXT ("be_visitor_map_ch::")
73 ACE_TEXT ("visit_map - ")
74 ACE_TEXT ("buffer type visit failed\n")),
75 -1);
78 *os << ">;";
80 os->gen_endif ();
81 node->cli_hdr_gen (true);
83 return 0;