Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / orbsvcs / IFR_Service / ifr_adding_visitor_union.h
blob4235eb5b63523ec7b46f33b9a3596db9001b1457
2 /* -*- C++ -*- */
3 //=============================================================================
4 /**
5 * @file ifr_adding_visitor_union.h
7 * Header file for class ifr_adding_visitor_union.
9 * @author Jeff Parsons <parsons@cs.wustl.edu>
11 //=============================================================================
14 #ifndef TAO_IFR_ADDING_VISITOR_UNION_H
15 #define TAO_IFR_ADDING_VISITOR_UNION_H
17 #include "ifr_adding_visitor.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 /**
24 * @class ifr_adding_visitor_union
26 * @brief ifr_adding_visitor_exception.
28 * This visitor overrides a few of the visit methods
29 * for the case when a union node is seen in the AST.
31 class ifr_adding_visitor_union : public ifr_adding_visitor
33 public:
34 ifr_adding_visitor_union (AST_Decl *scope);
36 virtual ~ifr_adding_visitor_union (void);
38 virtual int visit_scope (UTL_Scope *node);
39 virtual int visit_structure (AST_Structure *node);
40 virtual int visit_enum (AST_Enum *node);
41 virtual int visit_union (AST_Union *node);
43 /// Lets the visitor one level above acess this value.
44 virtual CORBA::IDLType_ptr ir_current (void) const;
46 private:
47 /// Common code called whether we are creating a new union
48 /// or filling out a forward declaration.
49 int add_members (AST_Union *node, CORBA::UnionDef_ptr union_def);
51 private:
52 /// Holder for the member list passed to create_struct() or
53 /// create_exception().
54 CORBA::UnionMemberSeq members_;
56 /**
57 * Holds the typecode of the discriminator (used only if the
58 * discriminator is an enum type, so we can insert the label
59 * values into Anys for UnionMemberSeq[i].label).
61 CORBA::TypeCode_var disc_tc_;
64 #endif /* TAO_IFR_ADDING_VISITOR_UNION_H */