00001 // Filename: cppEnumType.h 00002 // Created by: drose (25Oct99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef CPPENUMTYPE_H 00020 #define CPPENUMTYPE_H 00021 00022 #include <dtoolbase.h> 00023 00024 #include "cppExtensionType.h" 00025 00026 #include <vector> 00027 00028 class CPPExpression; 00029 class CPPInstance; 00030 class CPPScope; 00031 00032 00033 /////////////////////////////////////////////////////////////////// 00034 // Class : CPPEnumType 00035 // Description : 00036 //////////////////////////////////////////////////////////////////// 00037 class CPPEnumType : public CPPExtensionType { 00038 public: 00039 CPPEnumType(CPPIdentifier *ident, CPPScope *current_scope, 00040 const CPPFile &file); 00041 00042 void add_element(const string &name, CPPScope *scope, 00043 CPPExpression *value = (CPPExpression *)NULL); 00044 00045 virtual bool is_incomplete() const; 00046 00047 virtual CPPDeclaration *substitute_decl(SubstDecl &subst, 00048 CPPScope *current_scope, 00049 CPPScope *global_scope); 00050 00051 virtual void output(ostream &out, int indent_level, CPPScope *scope, 00052 bool complete) const; 00053 virtual SubType get_subtype() const; 00054 00055 virtual CPPEnumType *as_enum_type(); 00056 00057 typedef vector<CPPInstance *> Elements; 00058 Elements _elements; 00059 }; 00060 00061 00062 #endif