Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / TAO_IDL / include / ast_map.h
blobc7791eea232685c4dac8821341383287f6b70346
1 /*
3 COPYRIGHT
5 Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United
6 States of America. All Rights Reserved.
8 This product is protected by copyright and distributed under the following
9 license restricting its use.
11 The Interface Definition Language Compiler Front End (CFE) is made
12 available for your use provided that you include this license and copyright
13 notice on all media and documentation and the software program in which
14 this product is incorporated in whole or part. You may copy and extend
15 functionality (but may not remove functionality) of the Interface
16 Definition Language CFE without charge, but you are not authorized to
17 license or distribute it to anyone else except as part of a product or
18 program developed by you or with the express written consent of Sun
19 Microsystems, Inc. ("Sun").
21 The names of Sun Microsystems, Inc. and any of its subsidiaries or
22 affiliates may not be used in advertising or publicity pertaining to
23 distribution of Interface Definition Language CFE as permitted herein.
25 This license is effective until terminated by Sun for failure to comply
26 with this license. Upon termination, you shall destroy or return all code
27 and documentation for the Interface Definition Language CFE.
29 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
30 ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
31 FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
32 DEALING, USAGE OR TRADE PRACTICE.
34 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
35 ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
36 TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
38 SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
39 RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
40 INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
42 IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
43 ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
44 DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
46 Use, duplication, or disclosure by the government is subject to
47 restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
48 Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
49 52.227-19.
51 Sun, Sun Microsystems and the Sun logo are trademarks or registered
52 trademarks of Sun Microsystems, Inc.
54 SunSoft, Inc.
55 2550 Garcia Avenue
56 Mountain View, California 94043
58 NOTE:
60 SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
61 trademarks or registered trademarks of Sun Microsystems, Inc.
65 #ifndef _AST_MAP_AST_MAP_HH
66 #define _AST_MAP_AST_MAP_HH
68 #include "ast_concrete_type.h"
71 class AST_Expression;
72 class AST_Type;
74 class TAO_IDL_FE_Export AST_Map : public virtual AST_ConcreteType
76 public:
77 AST_Map (AST_Expression *max_size,
78 AST_Type *key_bt,
79 AST_Type *val_bt,
80 UTL_ScopedName *n,
81 bool local,
82 bool abstract);
84 virtual ~AST_Map () = default;
86 virtual bool in_recursion (ACE_Unbounded_Queue<AST_Type *> &list);
87 // Are we or the node represented by node involved in recursion.
89 // Data Accessors.
90 AST_Expression *max_size () const;
92 AST_Type *key_type () const;
93 AST_Type *value_type () const;
95 /**
96 * Returns the fully dealiased base type if it's a typedef. If it's not a
97 * typedef, the it returns the same value as as key_type().
99 AST_Type *primitive_key_type () const;
102 * Returns the fully dealiased base type if it's a typedef. If it's not a
103 * typedef, the it returns the same value as as value_type().
105 AST_Type *primitive_value_type () const;
107 virtual bool unbounded () const;
108 // Is this map bounded or not.
110 // Recursively called on valuetype to check for legal use as
111 // a primary key. Overridden for valuetype, struct, map,
112 // union, array, typedef, and interface.
113 virtual bool legal_for_primary_key () const;
115 // Is the element type a forward declared struct or union
116 // that hasn't yet been fully defined?
117 virtual bool is_defined ();
119 // Cleanup method.
120 virtual void destroy ();
122 // AST Dumping.
123 virtual void dump (ACE_OSTREAM_TYPE &o);
125 // Visiting.
126 virtual int ast_accept (ast_visitor *visitor);
128 static AST_Decl::NodeType const NT;
131 * Get and Set Annotations on the key type
133 ///{
134 AST_Annotation_Appls &key_type_annotations ();
135 void key_type_annotations (const AST_Annotation_Appls &annotations);
136 ///}
139 * Get and Set Annotations on the value type
141 ///{
142 AST_Annotation_Appls &value_type_annotations ();
143 void value_type_annotations (const AST_Annotation_Appls &annotations);
144 ///}
146 private:
147 // Data.
148 AST_Expression *pd_max_size;
149 // Maximum map size.
152 * Key type for map
154 AST_Type *key_pd_type;
157 * Value type for map
159 AST_Type *value_pd_type;
161 bool unbounded_;
162 // Whether we are bounded or unbounded.
164 bool owns_key_type_;
165 // If our key type is anonymous array or map, we're
166 // responsible for destroying it.
167 bool owns_value_type_;
168 // If our value type is anonymous array or map, we're
169 // responsible for destroying it.
172 * Annotations on the key type
174 AST_Annotation_Appls key_type_annotations_;
177 * Annotations on the value type
179 AST_Annotation_Appls value_type_annotations_;
182 #endif // _AST_MAP_AST_MAP_HH