Direct hash with base type keys and object ("Ref") values. More...
#include <dbo_hash.h>
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 |
Direct hash with base type keys and object ("Ref") values.
Definition at line 46 of file dbo_hash.h.
| DBOHash< KT, VT >::DBOHash | ( | int | capacity, | |
| KT | emptyKey, | |||
| KT | deletedKey | |||
| ) | [inline] |
Definition at line 52 of file dbo_hash.h.
Definition at line 60 of file dbo_hash.h.
| 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().
| void DBOHash< KT, VT >::clear | ( | ) | [inline] |
Definition at line 87 of file dbo_hash.h.
| zmm::Ref<VT> DBOHash< KT, VT >::get | ( | KT | key, | |
| hash_slot_t * | destSlot | |||
| ) | [inline] |
Definition at line 174 of file dbo_hash.h.
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().
| 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.
| void DBOHash< KT, VT >::init | ( | ) | [inline, protected] |
Definition at line 65 of file dbo_hash.h.
Referenced by DBOHash< int, CacheObject >::DBOHash().
| 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.
| 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.
| 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] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| 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.
| 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] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| void DBOHash< KT, VT >::releaseData | ( | ) | [inline, protected] |
Definition at line 76 of file dbo_hash.h.
Referenced by DBOHash< int, CacheObject >::~DBOHash().
| bool DBOHash< KT, VT >::remove | ( | KT | key | ) | [inline] |
Definition at line 106 of file dbo_hash.h.
| 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< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
| bool DHashBase< KT , struct dbo_hash_slot< KT, VT > >::search | ( | KT | key, | |
| struct dbo_hash_slot< KT, VT > ** | retSlot | |||
| ) | [inline, inherited] |
Definition at line 113 of file direct_hash_base.h.
References _, DHashBase< KT, ST >::capacity, DHashBase< KT, ST >::count, DHashBase< KT, ST >::data, HASH_MAX_ITERATIONS, DHashBase< KT, ST >::hashCode(), DHashBase< KT, ST >::isDeletedSlot(), DHashBase< KT, ST >::isEmptySlot(), log_error, DHashBase< KT, ST >::match(), NULL, and DHashBase< KT, ST >::secondaryHashCode().
Referenced by DBOHash< int, CacheObject >::get(), DBOHash< int, CacheObject >::put(), and DBOHash< int, CacheObject >::remove().
| 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] |
Definition at line 55 of file direct_hash_base.h.
References DHashBase< KT, ST >::capacity, DHashBase< KT, ST >::count, and DHashBase< KT, ST >::data.
Referenced by DBOHash< int, CacheObject >::init().
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().
int DHashBase< KT , struct dbo_hash_slot< KT, VT > >::capacity [protected, inherited] |
Definition at line 41 of file direct_hash_base.h.
Referenced by DBOHash< int, CacheObject >::clear(), DBOHash< int, CacheObject >::init(), and DBOHash< int, CacheObject >::releaseData().
int DHashBase< KT , struct dbo_hash_slot< KT, VT > >::count [protected, inherited] |
Definition at line 42 of file direct_hash_base.h.
Referenced by DBOHash< int, CacheObject >::clear(), DBOHash< int, CacheObject >::init(), DBOHash< int, CacheObject >::put(), and DBOHash< int, CacheObject >::remove().
struct dbo_hash_slot< KT, VT > * DHashBase< KT , struct dbo_hash_slot< KT, VT > >::data [protected, inherited] |
Definition at line 43 of file direct_hash_base.h.
Referenced by DBOHash< int, CacheObject >::clear(), DBOHash< int, CacheObject >::init(), and DBOHash< int, CacheObject >::releaseData().
KT DBOHash< KT, VT >::deletedKey [protected] |
Definition at line 50 of file dbo_hash.h.
Referenced by DBOHash< int, CacheObject >::clear(), DBOHash< int, CacheObject >::isDeletedSlot(), DBOHash< int, CacheObject >::put(), DBOHash< int, CacheObject >::releaseData(), and DBOHash< int, CacheObject >::remove().
Definition at line 49 of file dbo_hash.h.
Referenced by DBOHash< int, CacheObject >::clear(), DBOHash< int, CacheObject >::init(), DBOHash< int, CacheObject >::isEmptySlot(), DBOHash< int, CacheObject >::put(), and DBOHash< int, CacheObject >::releaseData().
pthread_mutex_t zmm::Object::mutex [protected, inherited] |
Reimplemented in AutoscanList, AutoscanInotify, CachedURL, Dictionary_r, DVDNavReader, IOHandlerBufferHelper, ReentrantArray< T >, SingletonManager, Singleton< T >, StorageCache, MutexAutolock, Cond, ThreadExecutor, Singleton< UpdateManager >, Singleton< Timer >, Singleton< ContentDirectoryService >, Singleton< ConfigManager >, Singleton< Server >, Singleton< Runtime >, Singleton< ContentManager >, Singleton< ConnectionManagerService >, Singleton< PlayHook >, 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().
1.6.1