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

Classes

class  Iter
 

Public Types

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

Public Member Functions

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

Static Public Attributes

static const unsigned null_idx = (unsigned)-1
 
static const unsigned prime_numbers []
 

Protected Types

typedef Comparator< K > MyComparator
 
typedef Comparator< K > MyComparator
 
typedef void * Slot
 
typedef void * Slot
 
typedef unsigned char Status
 
typedef unsigned char Status
 

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)
 
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)
 
unsigned genfind (const void *data, unsigned hash) const
 
unsigned genfind (const void *data, unsigned hash) const
 
Slot genfind_or_null (const void *data, unsigned hash) const
 
Slot genfind_or_null (const void *data, unsigned hash) const
 
void _add (void *data, bool autofree)
 
void _add (void *data, unsigned hash, bool autofree)
 
void _add (void *data, bool autofree)
 
void _add (void *data, unsigned hash, bool autofree)
 
void _remove (const void *data, unsigned hash)
 
void _remove (const void *data, unsigned hash)
 
void _zap ()
 
void _zap ()
 
void _set_autofree (const void *data, unsigned hash, bool autofree)
 
void _set_autofree (const void *data, unsigned hash, bool autofree)
 
bool _get_autofree (const void *data, unsigned hash)
 
bool _get_autofree (const void *data, unsigned hash)
 

Protected Attributes

Slot * xslots
 
Status * xstatus
 
int prime_index
 
unsigned numslots
 

Detailed Description

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

Definition at line 125 of file debian/libwvstreams-dev/usr/include/wvstreams/wvscatterhash.h.

Member Typedef Documentation

◆ MyComparator [1/2]

template<class T , class K , class Accessor , template< class > class Comparator = OpEqComp>
typedef Comparator<K> WvScatterHash< 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, WvScatterHashBase, WvScatterHashBase::IterBase > WvScatterHash< T, K, Accessor, Comparator >::Sorter

◆ MyComparator [2/2]

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 128 of file include/wvscatterhash.h.

◆ Sorter [2/2]

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 195 of file include/wvscatterhash.h.

◆ Slot [1/2]

typedef void* WvScatterHashBase::Slot
protectedinherited

◆ Slot [2/2]

typedef void* WvScatterHashBase::Slot
protectedinherited

Definition at line 86 of file include/wvscatterhash.h.

◆ Status [1/2]

typedef unsigned char WvScatterHashBase::Status
protectedinherited

◆ Status [2/2]

typedef unsigned char WvScatterHashBase::Status
protectedinherited

Definition at line 87 of file include/wvscatterhash.h.

Constructor & Destructor Documentation

◆ WvScatterHash() [1/2]

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

◆ ~WvScatterHash() [1/2]

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

◆ WvScatterHash() [2/2]

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 144 of file include/wvscatterhash.h.

◆ ~WvScatterHash() [2/2]

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

Definition at line 145 of file include/wvscatterhash.h.

Member Function Documentation

◆ compare() [1/2]

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
inlineprotectedvirtual

◆ hash() [1/2]

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

◆ do_hash() [1/2]

template<class T , class K , class Accessor , template< class > class Comparator = OpEqComp>
virtual unsigned WvScatterHash< T, K, Accessor, Comparator >::do_hash ( const void *  data)
inlineprotectedvirtual

◆ do_delete() [1/2]

template<class T , class K , class Accessor , template< class > class Comparator = OpEqComp>
virtual void WvScatterHash< T, K, Accessor, Comparator >::do_delete ( void *  data)
inlineprotectedvirtual

◆ operator[]() [1/2]

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

◆ add() [1/2]

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

◆ remove() [1/2]

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

◆ set_autofree() [1/4]

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

◆ set_autofree() [2/4]

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

◆ get_autofree() [1/4]

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

◆ get_autofree() [2/4]

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

◆ zap() [1/2]

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

◆ compare() [2/2]

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
inlineprotectedvirtual

Implements WvScatterHashBase.

Definition at line 130 of file include/wvscatterhash.h.

◆ hash() [2/2]

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

Definition at line 134 of file include/wvscatterhash.h.

◆ do_hash() [2/2]

template<class T , class K , class Accessor , template< class > class Comparator = OpEqComp>
virtual unsigned WvScatterHash< T, K, Accessor, Comparator >::do_hash ( const void *  data)
inlineprotectedvirtual

Implements WvScatterHashBase.

Definition at line 137 of file include/wvscatterhash.h.

◆ do_delete() [2/2]

template<class T , class K , class Accessor , template< class > class Comparator = OpEqComp>
virtual void WvScatterHash< T, K, Accessor, Comparator >::do_delete ( void *  data)
inlineprotectedvirtual

Implements WvScatterHashBase.

Definition at line 140 of file include/wvscatterhash.h.

◆ operator[]() [2/2]

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 147 of file include/wvscatterhash.h.

◆ add() [2/2]

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

Definition at line 150 of file include/wvscatterhash.h.

◆ remove() [2/2]

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 153 of file include/wvscatterhash.h.

◆ set_autofree() [3/4]

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

Definition at line 156 of file include/wvscatterhash.h.

◆ set_autofree() [4/4]

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

Definition at line 161 of file include/wvscatterhash.h.

◆ get_autofree() [3/4]

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

Definition at line 166 of file include/wvscatterhash.h.

◆ get_autofree() [4/4]

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 171 of file include/wvscatterhash.h.

◆ zap() [2/2]

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

Definition at line 176 of file include/wvscatterhash.h.

◆ count() [1/2]

size_t WvScatterHashBase::count ( ) const
inlineinherited

◆ count() [2/2]

size_t WvScatterHashBase::count ( ) const
inlineinherited

Definition at line 31 of file include/wvscatterhash.h.

◆ isempty() [1/2]

bool WvScatterHashBase::isempty ( ) const
inlineinherited

◆ isempty() [2/2]

bool WvScatterHashBase::isempty ( ) const
inlineinherited

Definition at line 32 of file include/wvscatterhash.h.

◆ slowcount()

size_t WvScatterHashBase::slowcount ( ) const
inherited

Definition at line 46 of file wvscatterhash.cc.

◆ genfind()

unsigned WvScatterHashBase::genfind ( const void *  data,
unsigned  hash 
) const
protectedinherited

Definition at line 159 of file wvscatterhash.cc.

◆ genfind_or_null()

void * WvScatterHashBase::genfind_or_null ( const void *  data,
unsigned  hash 
) const
protectedinherited

Definition at line 181 of file wvscatterhash.cc.

◆ _add() [1/2]

void WvScatterHashBase::_add ( void *  data,
bool  autofree 
)
protectedinherited

Definition at line 86 of file wvscatterhash.cc.

◆ _add() [2/2]

void WvScatterHashBase::_add ( void *  data,
unsigned  hash,
bool  autofree 
)
protectedinherited

Definition at line 91 of file wvscatterhash.cc.

◆ _remove()

void WvScatterHashBase::_remove ( const void *  data,
unsigned  hash 
)
protectedinherited

Definition at line 113 of file wvscatterhash.cc.

◆ _zap()

void WvScatterHashBase::_zap ( )
protectedinherited

Definition at line 126 of file wvscatterhash.cc.

◆ _set_autofree()

void WvScatterHashBase::_set_autofree ( const void *  data,
unsigned  hash,
bool  autofree 
)
protectedinherited

Definition at line 139 of file wvscatterhash.cc.

◆ _get_autofree()

bool WvScatterHashBase::_get_autofree ( const void *  data,
unsigned  hash 
)
protectedinherited

Definition at line 148 of file wvscatterhash.cc.

Member Data Documentation

◆ null_idx

static const unsigned WvScatterHashBase::null_idx = (unsigned)-1
staticinherited

◆ prime_numbers

const unsigned WvScatterHashBase::prime_numbers
staticinherited
Initial value:
= {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}

Definition at line 12 of file debian/libwvstreams-dev/usr/include/wvstreams/wvscatterhash.h.

◆ xslots

Slot * WvScatterHashBase::xslots
protectedinherited

◆ xstatus

Status * WvScatterHashBase::xstatus
protectedinherited

◆ prime_index

int WvScatterHashBase::prime_index
protectedinherited

◆ numslots

unsigned WvScatterHashBase::numslots
protectedinherited

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