4 //=============================================================================
8 * Extension of class AST_Map that provides additional means for C++
11 * @author Tyler Mayoff
13 //=============================================================================
28 // A map in OMG IDL does not define a scoping construct just as a struct
29 // or union or an interface do. However, in the C++ mapping, a map becomes
30 // a class. If the base type of a map is another anonymous map, then
31 // the base type is defined in the scope of this map. Hence we define
32 // be_map to possess the additional characteristics of a scope.
33 class be_map
: public virtual AST_Map
,
34 public virtual be_scope
,
35 public virtual be_type
38 be_map (AST_Expression
*v
,
45 /// Non-virtual override of frontend method.
46 be_type
*key_type () const;
47 be_type
*value_type () const;
50 * Returns the fully dealiased key type if it's a typedef. If it's not a
51 * typedef, the it returns the same value as as key_type().
53 be_type
*primitive_key_type () const;
56 * Returns the fully dealiased key type if it's a typedef. If it's not a
57 * typedef, the it returns the same value as as value_type().
59 be_type
*primitive_value_type () const;
61 /// Create a name for ourselves. If we are typedefed, then we get the name of
62 /// the typedef node, else we generate a name for ourselves.
63 int create_name (be_typedef
*node
);
65 // Scope management functions.
66 virtual AST_Map
*fe_add_map (AST_Map
*);
68 /// Overridden method on the be_scope class.
69 virtual be_decl
*decl ();
71 /// Overridden from class be_type.
72 virtual void gen_ostream_operator (TAO_OutStream
*os
,
76 virtual void destroy ();
79 virtual int accept (be_visitor
*visitor
);
81 /// Report the instance name for instantiation.
82 const char *instance_name ();
84 /// Accessors for the member.
85 be_field
*field_node () const;
86 void field_node (be_field
*node
);
88 /// Helper to create_name, also used by the traits visitor.
89 virtual char *gen_name ();
92 const char *smart_fwd_helper_name (AST_Decl
*elem_scope
,
96 /// Used if we are an anonymous member, to help generate a unique name.
97 be_field
*field_node_
;