Back to index

plt-scheme  4.2.1
TypeTree.h
Go to the documentation of this file.
00001 /*                                                      -*- C++ -*-
00002  *
00003  * Purpose: type tree (type keys defined in common.h)
00004  *
00005  * Authors: Markus Holzem and Julian Smart
00006  *
00007  * Copyright: (C) 2004-2009 PLT Scheme Inc.
00008  * Copyright: (C) 1995, AIAI, University of Edinburgh (Julian)
00009  * Copyright: (C) 1995, GNU (Markus)
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00024  * 02110-1301 USA.
00025  */
00026 
00027 #ifndef TypeTree_h
00028 #define TypeTree_h
00029 
00030 #ifdef __GNUG__
00031 #pragma interface
00032 #endif
00033 
00034 #ifdef MEMORY_USE_METHOD
00035 # include "string.h"
00036 #endif
00037 
00038 void  wxInitStandardTypes(void);
00039 
00040 Bool  wxSubType(WXTYPE type1, WXTYPE type2);
00041 char  *wxGetTypeName(WXTYPE type);
00042 
00043 class wxTypeDef : public wxObject {
00044 public:
00045   wxTypeDef(void);
00046 
00047 private:
00048     friend Bool wxSubType(WXTYPE type1, WXTYPE type2);
00049     friend char *wxGetTypeName(WXTYPE type);
00050     friend class wxTypeTree;
00051 
00052     char    *name;
00053     WXTYPE  type;
00054     WXTYPE  parent;
00055 #ifdef MEMORY_USE_METHOD
00056   inline long MemoryUse(void) { return strlen(name) + wxObject::MemoryUse(); }
00057 #endif
00058 };
00059 
00060 class wxTypeTree : public wxHashTable {
00061 public:
00062     wxTypeTree(void);
00063     ~wxTypeTree(void);
00064 
00065     void  AddType(WXTYPE t, WXTYPE parent, char *name);
00066     char  *GetName(WXTYPE t) { return wxGetTypeName(t); }
00067 };
00068 
00069 #endif // TypeTree_h