HashKey< UB4Traits > Class Template Reference

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>

Collaboration diagram for HashKey< UB4Traits >:
Collaboration graph
[legend]

Public Member Functions

 HashKey (const HashKey &other)
 HashKey (const char *string)
HashKeyoperator= (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< ub4m_key
hash_t m_hash

Detailed Description

template<typename UB4Traits = ub4_default_traits>
class HashKey< UB4Traits >

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.


Constructor & Destructor Documentation

template<typename UB4Traits = ub4_default_traits>
HashKey< UB4Traits >::HashKey ( const HashKey< UB4Traits > &  other  )  [inline]

Definition at line 365 of file hashfunc.h.

References HashKey< UB4Traits >::copy().

template<typename UB4Traits = ub4_default_traits>
HashKey< UB4Traits >::HashKey ( const char *  string  )  [inline]

Definition at line 368 of file hashfunc.h.

References HashKey< UB4Traits >::copy().


Member Function Documentation

template<typename UB4Traits = ub4_default_traits>
void HashKey< UB4Traits >::copy ( const char *  string  )  [inline, private]
template<typename UB4Traits = ub4_default_traits>
void HashKey< UB4Traits >::copy ( const HashKey< UB4Traits > &  other  )  [inline, private]
template<typename UB4Traits = ub4_default_traits>
bool HashKey< UB4Traits >::equal ( const HashKey< UB4Traits > &  other  )  const [inline, private]
template<typename UB4Traits = ub4_default_traits>
hash_t HashKey< UB4Traits >::hash (  )  const [inline]

Definition at line 382 of file hashfunc.h.

References HashKey< UB4Traits >::m_hash.

Referenced by HashKeyHasher::operator()().

template<typename UB4Traits = ub4_default_traits>
bool HashKey< UB4Traits >::operator!= ( const HashKey< UB4Traits > &  other  )  const [inline]

Definition at line 379 of file hashfunc.h.

References HashKey< UB4Traits >::equal().

template<typename UB4Traits = ub4_default_traits>
HashKey& HashKey< UB4Traits >::operator= ( const char *  string  )  [inline]
template<typename UB4Traits = ub4_default_traits>
bool HashKey< UB4Traits >::operator== ( const HashKey< UB4Traits > &  other  )  const [inline]

Definition at line 376 of file hashfunc.h.

References HashKey< UB4Traits >::equal().


Field Documentation

template<typename UB4Traits = ub4_default_traits>
hash_t HashKey< UB4Traits >::m_hash [private]
template<typename UB4Traits = ub4_default_traits>
Array<ub4> HashKey< UB4Traits >::m_key [private]

The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2