37                 static const unsigned int  InitialFNV = 2166136261u;
    38                 static const unsigned int FNVMultiple = 16777619u;
    41                 unsigned int hash = InitialFNV;
    43                 for(
int i = 0; m_string[i]; i++)
    45                         hash = hash ^ (m_string[i]);       
    46                         hash = hash * FNVMultiple;  
    55                         while( ! (ret = *(
unsigned char *)src - *(
unsigned char *)dst) && *dst)
    68                 return (m_string == other.
m_string) ||
    98                 return getUid1() == other.
getUid1();
   105                 key += ~(key << 15);    key ^=  (key >> 10);    key +=  (key << 3);     key ^=  (key >> 6);     key += ~(key << 11);    key ^=  (key >> 16);
   141                 const bool VOID_IS_8 = ((
sizeof(
void*)==8));
   143                 int key = VOID_IS_8? m_hashValues[0]+m_hashValues[1] : m_hashValues[0];
   146                 key += ~(key << 15);    key ^=  (key >> 10);    key +=  (key << 3);     key ^=  (key >> 6);     key += ~(key << 11);    key ^=  (key >> 16);
   154 template <
class Value>
   171                 return getUid1() == other.
getUid1();
   179                 key += ~(key << 15);    key ^=  (key >> 10);    key +=  (key << 3);     key ^=  (key >> 6);     key += ~(key << 11);    key ^=  (key >> 16);
   187 template <
class Value>
   204                 return getUid1() == other.
getUid1();
   211                 key += ~(key << 15);    key ^=  (key >> 10);    key +=  (key << 3);     key ^=  (key >> 6);     key += ~(key << 11);    key ^=  (key >> 16);
   219 template <
class Key, 
class Value>
   232                 int newCapacity = m_valueArray.
capacity();
   234                 if (m_hashTable.
size() < newCapacity)
   237                         int curHashtableSize = m_hashTable.
size();
   239                         m_hashTable.
resize(newCapacity);
   240                         m_next.
resize(newCapacity);
   244                         for (i= 0; i < newCapacity; ++i)
   248                         for (i = 0; i < newCapacity; ++i)
   253                         for(i=0;i<curHashtableSize;i++)
   258                                 int     hashValue = m_keyArray[i].getHash() & (m_valueArray.
capacity()-1);      
   259                                 m_next[i] = m_hashTable[hashValue];
   260                                 m_hashTable[hashValue] = i;
   269         void insert(
const Key& key, 
const Value& value) {
   270                 int hash = key.getHash() & (m_valueArray.
capacity()-1);
   273                 int index = findIndex(key);
   276                         m_valueArray[index]=value;
   280                 int count = m_valueArray.
size();
   281                 int oldCapacity = m_valueArray.
capacity();
   285                 int newCapacity = m_valueArray.
capacity();
   286                 if (oldCapacity < newCapacity)
   290                         hash = key.getHash() & (m_valueArray.
capacity()-1);
   292                 m_next[count] = m_hashTable[hash];
   293                 m_hashTable[hash] = count;
   296         void remove(
const Key& key) {
   298                 int hash = key.getHash() & (m_valueArray.
capacity()-1);
   300                 int pairIndex = findIndex(key);
   308                 int index = m_hashTable[hash];
   312                 while (index != pairIndex)
   315                         index = m_next[index];
   320                         btAssert(m_next[previous] == pairIndex);
   321                         m_next[previous] = m_next[pairIndex];
   325                         m_hashTable[hash] = m_next[pairIndex];
   332                 int lastPairIndex = m_valueArray.
size() - 1;
   335                 if (lastPairIndex == pairIndex)
   343                 int lastHash = m_keyArray[lastPairIndex].getHash() & (m_valueArray.
capacity()-1);
   345                 index = m_hashTable[lastHash];
   349                 while (index != lastPairIndex)
   352                         index = m_next[index];
   357                         btAssert(m_next[previous] == lastPairIndex);
   358                         m_next[previous] = m_next[lastPairIndex];
   362                         m_hashTable[lastHash] = m_next[lastPairIndex];
   366                 m_valueArray[pairIndex] = m_valueArray[lastPairIndex];
   367                 m_keyArray[pairIndex] = m_keyArray[lastPairIndex];
   370                 m_next[pairIndex] = m_hashTable[lastHash];
   371                 m_hashTable[lastHash] = pairIndex;
   381                 return m_valueArray.
size();
   388                 return &m_valueArray[index];
   395                 return &m_valueArray[index];
   406         const Value*    
find(
const Key& key)
 const   408                 int index = findIndex(key);
   413                 return &m_valueArray[index];
   418                 int index = findIndex(key);
   423                 return &m_valueArray[index];
   429                 unsigned int hash = key.getHash() & (m_valueArray.
capacity()-1);
   431                 if (hash >= (
unsigned int)m_hashTable.
size())
   436                 int index = m_hashTable[hash];
   437                 while ((index != 
BT_HASH_NULL) && key.equals(m_keyArray[index]) == 
false)
   439                         index = m_next[index];
   448                 m_valueArray.
clear();
   454 #endif //BT_HASH_MAP_H 
bool equals(const btHashString &other) const 
btAlignedObjectArray< int > m_hashTable
void push_back(const T &_Val)
int findIndex(const Key &key) const 
btHashPtr(const void *ptr)
Value * find(const Key &key)
unsigned int getHash() const 
btAlignedObjectArray< int > m_next
unsigned int getHash() const 
bool equals(const btHashPtr &other) const 
#define SIMD_FORCE_INLINE
Value * operator[](const Key &key)
btAlignedObjectArray< Key > m_keyArray
bool equals(const btHashKey< Value > &other) const 
The btHashMap template class implements a generic and lightweight hashmap. 
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0), to reduce performance overhead of run-time memory (de)allocations. 
unsigned int getHash() const 
int portableStringCompare(const char *src, const char *dst) const 
int size() const 
return the number of elements in the array 
void growTables(const Key &)
Value * getAtIndex(int index)
bool equals(const btHashKeyPtr< Value > &other) const 
btHashString(const char *name)
void insert(const Key &key, const Value &value)
bool equals(const btHashInt &other) const 
int capacity() const 
return the pre-allocated (reserved) elements, this is at least as large as the total number of elemen...
btAlignedObjectArray< Value > m_valueArray
const Value * find(const Key &key) const 
const Value * getAtIndex(int index) const 
very basic hashable string implementation, compatible with btHashMap 
unsigned int getHash() const 
void resize(int newsize, const T &fillData=T())
unsigned int getHash() const 
const void * getPointer() const 
const Value * operator[](const Key &key) const