DBOHash< KT, VT > Class Template Reference

Direct hash with base type keys and object ("Ref") values. More...

#include <dbo_hash.h>

Inheritance diagram for DBOHash< KT, VT >:
DHashBase< KT, struct dbo_hash_slot< KT, VT > > zmm::Object

Public Member Functions

 DBOHash (int capacity, KT emptyKey, KT deletedKey)
virtual ~DBOHash ()
void clear ()
bool remove (KT key)
virtual int hashCode (KT key)
virtual bool match (KT key, struct dbo_hash_slot< KT, VT > *slot)
virtual bool isEmptySlot (struct dbo_hash_slot< KT, VT > *slot)
virtual bool isDeletedSlot (struct dbo_hash_slot< KT, VT > *slot)
void put (KT key, zmm::Ref< VT > value)
void put (KT key, hash_slot_t destSlot, zmm::Ref< VT > value)
zmm::Ref< VT > get (KT key)
zmm::Ref< VT > get (KT key, hash_slot_t *destSlot)
void zero ()
int size ()
int baseTypeHashCode (unsigned int key)
int secondaryHashCode (int primary)
bool search (KTkey, struct dbo_hash_slot< KT, 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 Member Functions

void init ()
void releaseData ()

Protected Attributes

KT emptyKey
KT deletedKey
int capacity
int count
struct dbo_hash_slot< KT, VT > * data
mt_atomic_t _ref_count
pthread_mutex_t mutex

Detailed Description

template<typename KT, typename VT>
class DBOHash< KT, VT >

Direct hash with base type keys and object ("Ref") values.

Definition at line 46 of file dbo_hash.h.


Constructor & Destructor Documentation

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

Definition at line 52 of file dbo_hash.h.

template<typename KT, typename VT>
virtual DBOHash< KT, VT >::~DBOHash (  )  [inline, virtual]

Definition at line 60 of file dbo_hash.h.


Member Function Documentation

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

Definition at line 74 of file direct_hash_base.h.

References DHashBase< KT, ST >::capacity.

Referenced by DBOHash< int, CacheObject >::hashCode().

template<typename KT, typename VT>
void DBOHash< KT, VT >::clear (  )  [inline]

Definition at line 87 of file dbo_hash.h.

template<typename KT, typename VT>
zmm::Ref<VT> DBOHash< KT, VT >::get ( KT  key,
hash_slot_t destSlot 
) [inline]

Definition at line 174 of file dbo_hash.h.

template<typename KT, typename VT>
zmm::Ref<VT> DBOHash< KT, VT >::get ( KT  key  )  [inline]

Definition at line 162 of file dbo_hash.h.

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

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

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

Implements DHashBase< KT, struct dbo_hash_slot< KT, VT > >.

Definition at line 118 of file dbo_hash.h.

template<typename KT, typename VT>
void DBOHash< KT, VT >::init (  )  [inline, protected]

Definition at line 65 of file dbo_hash.h.

Referenced by DBOHash< int, CacheObject >::DBOHash().

template<typename KT, typename VT>
virtual bool DBOHash< KT, VT >::isDeletedSlot ( struct dbo_hash_slot< KT, VT > *  slot  )  [inline, virtual]

Reimplemented from DHashBase< KT, struct dbo_hash_slot< KT, VT > >.

Definition at line 131 of file dbo_hash.h.

template<typename KT, typename VT>
virtual bool DBOHash< KT, VT >::isEmptySlot ( struct dbo_hash_slot< KT, VT > *  slot  )  [inline, virtual]

Implements DHashBase< KT, struct dbo_hash_slot< KT, VT > >.

Definition at line 126 of file dbo_hash.h.

template<typename KT, typename VT>
virtual bool DBOHash< KT, VT >::match ( KT  key,
struct dbo_hash_slot< KT, VT > *  slot 
) [inline, virtual]

Implements DHashBase< KT, struct dbo_hash_slot< KT, VT > >.

Definition at line 122 of file dbo_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, typename VT>
void DBOHash< KT, VT >::put ( KT  key,
hash_slot_t  destSlot,
zmm::Ref< VT >  value 
) [inline]

Definition at line 142 of file dbo_hash.h.

template<typename KT, typename VT>
void DBOHash< KT, VT >::put ( KT  key,
zmm::Ref< VT >  value 
) [inline]

Definition at line 136 of file dbo_hash.h.

Referenced by DBOHash< int, CacheObject >::put().

void Object::release (  )  [inherited]
template<typename KT, typename VT>
void DBOHash< KT, VT >::releaseData (  )  [inline, protected]

Definition at line 76 of file dbo_hash.h.

Referenced by DBOHash< int, CacheObject >::~DBOHash().

template<typename KT, typename VT>
bool DBOHash< KT, VT >::remove ( KT  key  )  [inline]

Definition at line 106 of file dbo_hash.h.

void Object::retain (  )  [inherited]
bool DHashBase< KT , struct dbo_hash_slot< KT, VT > >::search ( KT  key,
struct dbo_hash_slot< KT, VT > **  retSlot 
) [inline, inherited]
int DHashBase< KT , struct dbo_hash_slot< KT, VT > >::secondaryHashCode ( int  primary  )  [inline, inherited]

Definition at line 103 of file direct_hash_base.h.

References HASH_PRIME.

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

Definition at line 60 of file direct_hash_base.h.

References DHashBase< KT, ST >::count.

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

Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]
int DHashBase< KT , struct dbo_hash_slot< KT, VT > >::capacity [protected, inherited]
int DHashBase< KT , struct dbo_hash_slot< KT, VT > >::count [protected, inherited]
struct dbo_hash_slot< KT, VT > * DHashBase< KT , struct dbo_hash_slot< KT, VT > >::data [protected, inherited]
template<typename KT, typename VT>
KT DBOHash< KT, VT >::deletedKey [protected]
template<typename KT, typename VT>
KT DBOHash< KT, VT >::emptyKey [protected]
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