#include <wvhashtable.h>
Inherits WvHashTableBase.
Collaboration diagram for WvHashTable< T, K, Accessor, Comparator >:
Public Types | |
typedef WvSorter< T, WvHashTableBase, WvHashTableBase::IterBase > | Sorter |
Public Member Functions | |
WvHashTable (unsigned _numslots) | |
Creates a hash table. | |
WvList< T > * | sl () |
virtual | ~WvHashTable () |
void | add (T *data, bool auto_free) |
WvLink * | getlink (const K &key) |
T * | operator[] (const K &key) const |
void | remove (const T *data) |
void | zap () |
size_t | count () const |
Returns the number of elements in the hash table. | |
bool | isempty () const |
Returns true if the hash table is empty. | |
Public Attributes | |
unsigned | numslots |
WvListBase * | wvslots |
Protected Types | |
typedef Comparator< K > | MyComparator |
Protected Member Functions | |
unsigned | hash (const T *data) |
virtual bool | compare (const void *key, const void *elem) const |
void | setup () |
void | shutdown () |
WvLink * | prevlink (WvListBase *slots, const void *data, unsigned hash) const |
void * | genfind (WvListBase *slots, const void *data, unsigned hash) const |
|
Definition at line 175 of file wvhashtable.h. |
|
Definition at line 233 of file wvhashtable.h. |
|
Creates a hash table. "numslots" is the suggested number of slots Definition at line 190 of file wvhashtable.h. References WvHashTableBase::setup(). |
|
Definition at line 196 of file wvhashtable.h. References WvHashTableBase::shutdown(), and WvHashTable< T, K, Accessor, Comparator >::sl(). |
|
Definition at line 199 of file wvhashtable.h. References WvHashTable< T, K, Accessor, Comparator >::hash(), and WvHashTable< T, K, Accessor, Comparator >::sl(). Referenced by WvMap< TKey, TData, Comparator, BackendHash >::set(). |
|
Implements WvHashTableBase. Definition at line 180 of file wvhashtable.h. |
|
Returns the number of elements in the hash table. Returns: the number of elements Definition at line 79 of file wvhashtable.cc. References WvListBase::count(), WvHashTableBase::count(), and WvHashTableBase::wvslots. Referenced by WvHashTableBase::count(). |
|
Definition at line 68 of file wvhashtable.cc. References WvLink::data, WvLink::next, and WvHashTableBase::prevlink(). Referenced by WvHashTable< T, K, Accessor, Comparator >::operator[](). |
|
Definition at line 202 of file wvhashtable.h. References WvLink::next, WvHashTableBase::prevlink(), and WvHash(). |
|
Definition at line 177 of file wvhashtable.h. References WvHash(). Referenced by WvHashTable< T, K, Accessor, Comparator >::add(), and WvHashTable< T, K, Accessor, Comparator >::remove(). |
|
Returns true if the hash table is empty. Returns: true if empty Definition at line 89 of file wvhashtable.cc. References WvListBase::isempty(), and WvHashTableBase::wvslots. |
|
Definition at line 205 of file wvhashtable.h. References WvHashTableBase::genfind(), and WvHash(). |
|
Definition at line 52 of file wvhashtable.cc. References WvHashTableBase::compare(), WvListBase::IterBase::cur(), WvLink::data, WvListBase::IterBase::next(), WvLink::next, WvHashTableBase::numslots, and WvListBase::IterBase::rewind(). Referenced by WvHashTableBase::genfind(), WvHashTable< T, K, Accessor, Comparator >::getlink(), and WvHashTable< T, K, Accessor, Comparator >::remove(). |
|
Definition at line 208 of file wvhashtable.h. References WvHashTable< T, K, Accessor, Comparator >::hash(), WvLink::next, WvHashTableBase::prevlink(), and WvHashTable< T, K, Accessor, Comparator >::sl(). Referenced by WvMap< TKey, TData, Comparator, BackendHash >::set(). |
|
Definition at line 98 of file wvhashtable.h. Referenced by WvHashTable< T, K, Accessor, Comparator >::WvHashTable(). |
|
Definition at line 100 of file wvhashtable.h. Referenced by WvHashTable< T, K, Accessor, Comparator >::~WvHashTable(). |
|
Definition at line 193 of file wvhashtable.h. Referenced by WvHashTable< T, K, Accessor, Comparator >::add(), WvHashTable< T, K, Accessor, Comparator >::remove(), WvHashTable< T, K, Accessor, Comparator >::zap(), and WvHashTable< T, K, Accessor, Comparator >::~WvHashTable(). |
|
Definition at line 215 of file wvhashtable.h. References WvHashTable< T, K, Accessor, Comparator >::sl(). |
|
Definition at line 107 of file wvhashtable.h. Referenced by WvHashTableBase::IterBase::next(), WvHashTableBase::prevlink(), and WvHashTableBase::WvHashTableBase(). |
|
Definition at line 108 of file wvhashtable.h. Referenced by WvHashTableBase::count(), WvHashTableBase::isempty(), WvHashTableBase::IterBase::next(), and WvHashTableBase::IterBase::rewind(). |