CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

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 "csutil/hashmap.h"
00023 
00032 typedef uint32 csStringID;
00034 csStringID const csInvalidStringID = (csStringID) ~0;
00035 
00036 class csStringHash;
00037 
00043 class csStringHashIterator
00044 {
00045   friend class csStringHash;
00046 
00047 private:
00048   csGlobalHashIterator* hashIt;
00049 
00050 public:
00051 
00057   csStringHashIterator (csStringHash* hash);
00058   virtual ~csStringHashIterator ();
00059 
00061   bool HasNext ();
00063   csStringID Next ();
00064 };
00065 
00070 class csStringHash
00071 {
00072 private:
00073   friend class csStringHashIterator;
00074   
00075   csHashMap Registry;
00076 
00077 public:
00079   csStringHash (uint32 size = 211);
00081   ~csStringHash ();
00082 
00087   const char* Register (const char *s, csStringID id);
00088 
00093   csStringID Request (const char *s);
00094 
00099   const char* Request (csStringID id);
00100 
00104   void Clear ();
00105 };
00106 
00107 #endif // __CS_STRHASH_H__

Generated for Crystal Space by doxygen 1.2.14