WvStreams
Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | List of all members
WvHashTable< T, K, Accessor, Comparator > Class Template Reference
Inheritance diagram for WvHashTable< T, K, Accessor, Comparator >:
Inheritance graph
[legend]

Classes

class  Iter
 

Public Types

typedef class WvSorter< T, WvHashTableBase, WvHashTableBase::IterBaseSorter
 

Public Member Functions

 WvHashTable (unsigned _numslots)
 Creates a hash table. More...
 
WvList< T > * sl ()
 
void add (T *data, bool autofree)
 
WvLinkgetlink (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. More...
 
bool isempty () const
 Returns true if the hash table is empty. More...
 

Public Attributes

unsigned numslots
 
WvListBasewvslots
 

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 ()
 
WvLinkprevlink (WvListBase *slots, const void *data, unsigned hash) const
 
void * genfind (WvListBase *slots, const void *data, unsigned hash) const
 

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.

Constructor & Destructor Documentation

◆ WvHashTable()

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

◆ count()

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.

◆ isempty()

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.


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