csutil/strhash.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2002 by Jorrit Tyberghein 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public 00015 License along with this library; if not, write to the Free 00016 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00017 */ 00018 00019 #ifndef __CS_STRHASH_H__ 00020 #define __CS_STRHASH_H__ 00021 00022 #include "csextern.h" 00023 #include "hashmap.h" 00024 00033 typedef uint32 csStringID; 00035 csStringID const csInvalidStringID = (csStringID) ~0; 00036 00037 class csStringHash; 00038 00044 class CS_CSUTIL_EXPORT csStringHashIterator 00045 { 00046 friend class csStringHash; 00047 00048 private: 00049 csGlobalHashIterator* hashIt; 00050 00051 public: 00052 00058 csStringHashIterator (csStringHash*); 00060 virtual ~csStringHashIterator (); 00061 00063 bool HasNext (); 00065 csStringID Next (); 00066 }; 00067 00075 class CS_CSUTIL_EXPORT csStringHash 00076 { 00077 private: 00078 friend class csStringHashIterator; 00079 00080 csHashMap Registry; 00081 00082 public: 00084 csStringHash (uint32 size = 211); 00086 ~csStringHash (); 00087 00098 const char* Register (const char* s, csStringID id); 00099 00105 csStringID Request (const char* s); 00106 00115 const char* Request (csStringID id); 00116 00120 void Clear (); 00121 }; 00122 00123 #endif // __CS_STRHASH_H__
Generated for Crystal Space by doxygen 1.2.18