DBHash< KT > Class Template Reference

Direct hash with base type keys only. More...

#include <db_hash.h>

Inheritance diagram for DBHash< KT >:
DHashBase< KT, KT > zmm::Object

Public Member Functions

 DBHash (int capacity, KT emptyKey, KT deletedKey)
virtual int hashCode (KT key)
virtual bool match (KT key, KT *slot)
virtual bool isEmptySlot (KT *slot)
virtual bool isDeletedSlot (KT *slot)
void clear ()
bool remove (KT key)
void put (KT key)
void put (KT key, hash_slot_t destSlot)
bool exists (KT key)
bool exists (KT key, hash_slot_t *destSlot)
void zero ()
int size ()
int baseTypeHashCode (unsigned int key)
int secondaryHashCode (int primary)
bool search (KTkey, KT **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

KT emptyKey
KT deletedKey
int capacity
int count
KT * data
mt_atomic_t _ref_count
pthread_mutex_t mutex

Detailed Description

template<typename KT>
class DBHash< KT >

Direct hash with base type keys only.

Definition at line 39 of file db_hash.h.


Constructor & Destructor Documentation

template<typename KT >
DBHash< KT >::DBHash ( int  capacity,
KT  emptyKey,
KT  deletedKey 
) [inline]

Definition at line 45 of file db_hash.h.

References DBHash< KT >::clear().


Member Function Documentation

int DHashBase< KT , KT >::baseTypeHashCode ( unsigned int  key  )  [inline, inherited]

Definition at line 74 of file direct_hash_base.h.

Referenced by DBHash< KT >::hashCode().

template<typename KT >
void DBHash< KT >::clear (  )  [inline]
template<typename KT >
bool DBHash< KT >::exists ( KT  key,
hash_slot_t destSlot 
) [inline]

Definition at line 119 of file db_hash.h.

References DHashBase< KT, KT >::search().

template<typename KT >
bool DBHash< KT >::exists ( KT  key  )  [inline]

Definition at line 114 of file db_hash.h.

References DHashBase< KT, KT >::search().

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

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

template<typename KT >
virtual int DBHash< KT >::hashCode ( KT  key  )  [inline, virtual]

Implements DHashBase< KT, KT >.

Definition at line 55 of file db_hash.h.

References DHashBase< KT, KT >::baseTypeHashCode().

template<typename KT >
virtual bool DBHash< KT >::isDeletedSlot ( KT *  slot  )  [inline, virtual]

Reimplemented from DHashBase< KT, KT >.

Definition at line 68 of file db_hash.h.

References DBHash< KT >::deletedKey.

template<typename KT >
virtual bool DBHash< KT >::isEmptySlot ( KT *  slot  )  [inline, virtual]

Implements DHashBase< KT, KT >.

Definition at line 63 of file db_hash.h.

References DBHash< KT >::emptyKey.

template<typename KT >
virtual bool DBHash< KT >::match ( KT  key,
KT *  slot 
) [inline, virtual]

Implements DHashBase< KT, KT >.

Definition at line 59 of file db_hash.h.

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 KT >
void DBHash< KT >::put ( KT  key,
hash_slot_t  destSlot 
) [inline]

Definition at line 104 of file db_hash.h.

References DHashBase< KT, KT >::count, and DBHash< KT >::emptyKey.

template<typename KT >
void DBHash< KT >::put ( KT  key  )  [inline]

Definition at line 95 of file db_hash.h.

References DHashBase< KT, KT >::count, and DHashBase< KT, KT >::search().

void Object::release (  )  [inherited]
template<typename KT >
bool DBHash< KT >::remove ( KT  key  )  [inline]
void Object::retain (  )  [inherited]
bool DHashBase< KT , KT >::search ( KT  key,
KT **  retSlot 
) [inline, inherited]
int DHashBase< KT , KT >::secondaryHashCode ( int  primary  )  [inline, inherited]

Definition at line 103 of file direct_hash_base.h.

int DHashBase< KT , KT >::size (  )  [inline, inherited]

Definition at line 60 of file direct_hash_base.h.

void DHashBase< KT , KT >::zero (  )  [inline, inherited]

Definition at line 55 of file direct_hash_base.h.

Referenced by DBHash< KT >::clear().


Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]
int DHashBase< KT , KT >::capacity [protected, inherited]

Definition at line 41 of file direct_hash_base.h.

Referenced by DBHash< KT >::clear().

int DHashBase< KT , KT >::count [protected, inherited]

Definition at line 42 of file direct_hash_base.h.

Referenced by DBHash< KT >::clear(), DBHash< KT >::put(), and DBHash< KT >::remove().

KT * DHashBase< KT , KT >::data [protected, inherited]

Definition at line 43 of file direct_hash_base.h.

Referenced by DBHash< KT >::clear().

template<typename KT >
KT DBHash< KT >::deletedKey [protected]

Definition at line 43 of file db_hash.h.

Referenced by DBHash< KT >::isDeletedSlot(), and DBHash< KT >::remove().

template<typename KT >
KT DBHash< KT >::emptyKey [protected]

Definition at line 42 of file db_hash.h.

Referenced by DBHash< KT >::clear(), DBHash< KT >::isEmptySlot(), and DBHash< KT >::put().

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