00001 // $Id: ifr_adding_visitor_union.h 78850 2007-07-12 10:50:02Z 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 bool is_nested); 00042 00043 virtual ~ifr_adding_visitor_union (void); 00044 00045 virtual int visit_scope (UTL_Scope *node); 00046 virtual int visit_structure (AST_Structure *node); 00047 virtual int visit_enum (AST_Enum *node); 00048 virtual int visit_union (AST_Union *node); 00049 00050 virtual CORBA::IDLType_ptr ir_current (void) const; 00051 // Lets the visitor one level above acess this value. 00052 00053 private: 00054 int add_members (AST_Union *node, CORBA::UnionDef_ptr union_def); 00055 // Common code called whether we are creating a new union 00056 // or filling out a forward declaration. 00057 00058 private: 00059 bool is_nested_; 00060 // Is this visitor visiting a union that was defined inside 00061 // a union, an exception, or a struct? 00062 00063 CORBA::UnionMemberSeq members_; 00064 // Holder for the member list passed to create_struct() or 00065 // create_exception(). 00066 00067 CORBA::TypeCode_var disc_tc_; 00068 // Holds the typecode of the discriminator (used only if the 00069 // discriminator is an enum type, so we can insert the label 00070 // values into Anys for UnionMemberSeq[i].label). 00071 00072 ACE_Unbounded_Queue<CORBA::Contained_ptr> move_queue_; 00073 // IR objects that must be moved into the scope (struct or 00074 // exception) where they were declared in the IDL file. 00075 }; 00076 00077 #endif /* TAO_IFR_ADDING_VISITOR_UNION_H */