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 = *(
unsigned char *)src - *(
unsigned char *)dst) && *dst)
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));
146 key += ~(key << 15); key ^= (key >> 10); key += (key << 3); key ^= (key >> 6); key += ~(key << 11); key ^= (key >> 16);
154 template <
class Value>
179 key += ~(key << 15); key ^= (key >> 10); key += (key << 3); key ^= (key >> 6); key += ~(key << 11); key ^= (key >> 16);
187 template <
class Value>
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>
244 for (i= 0; i < newCapacity; ++i)
248 for (i = 0; i < newCapacity; ++i)
253 for(i=0;i<curHashtableSize;i++)
269 void insert(
const Key& key,
const Value& value) {
286 if (oldCapacity < newCapacity)
296 void remove(
const Key& key) {
312 while (index != pairIndex)
335 if (lastPairIndex == pairIndex)
349 while (index != lastPairIndex)
402 const Value*
find(
const Key& key)
const
450 #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