Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / TAO_IDL / be_include / be_union.h
blob18cc68184805eabcb1dd37425ff321ec16196b13
2 //=============================================================================
3 /**
4 * @file be_union.h
6 * Extension of class AST_Union that provides additional means for C++
7 * mapping.
9 * @author Copyright 1994-1995 by Sun Microsystems
10 * @author Inc. and Aniruddha Gokhale
12 //=============================================================================
14 #ifndef BE_UNION_H
15 #define BE_UNION_H
17 #include "be_type.h"
18 #include "be_scope.h"
19 #include "ast_union.h"
21 class AST_ConcreteType;
22 class be_visitor;
24 class be_union : public virtual AST_Union,
25 public virtual be_scope,
26 public virtual be_type
28 public:
29 be_union (AST_ConcreteType *dt,
30 UTL_ScopedName *n,
31 bool local,
32 bool abstract);
34 /// Catch BE-specific member values before delegating to the base class.
35 virtual void redefine (AST_Structure *from);
37 /// Do we have at least one member with multiple case labels?
38 virtual bool has_duplicate_case_labels (void);
40 /// Overridden from class be_type.
41 virtual void gen_ostream_operator (TAO_OutStream *os,
42 bool use_underscore);
44 /// Cleanup function.
45 virtual void destroy (void);
47 /// Visiting.
48 virtual int accept (be_visitor *visitor);
50 /// Decides whether a default switch case label in the generated copy
51 /// constructor, assignment operator, etc. is needed.
52 bool gen_empty_default_label (void);
54 /// Just a way to get at fe_add_union_branch() from the backend.
55 AST_UnionBranch *be_add_union_branch (AST_UnionBranch *b);
57 /// Returns total number of labels, useful when the union has
58 /// multiple case labels.
59 ACE_UINT64 nlabels (void);
61 // Narrowing.
63 DEF_NARROW_FROM_DECL(be_union);
64 DEF_NARROW_FROM_SCOPE(be_union);
67 #endif