37 static const unsigned int InitialFNV = 2166136261u;
38 static const unsigned int FNVMultiple = 16777619u;
41 unsigned int hash = InitialFNV;
46 hash = hash * FNVMultiple;
55 while( ! (ret = *(
const unsigned char *)src - *(
const unsigned char *)dst) && *dst)
108 unsigned int key =
m_uid;
110 key += ~(key << 15); key ^= (key >> 10); key += (key << 3); key ^= (key >> 6); key += ~(key << 11); key ^= (key >> 16);
147 const bool VOID_IS_8 = ((
sizeof(
void*)==8));
151 key += ~(key << 15); key ^= (key >> 10); key += (key << 3); key ^= (key >> 6); key += ~(key << 11); key ^= (key >> 16);
159 template <
class Value>
182 unsigned int key =
m_uid;
184 key += ~(key << 15); key ^= (key >> 10); key += (key << 3); key ^= (key >> 6); key += ~(key << 11); key ^= (key >> 16);
192 template <
class Value>
214 unsigned int key =
m_uid;
216 key += ~(key << 15); key ^= (key >> 10); key += (key << 3); key ^= (key >> 6); key += ~(key << 11); key ^= (key >> 16);
224 template <
class Key,
class Value>
249 for (i= 0; i < newCapacity; ++i)
253 for (i = 0; i < newCapacity; ++i)
258 for(i=0;i<curHashtableSize;i++)
274 void insert(
const Key& key,
const Value& value) {
291 if (oldCapacity < newCapacity)
317 while (index != pairIndex)
340 if (lastPairIndex == pairIndex)
354 while (index != lastPairIndex)
434 const Value*
find(
const Key& key)
const 482 #endif //BT_HASH_MAP_H
const void * getPointer() const
void remove(const Key &key)
btAlignedObjectArray< int > m_hashTable
void push_back(const T &_Val)
unsigned int m_hashValues[2]
bool equals(const btHashInt &other) const
btHashPtr(const void *ptr)
bool equals(const btHashKey< Value > &other) const
Value * find(const Key &key)
int findIndex(const Key &key) const
const Value * find(const Key &key) const
bool equals(const btHashPtr &other) const
unsigned int getHash() const
btAlignedObjectArray< int > m_next
#define SIMD_FORCE_INLINE
Value * operator[](const Key &key)
const Value * operator[](const Key &key) const
btAlignedObjectArray< Key > m_keyArray
The btHashMap template class implements a generic and lightweight hashmap.
const Value * getAtIndex(int index) const
unsigned int getHash() const
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
void growTables(const Key &)
Value * getAtIndex(int index)
Key getKeyAtIndex(int index)
btHashString(const char *name)
int capacity() const
return the pre-allocated (reserved) elements, this is at least as large as the total number of elemen...
void insert(const Key &key, const Value &value)
btAlignedObjectArray< Value > m_valueArray
int size() const
return the number of elements in the array
very basic hashable string implementation, compatible with btHashMap
void resize(int newsize, const T &fillData=T())
unsigned int getHash() const
unsigned int getHash() const
bool equals(const btHashString &other) const
unsigned int getHash() const
bool equals(const btHashKeyPtr< Value > &other) const
int portableStringCompare(const char *src, const char *dst) const
const Key getKeyAtIndex(int index) const