DSBHash< VT > Class Template Reference

Direct hash with string keys and base type values. More...

#include <dsb_hash.h>

Inheritance diagram for DSBHash< VT >:
DHashBase< zmm::String, struct dsb_hash_slot< VT > > zmm::Object

Public Member Functions

 DSBHash (int capacity)
virtual ~DSBHash ()
void releaseData ()
virtual int hashCode (zmm::String key)
virtual bool match (zmm::String key, struct dsb_hash_slot< VT > *slot)
virtual bool isEmptySlot (struct dsb_hash_slot< VT > *slot)
void clear ()
void put (zmm::String key, VT value)
void put (zmm::String key, hash_slot_t destSlot, VT value)
VT get (zmm::String key)
VT get (zmm::String key, hash_slot_t *destSlot)
void zero ()
int size ()
virtual bool isDeletedSlot (struct dsb_hash_slot< VT > *slot)
int baseTypeHashCode (unsigned int key)
int secondaryHashCode (int primary)
bool search (zmm::Stringkey, struct dsb_hash_slot< VT > **retSlot)
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Attributes

int capacity
int count
struct dsb_hash_slot< VT > * data
mt_atomic_t _ref_count
pthread_mutex_t mutex

Detailed Description

template<typename VT>
class DSBHash< VT >

Direct hash with string keys and base type values.

Definition at line 47 of file dsb_hash.h.


Constructor & Destructor Documentation

template<typename VT >
DSBHash< VT >::DSBHash ( int  capacity  )  [inline]
template<typename VT >
virtual DSBHash< VT >::~DSBHash (  )  [inline, virtual]

Definition at line 54 of file dsb_hash.h.

References DSBHash< VT >::releaseData().


Member Function Documentation

int DHashBase< zmm::String , struct dsb_hash_slot< VT > >::baseTypeHashCode ( unsigned int  key  )  [inline, inherited]

Definition at line 74 of file direct_hash_base.h.

template<typename VT >
void DSBHash< VT >::clear (  )  [inline]
template<typename VT >
VT DSBHash< VT >::get ( zmm::String  key,
hash_slot_t destSlot 
) [inline]
template<typename VT >
VT DSBHash< VT >::get ( zmm::String  key  )  [inline]
int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

References zmm::Object::_ref_count, and atomic_get().

template<typename VT >
virtual int DSBHash< VT >::hashCode ( zmm::String  key  )  [inline, virtual]

Implements DHashBase< zmm::String, struct dsb_hash_slot< VT > >.

Definition at line 69 of file dsb_hash.h.

References stringHash().

virtual bool DHashBase< zmm::String , struct dsb_hash_slot< VT > >::isDeletedSlot ( struct dsb_hash_slot< VT > *  slot  )  [inline, virtual, inherited]

Definition at line 69 of file direct_hash_base.h.

template<typename VT >
virtual bool DSBHash< VT >::isEmptySlot ( struct dsb_hash_slot< VT > *  slot  )  [inline, virtual]

Implements DHashBase< zmm::String, struct dsb_hash_slot< VT > >.

Definition at line 77 of file dsb_hash.h.

References dsb_hash_slot< VT >::key, and NULL.

template<typename VT >
virtual bool DSBHash< VT >::match ( zmm::String  key,
struct dsb_hash_slot< VT > *  slot 
) [inline, virtual]
void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

template<typename VT >
void DSBHash< VT >::put ( zmm::String  key,
hash_slot_t  destSlot,
VT  value 
) [inline]
template<typename VT >
void DSBHash< VT >::put ( zmm::String  key,
VT  value 
) [inline]
void Object::release (  )  [inherited]
template<typename VT >
void DSBHash< VT >::releaseData (  )  [inline]
void Object::retain (  )  [inherited]
bool DHashBase< zmm::String , struct dsb_hash_slot< VT > >::search ( zmm::String  key,
struct dsb_hash_slot< VT > **  retSlot 
) [inline, inherited]

Definition at line 113 of file direct_hash_base.h.

Referenced by DSBHash< VT >::get(), and DSBHash< VT >::put().

int DHashBase< zmm::String , struct dsb_hash_slot< VT > >::secondaryHashCode ( int  primary  )  [inline, inherited]

Definition at line 103 of file direct_hash_base.h.

int DHashBase< zmm::String , struct dsb_hash_slot< VT > >::size (  )  [inline, inherited]

Definition at line 60 of file direct_hash_base.h.

void DHashBase< zmm::String , struct dsb_hash_slot< VT > >::zero (  )  [inline, inherited]

Definition at line 55 of file direct_hash_base.h.

Referenced by DSBHash< VT >::clear(), and DSBHash< VT >::DSBHash().


Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]
int DHashBase< zmm::String , struct dsb_hash_slot< VT > >::capacity [protected, inherited]

Definition at line 41 of file direct_hash_base.h.

Referenced by DSBHash< VT >::releaseData().

int DHashBase< zmm::String , struct dsb_hash_slot< VT > >::count [protected, inherited]

Definition at line 42 of file direct_hash_base.h.

Referenced by DSBHash< VT >::put().

struct dsb_hash_slot< VT > * DHashBase< zmm::String , struct dsb_hash_slot< VT > >::data [protected, inherited]

Definition at line 43 of file direct_hash_base.h.

Referenced by DSBHash< VT >::releaseData().

pthread_mutex_t zmm::Object::mutex [protected, inherited]

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

Generated on Fri Mar 26 20:16:56 2010 for MediaTomb by  doxygen 1.6.1