Stun Server  Compliant with the latest RFCs including 5389, 5769, and 5780
discover the local host's own external IP address
FastHashBase< K, V > Class Template Reference

#include <fasthash.h>

Inheritance diagram for FastHashBase< K, V >:
Collaboration diagram for FastHashBase< K, V >:

Classes

struct  Item
 
struct  ItemNode
 

Public Member Functions

 FastHashBase ()
 
 FastHashBase (size_t fsize, size_t tsize, Item *nodelist, ItemNode *itemnodelist, ItemNode **table, int *indexlist)
 
void Init (size_t fsize, size_t tsize, Item *nodelist, ItemNode *itemnodelist, ItemNode **table, int *indexlist)
 
void Reset ()
 
bool IsValid ()
 
size_t Size ()
 
size_t GetMaxCapacity ()
 
size_t GetTableWidth ()
 
int Insert (const K &key, V &value)
 
int Remove (const K &key)
 
V * Lookup (const K &key)
 
bool Exists (const K &key)
 
ItemLookupByIndex (size_t index)
 
V * LookupValueByIndex (size_t index)
 

Protected Types

typedef ItemNodeItemNodePtr
 

Protected Member Functions

 FastHashBase (const FastHashBase &)
 
FastHashBaseoperator= (const FastHashBase &)
 
bool operator== (const FastHashBase &)
 
ItemNodeFind (const K &key, size_t *pHashIndex=NULL, ItemNode **ppPrev=NULL)
 
void ReIndex ()
 
void UpdateIndexWithAdd (ItemNode *pNode)
 
void UpdateIndexWithRemove (ItemNode *pNode)
 

Protected Attributes

size_t _fsize
 
size_t _tsize
 
Item_nodes
 
ItemNode_itemnodes
 
ItemNode_freelist
 
ItemNodePtr_lookuptable
 
int * _indexlist
 
bool _fIndexValid
 
size_t _indexStart
 
size_t _size
 

Detailed Description

template<typename K, typename V>
class FastHashBase< K, V >

Definition at line 56 of file fasthash.h.

Member Typedef Documentation

template<typename K, typename V>
typedef ItemNode* FastHashBase< K, V >::ItemNodePtr
protected

Definition at line 75 of file fasthash.h.

Constructor & Destructor Documentation

template<typename K, typename V>
FastHashBase< K, V >::FastHashBase ( const FastHashBase< K, V > &  )
inlineprotected

Definition at line 93 of file fasthash.h.

template<typename K, typename V>
FastHashBase< K, V >::FastHashBase ( )
inline

Definition at line 210 of file fasthash.h.

template<typename K, typename V>
FastHashBase< K, V >::FastHashBase ( size_t  fsize,
size_t  tsize,
Item nodelist,
ItemNode itemnodelist,
ItemNode **  table,
int *  indexlist 
)
inline

Definition at line 216 of file fasthash.h.

Member Function Documentation

template<typename K, typename V>
bool FastHashBase< K, V >::Exists ( const K &  key)
inline

Definition at line 363 of file fasthash.h.

template<typename K, typename V>
ItemNode* FastHashBase< K, V >::Find ( const K &  key,
size_t *  pHashIndex = NULL,
ItemNode **  ppPrev = NULL 
)
inlineprotected

Definition at line 99 of file fasthash.h.

template<typename K, typename V>
size_t FastHashBase< K, V >::GetMaxCapacity ( )
inline

Definition at line 274 of file fasthash.h.

template<typename K, typename V>
size_t FastHashBase< K, V >::GetTableWidth ( )
inline

Definition at line 279 of file fasthash.h.

template<typename K, typename V>
void FastHashBase< K, V >::Init ( size_t  fsize,
size_t  tsize,
Item nodelist,
ItemNode itemnodelist,
ItemNode **  table,
int *  indexlist 
)
inline

Definition at line 221 of file fasthash.h.

template<typename K, typename V>
int FastHashBase< K, V >::Insert ( const K &  key,
V &  value 
)
inline

Definition at line 284 of file fasthash.h.

template<typename K, typename V>
bool FastHashBase< K, V >::IsValid ( )
inline

Definition at line 264 of file fasthash.h.

template<typename K, typename V>
V* FastHashBase< K, V >::Lookup ( const K &  key)
inline

Definition at line 351 of file fasthash.h.

template<typename K, typename V>
Item* FastHashBase< K, V >::LookupByIndex ( size_t  index)
inline

Definition at line 368 of file fasthash.h.

template<typename K, typename V>
V* FastHashBase< K, V >::LookupValueByIndex ( size_t  index)
inline

Definition at line 392 of file fasthash.h.

template<typename K, typename V>
FastHashBase& FastHashBase< K, V >::operator= ( const FastHashBase< K, V > &  )
inlineprotected

Definition at line 94 of file fasthash.h.

template<typename K, typename V>
bool FastHashBase< K, V >::operator== ( const FastHashBase< K, V > &  )
inlineprotected

Definition at line 95 of file fasthash.h.

template<typename K, typename V>
void FastHashBase< K, V >::ReIndex ( )
inlineprotected

Definition at line 128 of file fasthash.h.

template<typename K, typename V>
int FastHashBase< K, V >::Remove ( const K &  key)
inline

Definition at line 316 of file fasthash.h.

template<typename K, typename V>
void FastHashBase< K, V >::Reset ( )
inline

Definition at line 239 of file fasthash.h.

template<typename K, typename V>
size_t FastHashBase< K, V >::Size ( )
inline

Definition at line 269 of file fasthash.h.

template<typename K, typename V>
void FastHashBase< K, V >::UpdateIndexWithAdd ( ItemNode pNode)
inlineprotected

Definition at line 152 of file fasthash.h.

template<typename K, typename V>
void FastHashBase< K, V >::UpdateIndexWithRemove ( ItemNode pNode)
inlineprotected

Definition at line 166 of file fasthash.h.

Member Data Documentation

template<typename K, typename V>
bool FastHashBase< K, V >::_fIndexValid
protected

Definition at line 87 of file fasthash.h.

template<typename K, typename V>
ItemNode* FastHashBase< K, V >::_freelist
protected

Definition at line 82 of file fasthash.h.

template<typename K, typename V>
size_t FastHashBase< K, V >::_fsize
protected

Definition at line 77 of file fasthash.h.

template<typename K, typename V>
int* FastHashBase< K, V >::_indexlist
protected

Definition at line 86 of file fasthash.h.

template<typename K, typename V>
size_t FastHashBase< K, V >::_indexStart
protected

Definition at line 88 of file fasthash.h.

template<typename K, typename V>
ItemNode* FastHashBase< K, V >::_itemnodes
protected

Definition at line 81 of file fasthash.h.

template<typename K, typename V>
ItemNodePtr* FastHashBase< K, V >::_lookuptable
protected

Definition at line 83 of file fasthash.h.

template<typename K, typename V>
Item* FastHashBase< K, V >::_nodes
protected

Definition at line 80 of file fasthash.h.

template<typename K, typename V>
size_t FastHashBase< K, V >::_size
protected

Definition at line 90 of file fasthash.h.

template<typename K, typename V>
size_t FastHashBase< K, V >::_tsize
protected

Definition at line 78 of file fasthash.h.


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