DBBHash< KT, VT > Class Template Reference

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

#include <dbb_hash.h>

Inheritance diagram for DBBHash< KT, VT >:

DHashBase< KT, struct dbb_hash_slot< KT, VT > > zmm::Object

Public Member Functions

 DBBHash (int capacity, KT emptyKey)
virtual int hashCode (KT key)
virtual bool match (KT key, struct dbb_hash_slot< KT, VT > *slot)
virtual bool isEmptySlot (struct dbb_hash_slot< KT, VT > *slot)
void clear ()
void put (KT key, VT value)
void put (KT key, hash_slot_t destSlot, VT value)
bool get (KT key, VT *value)
bool get (KT key, hash_slot_t *destSlot, VT *value)
bool exists (KT key)
bool exists (KT key, hash_slot_t *destSlot)
void zero ()
int size ()
virtual bool isDeletedSlot (struct dbb_hash_slot< KT, VT > *slot)
int baseTypeHashCode (unsigned int key)
int secondaryHashCode (int primary)
bool search (KTkey, struct dbb_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 Attributes

KT emptyKey
int capacity
int count
dbb_hash_slot< KT, VT > * data
mt_atomic_t _ref_count
pthread_mutex_t mutex

Detailed Description

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

Direct hash with base type keys and base type values.

Definition at line 45 of file dbb_hash.h.


Constructor & Destructor Documentation

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

Definition at line 50 of file dbb_hash.h.

References DBBHash< KT, VT >::clear().


Member Function Documentation

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

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

Definition at line 57 of file dbb_hash.h.

References DHashBase< KT, struct dbb_hash_slot< KT, VT > >::baseTypeHashCode().

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

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

Definition at line 61 of file dbb_hash.h.

References dbb_hash_slot< KT, VT >::key.

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

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

Definition at line 65 of file dbb_hash.h.

References DBBHash< KT, VT >::emptyKey, and dbb_hash_slot< KT, VT >::key.

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

Definition at line 70 of file dbb_hash.h.

References DHashBase< KT, struct dbb_hash_slot< KT, VT > >::capacity, DBBHash< KT, VT >::emptyKey, and DHashBase< KT, struct dbb_hash_slot< KT, VT > >::zero().

Referenced by DBBHash< KT, VT >::DBBHash().

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

Definition at line 94 of file dbb_hash.h.

References DHashBase< KT, struct dbb_hash_slot< KT, VT > >::count, dbb_hash_slot< KT, VT >::key, DHashBase< KT, struct dbb_hash_slot< KT, VT > >::search(), and dbb_hash_slot< KT, VT >::value.

template<typename KT, typename VT>
void DBBHash< KT, VT >::put ( KT  key,
hash_slot_t  destSlot,
VT  value 
) [inline]

Definition at line 105 of file dbb_hash.h.

References DHashBase< KT, struct dbb_hash_slot< KT, VT > >::count, DBBHash< KT, VT >::emptyKey, dbb_hash_slot< KT, VT >::key, and dbb_hash_slot< KT, VT >::value.

template<typename KT, typename VT>
bool DBBHash< KT, VT >::get ( KT  key,
VT *  value 
) [inline]

Definition at line 116 of file dbb_hash.h.

References dbb_hash_slot< KT, VT >::key, DHashBase< KT, struct dbb_hash_slot< KT, VT > >::search(), and dbb_hash_slot< KT, VT >::value.

template<typename KT, typename VT>
bool DBBHash< KT, VT >::get ( KT  key,
hash_slot_t destSlot,
VT *  value 
) [inline]

Definition at line 124 of file dbb_hash.h.

References dbb_hash_slot< KT, VT >::key, DHashBase< KT, struct dbb_hash_slot< KT, VT > >::search(), and dbb_hash_slot< KT, VT >::value.

template<typename KT, typename VT>
bool DBBHash< KT, VT >::exists ( KT  key  )  [inline]

Definition at line 132 of file dbb_hash.h.

References DHashBase< KT, struct dbb_hash_slot< KT, VT > >::search().

template<typename KT, typename VT>
bool DBBHash< KT, VT >::exists ( KT  key,
hash_slot_t destSlot 
) [inline]

Definition at line 137 of file dbb_hash.h.

References DHashBase< KT, struct dbb_hash_slot< KT, VT > >::search().

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

Definition at line 55 of file direct_hash_base.h.

Referenced by DBBHash< KT, VT >::clear().

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

Definition at line 60 of file direct_hash_base.h.

virtual bool DHashBase< KT , struct dbb_hash_slot< KT, VT > >::isDeletedSlot ( struct dbb_hash_slot< KT, VT > *  slot  )  [inline, virtual, inherited]

Definition at line 69 of file direct_hash_base.h.

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

Definition at line 74 of file direct_hash_base.h.

Referenced by DBBHash< KT, VT >::hashCode().

int DHashBase< KT , struct dbb_hash_slot< KT, VT > >::secondaryHashCode ( int  primary  )  [inline, inherited]

Definition at line 103 of file direct_hash_base.h.

bool DHashBase< KT , struct dbb_hash_slot< KT, VT > >::search ( KT   key,
struct dbb_hash_slot< KT, VT > **  retSlot 
) [inline, inherited]

Definition at line 113 of file direct_hash_base.h.

Referenced by DBBHash< KT, VT >::exists(), DBBHash< KT, VT >::get(), and DBBHash< KT, VT >::put().

void Object::retain (  )  [inherited]

Definition at line 58 of file object.cc.

References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.

Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Singleton< zmm::Object > >::push(), DSOHash< VT >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().

void Object::release (  )  [inherited]

Definition at line 66 of file object.cc.

References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.

Referenced by zmm::String::operator=(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Singleton< zmm::Object > >::~ObjectStack(), and zmm::String::~String().

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

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

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

Definition at line 83 of file object.cc.

References MALLOC.

void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.


Field Documentation

template<typename KT, typename VT>
KT DBBHash< KT, VT >::emptyKey [protected]

Definition at line 48 of file dbb_hash.h.

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

int DHashBase< KT , struct dbb_hash_slot< KT, VT > >::capacity [protected, inherited]

Definition at line 41 of file direct_hash_base.h.

Referenced by DBBHash< KT, VT >::clear().

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

Definition at line 42 of file direct_hash_base.h.

Referenced by DBBHash< KT, VT >::put().

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

Definition at line 43 of file direct_hash_base.h.

mt_atomic_t zmm::Object::_ref_count [protected, inherited]

Definition at line 54 of file object.h.

Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().

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

Reimplemented in AutoscanList, AutoscanInotify, Dictionary_r, SingletonManager, Singleton< T >, MutexAutolock, Cond, Singleton< UpdateManager >, Singleton< Timer >, Singleton< ContentDirectoryService >, Singleton< ConfigManager >, Singleton< Server >, Singleton< Runtime >, Singleton< ContentManager >, Singleton< ConnectionManagerService >, Singleton< Storage >, and Singleton< SessionManager >.

Definition at line 56 of file object.h.

Referenced by zmm::Object::Object(), zmm::Object::release(), zmm::Object::retain(), and zmm::Object::~Object().


The documentation for this class was generated from the following file:
Generated on Sun Jul 8 22:30:00 2007 for MediaTomb by  doxygen 1.5.2