00001 // $Id: ifr_adding_visitor_union.h 83643 2008-11-10 20:03:04Z parsons $ 00002 00003 /* -*- C++ -*- */ 00004 // ============================================================================ 00005 // 00006 // = LIBRARY 00007 // TAO_IFR_BE_DLL 00008 // 00009 // = FILENAME 00010 // ifr_adding_visitor_union.h 00011 // 00012 // = DESCRIPTION 00013 // Header file for class ifr_adding_visitor_union. 00014 // 00015 // = AUTHOR 00016 // Jeff Parsons <parsons@cs.wustl.edu> 00017 // 00018 // ============================================================================ 00019 00020 #ifndef TAO_IFR_ADDING_VISITOR_UNION_H 00021 #define TAO_IFR_ADDING_VISITOR_UNION_H 00022 00023 #include "ifr_adding_visitor.h" 00024 00025 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00026 # pragma once 00027 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00028 00029 class ifr_adding_visitor_union : public ifr_adding_visitor 00030 { 00031 // 00032 // = TITLE 00033 // ifr_adding_visitor_exception. 00034 // 00035 // = DESCRIPTION 00036 // This visitor overrides a few of the visit methods 00037 // for the case when a union node is seen in the AST. 00038 // 00039 public: 00040 ifr_adding_visitor_union (AST_Decl *scope); 00041 00042 virtual ~ifr_adding_visitor_union (void); 00043 00044 virtual int visit_scope (UTL_Scope *node); 00045 virtual int visit_structure (AST_Structure *node); 00046 virtual int visit_enum (AST_Enum *node); 00047 virtual int visit_union (AST_Union *node); 00048 00049 virtual CORBA::IDLType_ptr ir_current (void) const; 00050 // Lets the visitor one level above acess this value. 00051 00052 private: 00053 int add_members (AST_Union *node, CORBA::UnionDef_ptr union_def); 00054 // Common code called whether we are creating a new union 00055 // or filling out a forward declaration. 00056 00057 private: 00058 CORBA::UnionMemberSeq members_; 00059 // Holder for the member list passed to create_struct() or 00060 // create_exception(). 00061 00062 CORBA::TypeCode_var disc_tc_; 00063 // Holds the typecode of the discriminator (used only if the 00064 // discriminator is an enum type, so we can insert the label 00065 // values into Anys for UnionMemberSeq[i].label). 00066 }; 00067 00068 #endif /* TAO_IFR_ADDING_VISITOR_UNION_H */