Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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

#include <wvscatterhash.h>

Inherits WvScatterHashBase.

Collaboration diagram for WvScatterHash< T, K, Accessor, Comparator >:

[legend]
List of all members.

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


Public Types

typedef WvSorter< T, WvScatterHashBase,
WvScatterHashBase::IterBase
Sorter

Public Member Functions

 WvScatterHash (unsigned _numslots=0)
virtual ~WvScatterHash ()
Toperator[] (const K &key) const
void add (const T *data, bool auto_free=false)
void remove (const T *data)
void set_autofree (const T *data, bool auto_free)
bool get_autofree (const T *data)
void zap ()
size_t count () const
bool isempty () const
size_t slowcount () const

Static Public Attributes

pair null_pair
const unsigned prime_numbers [] = {2u, 5u, 11u, 17u, 31u, 67u, 127u, 251u, 509u, 1021u, 2039u, 4093u, 8191u, 16381u, 32749u, 65521u, 131071u, 262139u, 524287u, 1048573u, 2097143u, 4194301u, 8388593u, 16777213u, 33554393u, 67108859u, 134217689u, 268435399u, 536870909u, 1073741789u, 2147483647u, 4294967281u}

Protected Types

typedef Comparator< K > MyComparator

Protected Member Functions

virtual bool compare (const void *key, const void *elem) const
unsigned hash (const T *data)
virtual unsigned do_hash (const void *data)
virtual void do_delete (void *data)
pair * genfind (const void *data, unsigned hash) const
void _add (void *data, bool auto_free)
void _add (void *data, unsigned hash, bool auto_free)
void _remove (const void *data, unsigned hash)
void _zap ()
void _set_autofree (const void *data, unsigned hash, bool auto_free)
bool _get_autofree (const void *data, unsigned hash)

Protected Attributes

pair * xslots
int prime_index
unsigned numslots

Friends

class IterBase

Member Typedef Documentation

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
typedef Comparator<K> WvScatterHash< T, K, Accessor, Comparator >::MyComparator [protected]
 

Definition at line 125 of file wvscatterhash.h.

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

Definition at line 177 of file wvscatterhash.h.


Constructor & Destructor Documentation

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

Definition at line 141 of file wvscatterhash.h.

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
virtual WvScatterHash< T, K, Accessor, Comparator >::~WvScatterHash  )  [inline, virtual]
 

Definition at line 142 of file wvscatterhash.h.


Member Function Documentation

void WvScatterHashBase::_add void *  data,
unsigned  hash,
bool  auto_free
[protected, inherited]
 

Definition at line 77 of file wvscatterhash.cc.

References IS_DELETED, and IS_OCCUPIED.

void WvScatterHashBase::_add void *  data,
bool  auto_free
[protected, inherited]
 

Definition at line 72 of file wvscatterhash.cc.

References WvScatterHashBase::do_hash().

Referenced by WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::add().

bool WvScatterHashBase::_get_autofree const void *  data,
unsigned  hash
[protected, inherited]
 

Definition at line 134 of file wvscatterhash.cc.

References WvScatterHashBase::genfind(), and IS_AUTO_FREE.

Referenced by WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::get_autofree().

void WvScatterHashBase::_remove const void *  data,
unsigned  hash
[protected, inherited]
 

Definition at line 99 of file wvscatterhash.cc.

References WvScatterHashBase::pair::data, WvScatterHashBase::do_delete(), WvScatterHashBase::genfind(), IS_AUTO_FREE, WvScatterHashBase::null_pair, and WvScatterHashBase::pair::status.

Referenced by WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::remove().

void WvScatterHashBase::_set_autofree const void *  data,
unsigned  hash,
bool  auto_free
[protected, inherited]
 

Definition at line 125 of file wvscatterhash.cc.

References WvScatterHashBase::genfind(), and WvScatterHashBase::pair::status.

Referenced by WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::set_autofree().

void WvScatterHashBase::_zap  )  [protected, inherited]
 

Definition at line 112 of file wvscatterhash.cc.

References WvScatterHashBase::do_delete(), and IS_AUTO_FREE.

Referenced by WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::zap(), and WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::~WvScatterHash().

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvScatterHash< T, K, Accessor, Comparator >::add const T data,
bool  auto_free = false
[inline]
 

Definition at line 147 of file wvscatterhash.h.

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
virtual bool WvScatterHash< T, K, Accessor, Comparator >::compare const void *  key,
const void *  elem
const [inline, protected, virtual]
 

Implements WvScatterHashBase.

Definition at line 127 of file wvscatterhash.h.

size_t WvScatterHashBase::count  )  const [inline, inherited]
 

Definition at line 37 of file wvscatterhash.h.

Referenced by WvScatterHashBase::slowcount().

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
virtual void WvScatterHash< T, K, Accessor, Comparator >::do_delete void *  data  )  [inline, protected, virtual]
 

Implements WvScatterHashBase.

Definition at line 137 of file wvscatterhash.h.

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
virtual unsigned WvScatterHash< T, K, Accessor, Comparator >::do_hash const void *  data  )  [inline, protected, virtual]
 

Implements WvScatterHashBase.

Definition at line 134 of file wvscatterhash.h.

struct WvScatterHashBase::pair * WvScatterHashBase::genfind const void *  data,
unsigned  hash
const [protected, inherited]
 

Definition at line 146 of file wvscatterhash.cc.

References IS_OCCUPIED.

Referenced by WvScatterHashBase::_get_autofree(), WvScatterHashBase::_remove(), WvScatterHashBase::_set_autofree(), and WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::operator[]().

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
bool WvScatterHash< T, K, Accessor, Comparator >::get_autofree const T data  )  [inline]
 

Definition at line 156 of file wvscatterhash.h.

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
unsigned WvScatterHash< T, K, Accessor, Comparator >::hash const T data  )  [inline, protected]
 

Definition at line 131 of file wvscatterhash.h.

Referenced by WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::add(), WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::do_hash(), WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::get_autofree(), WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::remove(), and WvScatterHash< UniHashTreeBase, UniConfKey, Accessor >::set_autofree().

bool WvScatterHashBase::isempty  )  const [inline, inherited]
 

Definition at line 38 of file wvscatterhash.h.

Referenced by UniHashTreeBase::haschildren().

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

Definition at line 144 of file wvscatterhash.h.

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvScatterHash< T, K, Accessor, Comparator >::remove const T data  )  [inline]
 

Definition at line 150 of file wvscatterhash.h.

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvScatterHash< T, K, Accessor, Comparator >::set_autofree const T data,
bool  auto_free
[inline]
 

Definition at line 153 of file wvscatterhash.h.

size_t WvScatterHashBase::slowcount  )  const [inherited]
 

Definition at line 36 of file wvscatterhash.cc.

References WvScatterHashBase::count(), IS_OCCUPIED, WvScatterHashBase::numslots, and WvScatterHashBase::xslots.

template<class T, class K, class Accessor, template< class > class Comparator = OpEqComp>
void WvScatterHash< T, K, Accessor, Comparator >::zap  )  [inline]
 

Definition at line 159 of file wvscatterhash.h.


Friends And Related Function Documentation

friend class IterBase [friend, inherited]
 

Definition at line 86 of file wvscatterhash.h.


Member Data Documentation

WvScatterHashBase::pair WvScatterHashBase::null_pair [static, inherited]
 

Definition at line 13 of file wvscatterhash.cc.

Referenced by WvScatterHashBase::_remove().

unsigned WvScatterHashBase::numslots [protected, inherited]
 

Definition at line 90 of file wvscatterhash.h.

Referenced by WvScatterHashBase::IterBase::cur(), WvScatterHashBase::IterBase::next(), WvScatterHashBase::slowcount(), and WvScatterHashBase::WvScatterHashBase().

int WvScatterHashBase::prime_index [protected, inherited]
 

Definition at line 89 of file wvscatterhash.h.

Referenced by WvScatterHashBase::WvScatterHashBase().

const unsigned WvScatterHashBase::prime_numbers = {2u, 5u, 11u, 17u, 31u, 67u, 127u, 251u, 509u, 1021u, 2039u, 4093u, 8191u, 16381u, 32749u, 65521u, 131071u, 262139u, 524287u, 1048573u, 2097143u, 4194301u, 8388593u, 16777213u, 33554393u, 67108859u, 134217689u, 268435399u, 536870909u, 1073741789u, 2147483647u, 4294967281u} [static, inherited]
 

Definition at line 11 of file wvscatterhash.cc.

Referenced by WvScatterHashBase::WvScatterHashBase().

pair* WvScatterHashBase::xslots [protected, inherited]
 

Definition at line 88 of file wvscatterhash.h.

Referenced by WvScatterHashBase::IterBase::get(), WvScatterHashBase::IterBase::get_autofree(), WvScatterHashBase::IterBase::next(), WvScatterHashBase::IterBase::set_autofree(), WvScatterHashBase::slowcount(), WvScatterHashBase::WvScatterHashBase(), and WvScatterHashBase::~WvScatterHashBase().


The documentation for this class was generated from the following file:
Generated on Sat Feb 21 21:06:55 2004 for WvStreams by doxygen 1.3.5