diff options
-rw-r--r-- | utils/HashTable.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/utils/HashTable.h b/utils/HashTable.h index 798d7c9..ce751ac 100644 --- a/utils/HashTable.h +++ b/utils/HashTable.h @@ -42,7 +42,7 @@ inline void SetInfo (CcuHashItem* p) { Info = p; } inline CcuHashItem* GetInfo () const { return Info; } inline const void* GetKey () const { return Key; } - void* operator new (unsigned int); + void* operator new (unsigned long); void operator delete (void*); }; @@ -61,7 +61,7 @@ public: }; -typedef int (*HASH_F) (const void*, int); +typedef unsigned int (*HASH_F) (const void*, int); typedef int (*HCMP_F) (const void*, const void*); typedef void* (*HCP_F) (const void*); typedef void (*HDEL_F) (const void*); @@ -84,6 +84,8 @@ protected : CcuHashCell* AddCell (CcuHashCell**, const void*) const; public: +static unsigned int HashPtr (const void*, int); + CcuHashTable (unsigned int, HASH_F = 0, HCP_F = 0, HDEL_F = 0, HCMP_F = 0); CcuHashTable (const CcuHashTable&); ~CcuHashTable (); @@ -96,23 +98,24 @@ inline int GetSize () const { return Size; } CcuHashCellRef operator [] (const void*) const; #ifdef TUNE - void HashStats (int fd = 2); - void CollStats (int fd = 2); + void HashStats (); + void CollStats (); #endif }; class CcuDictionnary : public CcuHashTable { protected: -static void* CopyKey (const void*); -static void DeleteKey (void*); -static int CompareKey (const void*, const void*); -static int HashKey (const void*, int); - +static void* CopyString (const void*); +static void DeleteString (void*); +static int CompareString (const void*, const void*); + + public: CcuDictionnary (int size, HASH_F = 0); ~CcuDictionnary (); void KeyCopy (int); +static unsigned int HashString (const void*, int); }; |