WvStreams
WvHashTable< T, K, Accessor, Comparator > Class Template Reference
Inheritance diagram for WvHashTable< T, K, Accessor, Comparator >:

Classes

class  Iter

Public Types

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

Public Member Functions

 WvHashTable (unsigned _numslots)
 Creates a hash table.
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 ()
 WvHashTable (unsigned _numslots)
 Creates a hash table.
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.
size_t count () const
 Returns the number of elements in the hash table.
bool isempty () const
 Returns true if the hash table is empty.
bool isempty () const
 Returns true if the hash table is empty.

Public Attributes

unsigned numslots
WvListBasewvslots

Protected Types

typedef Comparator< K > MyComparator
typedef Comparator< K > MyComparator

Protected Member Functions

unsigned hash (const T *data)
virtual bool compare (const void *key, const void *elem) const
unsigned hash (const T *data)
virtual bool compare (const void *key, const void *elem) const
void setup ()
void setup ()
void shutdown ()
void shutdown ()
WvLinkprevlink (WvListBase *slots, const void *data, unsigned hash) const
WvLinkprevlink (WvListBase *slots, const void *data, unsigned hash) const
void * genfind (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 debian/libwvstreams-dev/usr/include/wvstreams/wvhashtable.h.

Member Typedef Documentation

◆ MyComparator [1/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
typedef Comparator<K> WvHashTable< T, K, Accessor, Comparator >::MyComparator
protected

◆ Sorter [1/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
typedef class WvSorter< T, WvHashTableBase, WvHashTableBase::IterBase > WvHashTable< T, K, Accessor, Comparator >::Sorter

◆ MyComparator [2/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
typedef Comparator<K> WvHashTable< T, K, Accessor, Comparator >::MyComparator
protected

Definition at line 173 of file include/wvhashtable.h.

◆ Sorter [2/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
typedef class WvSorter< T, WvHashTableBase, WvHashTableBase::IterBase > WvHashTable< T, K, Accessor, Comparator >::Sorter

Definition at line 263 of file include/wvhashtable.h.

Constructor & Destructor Documentation

◆ WvHashTable() [1/2]

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 debian/libwvstreams-dev/usr/include/wvstreams/wvhashtable.h.

◆ ~WvHashTable() [1/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
virtual WvHashTable< T, K, Accessor, Comparator >::~WvHashTable ( )
inlinevirtual

◆ WvHashTable() [2/2]

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 include/wvhashtable.h.

◆ ~WvHashTable() [2/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
virtual WvHashTable< T, K, Accessor, Comparator >::~WvHashTable ( )
inlinevirtual

Definition at line 194 of file include/wvhashtable.h.

Member Function Documentation

◆ hash() [1/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
unsigned WvHashTable< T, K, Accessor, Comparator >::hash ( const T * data)
inlineprotected

◆ compare() [1/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
virtual bool WvHashTable< T, K, Accessor, Comparator >::compare ( const void * key,
const void * elem ) const
inlineprotectedvirtual

◆ sl() [1/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
WvList< T > * WvHashTable< T, K, Accessor, Comparator >::sl ( )
inline

◆ add() [1/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvHashTable< T, K, Accessor, Comparator >::add ( T * data,
bool autofree )
inline

◆ getlink() [1/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
WvLink * WvHashTable< T, K, Accessor, Comparator >::getlink ( const K & key)
inline

◆ operator[]() [1/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
T * WvHashTable< T, K, Accessor, Comparator >::operator[] ( const K & key) const
inline

◆ get_autofree() [1/4]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
bool WvHashTable< T, K, Accessor, Comparator >::get_autofree ( const K & key) const
inline

Returns the state of autofree for the element associated with key.

Definition at line 209 of file debian/libwvstreams-dev/usr/include/wvstreams/wvhashtable.h.

◆ get_autofree() [2/4]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
bool WvHashTable< T, K, Accessor, Comparator >::get_autofree ( const T * data) const
inline

◆ set_autofree() [1/4]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvHashTable< T, K, Accessor, Comparator >::set_autofree ( const K & key,
bool autofree )
inline

Sets the state of autofree for the element associated with key.

Definition at line 225 of file debian/libwvstreams-dev/usr/include/wvstreams/wvhashtable.h.

◆ set_autofree() [2/4]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvHashTable< T, K, Accessor, Comparator >::set_autofree ( const T * data,
bool autofree )
inline

◆ remove() [1/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvHashTable< T, K, Accessor, Comparator >::remove ( const T * data)
inline

◆ zap() [1/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvHashTable< T, K, Accessor, Comparator >::zap ( )
inline

◆ hash() [2/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
unsigned WvHashTable< T, K, Accessor, Comparator >::hash ( const T * data)
inlineprotected

Definition at line 175 of file include/wvhashtable.h.

◆ compare() [2/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
virtual bool WvHashTable< T, K, Accessor, Comparator >::compare ( const void * key,
const void * elem ) const
inlineprotectedvirtual

Implements WvHashTableBase.

Definition at line 178 of file include/wvhashtable.h.

◆ sl() [2/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
WvList< T > * WvHashTable< T, K, Accessor, Comparator >::sl ( )
inline

Definition at line 191 of file include/wvhashtable.h.

◆ add() [2/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvHashTable< T, K, Accessor, Comparator >::add ( T * data,
bool autofree )
inline

Definition at line 197 of file include/wvhashtable.h.

◆ getlink() [2/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
WvLink * WvHashTable< T, K, Accessor, Comparator >::getlink ( const K & key)
inline

Definition at line 200 of file include/wvhashtable.h.

◆ operator[]() [2/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
T * WvHashTable< T, K, Accessor, Comparator >::operator[] ( const K & key) const
inline

Definition at line 203 of file include/wvhashtable.h.

◆ get_autofree() [3/4]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
bool WvHashTable< T, K, Accessor, Comparator >::get_autofree ( const K & key) const
inline

Returns the state of autofree for the element associated with key.

Definition at line 209 of file include/wvhashtable.h.

◆ get_autofree() [4/4]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
bool WvHashTable< T, K, Accessor, Comparator >::get_autofree ( const T * data) const
inline

Definition at line 217 of file include/wvhashtable.h.

◆ set_autofree() [3/4]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvHashTable< T, K, Accessor, Comparator >::set_autofree ( const K & key,
bool autofree )
inline

Sets the state of autofree for the element associated with key.

Definition at line 225 of file include/wvhashtable.h.

◆ set_autofree() [4/4]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvHashTable< T, K, Accessor, Comparator >::set_autofree ( const T * data,
bool autofree )
inline

Definition at line 232 of file include/wvhashtable.h.

◆ remove() [2/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvHashTable< T, K, Accessor, Comparator >::remove ( const T * data)
inline

Definition at line 237 of file include/wvhashtable.h.

◆ zap() [2/2]

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvHashTable< T, K, Accessor, Comparator >::zap ( )
inline

Definition at line 244 of file include/wvhashtable.h.

◆ setup() [1/2]

void WvHashTableBase::setup ( )
inlineprotectedinherited

◆ setup() [2/2]

void WvHashTableBase::setup ( )
inlineprotectedinherited

Definition at line 96 of file include/wvhashtable.h.

◆ shutdown() [1/2]

void WvHashTableBase::shutdown ( )
inlineprotectedinherited

◆ shutdown() [2/2]

void WvHashTableBase::shutdown ( )
inlineprotectedinherited

Definition at line 98 of file include/wvhashtable.h.

◆ prevlink()

WvLink * WvHashTableBase::prevlink ( WvListBase * slots,
const void * data,
unsigned hash ) const
protectedinherited

Definition at line 24 of file wvhashtable.cc.

◆ genfind()

void * WvHashTableBase::genfind ( WvListBase * slots,
const void * data,
unsigned hash ) const
protectedinherited

Definition at line 40 of file wvhashtable.cc.

◆ count() [1/2]

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 count().

Referenced by count().

◆ count() [2/2]

size_t WvHashTableBase::count ( ) const
inherited

Returns the number of elements in the hash table.

Returns: the number of elements

◆ isempty() [1/2]

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 isempty().

Referenced by isempty().

◆ isempty() [2/2]

bool WvHashTableBase::isempty ( ) const
inherited

Returns true if the hash table is empty.

Returns: true if empty

Member Data Documentation

◆ numslots

unsigned WvHashTableBase::numslots
inherited

◆ wvslots

WvListBase * WvHashTableBase::wvslots
inherited

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