Hashable key type that stores a string as an array of ub4 - making hashing faster. Also caches the 32-bit result of the hash to speed up comparison of keys. More...
#include <hashfunc.h>
Public Member Functions | |
HashKey (const HashKey &other) | |
HashKey (const char *string) | |
HashKey & | operator= (const char *string) |
bool | operator== (const HashKey &other) const |
bool | operator!= (const HashKey &other) const |
hash_t | hash () const |
Private Member Functions | |
void | copy (const HashKey &other) |
void | copy (const char *string) |
bool | equal (const HashKey &other) const |
Private Attributes | |
Array< ub4 > | m_key |
hash_t | m_hash |
Hashable key type that stores a string as an array of ub4 - making hashing faster. Also caches the 32-bit result of the hash to speed up comparison of keys.
Definition at line 344 of file hashfunc.h.
HashKey< UB4Traits >::HashKey | ( | const HashKey< UB4Traits > & | other | ) | [inline] |
Definition at line 365 of file hashfunc.h.
References HashKey< UB4Traits >::copy().
HashKey< UB4Traits >::HashKey | ( | const char * | string | ) | [inline] |
Definition at line 368 of file hashfunc.h.
References HashKey< UB4Traits >::copy().
void HashKey< UB4Traits >::copy | ( | const char * | string | ) | [inline, private] |
Definition at line 352 of file hashfunc.h.
References Array< Element, Allocator >::begin(), Array< Element, Allocator >::data(), Array< Element, Allocator >::end(), hash_ub4(), i, HashKey< UB4Traits >::m_hash, HashKey< UB4Traits >::m_key, and Array< Element, Allocator >::size().
void HashKey< UB4Traits >::copy | ( | const HashKey< UB4Traits > & | other | ) | [inline, private] |
Definition at line 348 of file hashfunc.h.
References Array< Element, Allocator >::begin(), Array< Element, Allocator >::end(), HashKey< UB4Traits >::m_hash, and HashKey< UB4Traits >::m_key.
Referenced by HashKey< UB4Traits >::HashKey(), and HashKey< UB4Traits >::operator=().
bool HashKey< UB4Traits >::equal | ( | const HashKey< UB4Traits > & | other | ) | const [inline, private] |
Definition at line 359 of file hashfunc.h.
References Array< Element, Allocator >::begin(), Array< Element, Allocator >::end(), HashKey< UB4Traits >::m_hash, HashKey< UB4Traits >::m_key, and Array< Element, Allocator >::size().
Referenced by HashKey< UB4Traits >::operator!=(), and HashKey< UB4Traits >::operator==().
hash_t HashKey< UB4Traits >::hash | ( | ) | const [inline] |
Definition at line 382 of file hashfunc.h.
References HashKey< UB4Traits >::m_hash.
Referenced by HashKeyHasher::operator()().
bool HashKey< UB4Traits >::operator!= | ( | const HashKey< UB4Traits > & | other | ) | const [inline] |
Definition at line 379 of file hashfunc.h.
References HashKey< UB4Traits >::equal().
HashKey& HashKey< UB4Traits >::operator= | ( | const char * | string | ) | [inline] |
Definition at line 371 of file hashfunc.h.
References HashKey< UB4Traits >::copy(), HashKey< UB4Traits >::m_key, Array< Element, Allocator >::resize(), and string_length_ub4().
bool HashKey< UB4Traits >::operator== | ( | const HashKey< UB4Traits > & | other | ) | const [inline] |
Definition at line 376 of file hashfunc.h.
References HashKey< UB4Traits >::equal().
Definition at line 346 of file hashfunc.h.
Referenced by HashKey< UB4Traits >::copy(), HashKey< UB4Traits >::equal(), and HashKey< UB4Traits >::hash().
Definition at line 345 of file hashfunc.h.
Referenced by HashKey< UB4Traits >::copy(), HashKey< UB4Traits >::equal(), and HashKey< UB4Traits >::operator=().