B2BITS FIX Antenna HFT  1.0.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Typedefs | Functions
hash_table_iface.h File Reference
#include "b2b_platform.h"
#include "sockets_logging.h"
#include <algorithm>
+ Include dependency graph for hash_table_iface.h:
+ This graph shows which files directly or indirectly include this file:

Classes

struct  HashCalc< ElementKeyType >
 
struct  HashCalc< char * >
 
struct  HashCalcStr
 
struct  HashEQComparator< ElementKeyType >
 
struct  HashEQComparator< char * >
 
struct  HashEQComparatorStr
 
class  HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >
 
class  HashTable< ElementType, ElementKeyType, ElementKeyHashFunction, ElementEQComparator, ElementKeyCopier >::iterator
 
struct  KeyCopier< ElementKeyType >
 
struct  KeyCopier< char * >
 
struct  KeyCopierStr
 
struct  ShortStrRefCtorHash
 

Macros

#define BEGIN_DEFINE_KEY_MEMBER(ElementKeyType, keyMember)
 
#define BEGIN_DEFINE_KEY_MEMBER_AS_ARRAY(ElementKeyType, keyMember, size)
 
#define DATA_ARRAY_SIZE(max_elements, ElementType)   ((max_elements) * sizeof(ElementType))
 
#define ELEM_TO_IDX(__elem)   ((elem_index_t) ( (__elem) ? (__elem) - array : -1 ))
 
#define END_DEFINE_HASH_MEMBERS(ElemType)   elem_index_t __next;
 
#define FULL_CONTAINER_SIZE(max_elements, ElementType)   (HASH_SIZE_ADJUST(max_elements) * sizeof(*htable) + (max_elements) * sizeof(ElementType))
 
#define HASH_SIZE_ADJUST(count)   ((int)((count) * HASH_SPARSITY_RATIO))
 
#define HASH_SPARSITY_RATIO   1
 
#define HASHTABLE_ENTRIES(max_elements)   (HASH_SIZE_ADJUST(max_elements))
 
#define HASHTABLE_SIZE(max_elements)   (HASH_SIZE_ADJUST(max_elements) * sizeof(*htable))
 
#define IDX_TO_ELEM(__idx)   ( (__idx) == -1 ? NULL : &array[__idx] )
 
#define IDX_TO_ELEM_DEREF(__idx)   (&array[__idx])
 

Typedefs

typedef unsigned elem_index_t
 
typedef unsigned hashvalue_t
 

Functions

static hashvalue_t hash_string (const char *str)
 
static hashvalue_t hash_string2 (const char *str, int len)
 
static hashvalue_t hash_uint32 (uint32_t n)
 
template<class ElementType >
static void hashtable_cleanElem (ElementType *elem)
 

Macro Definition Documentation

#define BEGIN_DEFINE_KEY_MEMBER (   ElementKeyType,
  keyMember 
)
Value:
union { \
ElementKeyType __key; \
ElementKeyType keyMember; \
};
#define BEGIN_DEFINE_KEY_MEMBER_AS_ARRAY (   ElementKeyType,
  keyMember,
  size 
)
Value:
union { \
ElementKeyType __key[size]; \
ElementKeyType keyMember[size]; \
};
#define DATA_ARRAY_SIZE (   max_elements,
  ElementType 
)    ((max_elements) * sizeof(ElementType))
#define ELEM_TO_IDX (   __elem)    ((elem_index_t) ( (__elem) ? (__elem) - array : -1 ))
#define END_DEFINE_HASH_MEMBERS (   ElemType)    elem_index_t __next;
#define FULL_CONTAINER_SIZE (   max_elements,
  ElementType 
)    (HASH_SIZE_ADJUST(max_elements) * sizeof(*htable) + (max_elements) * sizeof(ElementType))
#define HASH_SIZE_ADJUST (   count)    ((int)((count) * HASH_SPARSITY_RATIO))
#define HASH_SPARSITY_RATIO   1
#define HASHTABLE_ENTRIES (   max_elements)    (HASH_SIZE_ADJUST(max_elements))
#define HASHTABLE_SIZE (   max_elements)    (HASH_SIZE_ADJUST(max_elements) * sizeof(*htable))
#define IDX_TO_ELEM (   __idx)    ( (__idx) == -1 ? NULL : &array[__idx] )
#define IDX_TO_ELEM_DEREF (   __idx)    (&array[__idx])

Typedef Documentation

typedef unsigned elem_index_t
typedef unsigned hashvalue_t

Function Documentation

static hashvalue_t hash_string ( const char *  str)
inlinestatic
static hashvalue_t hash_string2 ( const char *  str,
int  len 
)
inlinestatic
static hashvalue_t hash_uint32 ( uint32_t  n)
inlinestatic
template<class ElementType >
static void hashtable_cleanElem ( ElementType *  elem)
static