WvHashTable< T, K, Accessor, Comparator > Class Template Reference

Inheritance diagram for WvHashTable< T, K, Accessor, Comparator >:
[legend]
List of all members.

Detailed Description

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
class WvHashTable< T, K, Accessor, Comparator >

Definition at line 168 of file wvhashtable.h.

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 autofree)
WvLink * getlink (const K &key)
T * operator[] (const K &key) const
bool get_autofree (const K &key) const
 Returns the state of autofree for the element associated with key.
bool get_autofree (const T *data) const
void set_autofree (const K &key, bool autofree)
 Sets the state of autofree for the element associated with key.
void set_autofree (const T *data, bool autofree)
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

Classes

class  Iter


Constructor & Destructor Documentation

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
WvHashTable< T, K, Accessor, Comparator >::WvHashTable ( unsigned  _numslots  )  [inline]

Creates a hash table.

"numslots" is the suggested number of slots

Definition at line 188 of file wvhashtable.h.


Member Function Documentation

size_t WvHashTableBase::count (  )  const [inherited]

Returns the number of elements in the hash table.

Returns: the number of elements

Definition at line 51 of file wvhashtable.cc.

References WvHashTableBase::numslots, and WvHashTableBase::wvslots.

bool WvHashTableBase::isempty (  )  const [inherited]

Returns true if the hash table is empty.

Returns: true if empty

Definition at line 61 of file wvhashtable.cc.

References WvHashTableBase::numslots, and WvHashTableBase::wvslots.

Referenced by WvCallbackList< WvCallback< void, const UniConfKey &, WvStringParm > >::isempty().


The documentation for this class was generated from the following file:
Generated on Sun Sep 24 20:11:10 2006 for WvStreams by  doxygen 1.4.7