B2BITS FIX Antenna HFT  1.0.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier > Class Template Reference

#include <hash_table_iface.h>

+ Collaboration diagram for HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >:

Classes

class  iterator
 

Public Member Functions

template<typename ElementKeyType2 >
int _findOrAdd (const ElementKeyType2 &key, ElementType **addedElement, int *elemExists, bool cleanElem)
 
int addReplace (ElementType *elem, ElementType **addedElement=NULL, int *elemExists=NULL)
 
template<typename ElementKeyType2 >
int addReplace_CleanElem (const ElementKeyType2 &key, ElementType **addedElement, int *elemExists)
 
int allocSize ()
 
template<typename ElementKeyType2 >
int append (const ElementKeyType2 &key, ElementType **addedElement, bool bCleanElem)
 
void clear ()
 
void createElem (ElementType *elem)
 
void destroyElem (ElementType *elem)
 
int EQ_COMPARATOR (ElementType *e1, ElementType *e2)
 
template<typename ElementKeyType2 >
int findOrAdd (const ElementKeyType2 &key, ElementType **addedElement, int *elemExists)
 
template<typename ElementKeyType2 >
int findOrAdd_CleanElem (const ElementKeyType2 &key, ElementType **addedElement=NULL, int *elemExists=NULL)
 
hashvalue_t hash_function (ElementType *e)
 
template<typename ElementKeyType2 >
hashvalue_t hash_function_key (const ElementKeyType2 &key)
 
 HashTable ()
 
void init (const char *aname, int num_elements, void *allocatedMemory)
 
template<class Allocator >
void init (const char *aname, int num_elements, Allocator &allocator)
 
void init (const char *aname, int num_elements)
 
ElementType * init_iterator (iterator &it)
 
bool isFull ()
 
bool isMember (ElementType *elem)
 
template<typename ElementKeyType2 >
int Key_EQ_COMPARATOR (ElementType *e1, const ElementKeyType2 &key2)
 
template<typename ElementKeyType2 >
ElementType * lookupByHashedKey (const ElementKeyType2 &key, hashvalue_t hash)
 
template<typename ElementKeyType2 >
ElementType * lookupByKey (const ElementKeyType2 &key)
 
int maxElements ()
 
int minAllowedElements (int num_elements)
 
int numElements ()
 
void * release ()
 
void remove (ElementType *element)
 
template<typename ElementKeyType2 >
bool removeByKey (const ElementKeyType2 &key)
 
void swap (HashTable &rhs)
 
 ~HashTable ()
 

Static Public Member Functions

static void cleanElem (ElementType *elem)
 
static void copyElem (ElementType *dst, ElementType *src)
 

Public Attributes

SPINLOCK_T lock
 
std::string name
 
rwlock rwlock_
 

Constructor & Destructor Documentation

template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::HashTable ( )
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::~HashTable ( )
inline

Member Function Documentation

template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
template<typename ElementKeyType2 >
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::_findOrAdd ( const ElementKeyType2 &  key,
ElementType **  addedElement,
int *  elemExists,
bool  cleanElem 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::addReplace ( ElementType *  elem,
ElementType **  addedElement = NULL,
int *  elemExists = NULL 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
template<typename ElementKeyType2 >
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::addReplace_CleanElem ( const ElementKeyType2 &  key,
ElementType **  addedElement,
int *  elemExists 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::allocSize ( )
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
template<typename ElementKeyType2 >
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::append ( const ElementKeyType2 &  key,
ElementType **  addedElement,
bool  bCleanElem 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
static void HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::cleanElem ( ElementType *  elem)
inlinestatic
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
void HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::clear ( )
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
static void HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::copyElem ( ElementType *  dst,
ElementType *  src 
)
inlinestatic
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
void HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::createElem ( ElementType *  elem)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
void HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::destroyElem ( ElementType *  elem)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::EQ_COMPARATOR ( ElementType *  e1,
ElementType *  e2 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
template<typename ElementKeyType2 >
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::findOrAdd ( const ElementKeyType2 &  key,
ElementType **  addedElement,
int *  elemExists 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
template<typename ElementKeyType2 >
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::findOrAdd_CleanElem ( const ElementKeyType2 &  key,
ElementType **  addedElement = NULL,
int *  elemExists = NULL 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
hashvalue_t HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::hash_function ( ElementType *  e)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
template<typename ElementKeyType2 >
hashvalue_t HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::hash_function_key ( const ElementKeyType2 &  key)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
void HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::init ( const char *  aname,
int  num_elements,
void *  allocatedMemory 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
template<class Allocator >
void HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::init ( const char *  aname,
int  num_elements,
Allocator &  allocator 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
void HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::init ( const char *  aname,
int  num_elements 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
ElementType* HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::init_iterator ( iterator it)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
bool HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::isFull ( )
inline

References HASHTABLE_ENTRIES.

template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
bool HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::isMember ( ElementType *  elem)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
template<typename ElementKeyType2 >
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::Key_EQ_COMPARATOR ( ElementType *  e1,
const ElementKeyType2 &  key2 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
template<typename ElementKeyType2 >
ElementType* HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::lookupByHashedKey ( const ElementKeyType2 &  key,
hashvalue_t  hash 
)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
template<typename ElementKeyType2 >
ElementType* HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::lookupByKey ( const ElementKeyType2 &  key)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::maxElements ( )
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::minAllowedElements ( int  num_elements)
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
int HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::numElements ( )
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
void* HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::release ( )
inline
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
void HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::remove ( ElementType *  element)
inline

References ELEM_TO_IDX.

template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
template<typename ElementKeyType2 >
bool HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::removeByKey ( const ElementKeyType2 &  key)
inline

References ELEM_TO_IDX.

template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
void HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::swap ( HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier > &  rhs)
inline

Member Data Documentation

template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
SPINLOCK_T HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::lock
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
std::string HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::name
template<typename ElementType , typename ElementKeyType , typename ElementKeyHashFunction = HashCalc<ElementKeyType>, typename ElementEQComparator = HashEQComparator<ElementKeyType>, typename ElementKeyCopier = KeyCopier<ElementKeyType>>
rwlock HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::rwlock_