Direct hash with base type keys only. It is NOT thread-safe! It has remove() and getAll() functions. More...
#include <dbr_hash.h>
Public Member Functions | |
| DBRHash (int hashCapacity, int realCapacity, KT emptyKey, KT deletedKey) | |
| virtual | ~DBRHash () |
| virtual int | hashCode (KT key) |
| virtual bool | match (KT key, struct dbr_hash_slot< KT > *slot) |
| virtual bool | isEmptySlot (struct dbr_hash_slot< KT > *slot) |
| virtual bool | isDeletedSlot (struct dbr_hash_slot< KT > *slot) |
| void | clear () |
| bool | remove (KT key) |
| void | put (KT key) |
| void | getAll (hash_data_array_t< KT > *hash_data_array) |
| returns all keys as an array. After the deletion of the DBRHash object, the array is invalid! | |
| zmm::String | debugGetAll () |
| bool | exists (KT key) |
| void | zero () |
| int | size () |
| int | baseTypeHashCode (unsigned int key) |
| int | secondaryHashCode (int primary) |
| bool | search (KTkey, struct dbr_hash_slot< 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 |
| KT * | data_array |
| int | capacity |
| int | count |
| struct dbr_hash_slot< KT > * | data |
| mt_atomic_t | _ref_count |
| pthread_mutex_t | mutex |
Direct hash with base type keys only. It is NOT thread-safe! It has remove() and getAll() functions.
Definition at line 52 of file dbr_hash.h.
| DBRHash< KT >::DBRHash | ( | int | hashCapacity, | |
| int | realCapacity, | |||
| KT | emptyKey, | |||
| KT | deletedKey | |||
| ) | [inline] |
| hashCapacity | the size of the hashtable | |
| realCapacityKT | maximum number of elements "you" will store in this instance (has to be < than hashCapacity!) WARNING: the number of stored entries MUST be <= realCapacity at all times! |
Definition at line 65 of file dbr_hash.h.
Definition at line 82 of file dbr_hash.h.
| int DHashBase< KT , struct dbr_hash_slot< KT > >::baseTypeHashCode | ( | unsigned int | key | ) | [inline, inherited] |
Definition at line 74 of file direct_hash_base.h.
Referenced by DBRHash< int >::hashCode().
| void DBRHash< KT >::clear | ( | ) | [inline] |
Definition at line 108 of file dbr_hash.h.
Referenced by DBRHash< int >::DBRHash().
| zmm::String DBRHash< KT >::debugGetAll | ( | ) | [inline] |
Definition at line 168 of file dbr_hash.h.
| bool DBRHash< KT >::exists | ( | KT | key | ) | [inline] |
Definition at line 194 of file dbr_hash.h.
| void DBRHash< KT >::getAll | ( | hash_data_array_t< KT > * | hash_data_array | ) | [inline] |
returns all keys as an array. After the deletion of the DBRHash object, the array is invalid!
Definition at line 162 of file dbr_hash.h.
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
| virtual int DBRHash< KT >::hashCode | ( | KT | key | ) | [inline, virtual] |
Implements DHashBase< KT, struct dbr_hash_slot< KT > >.
Definition at line 88 of file dbr_hash.h.
| virtual bool DBRHash< KT >::isDeletedSlot | ( | struct dbr_hash_slot< KT > * | slot | ) | [inline, virtual] |
Reimplemented from DHashBase< KT, struct dbr_hash_slot< KT > >.
Definition at line 103 of file dbr_hash.h.
| virtual bool DBRHash< KT >::isEmptySlot | ( | struct dbr_hash_slot< KT > * | slot | ) | [inline, virtual] |
Implements DHashBase< KT, struct dbr_hash_slot< KT > >.
Definition at line 98 of file dbr_hash.h.
| virtual bool DBRHash< KT >::match | ( | KT | key, | |
| struct dbr_hash_slot< KT > * | slot | |||
| ) | [inline, virtual] |
Implements DHashBase< KT, struct dbr_hash_slot< KT > >.
Definition at line 93 of file dbr_hash.h.
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| void DBRHash< KT >::put | ( | KT | key | ) | [inline] |
Definition at line 146 of file dbr_hash.h.
| 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().
| bool DBRHash< KT >::remove | ( | KT | key | ) | [inline] |
Definition at line 124 of file dbr_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 dbr_hash_slot< KT > >::search | ( | KT | key, | |
| struct dbr_hash_slot< KT > ** | retSlot | |||
| ) | [inline, inherited] |
Definition at line 113 of file direct_hash_base.h.
Referenced by DBRHash< int >::exists(), DBRHash< int >::put(), and DBRHash< int >::remove().
| int DHashBase< KT , struct dbr_hash_slot< KT > >::secondaryHashCode | ( | int | primary | ) | [inline, inherited] |
Definition at line 103 of file direct_hash_base.h.
| int DHashBase< KT , struct dbr_hash_slot< KT > >::size | ( | ) | [inline, inherited] |
Definition at line 60 of file direct_hash_base.h.
| void DHashBase< KT , struct dbr_hash_slot< KT > >::zero | ( | ) | [inline, inherited] |
Definition at line 55 of file direct_hash_base.h.
Referenced by DBRHash< int >::clear().
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 dbr_hash_slot< KT > >::capacity [protected, inherited] |
Definition at line 41 of file direct_hash_base.h.
Referenced by DBRHash< int >::clear().
int DHashBase< KT , struct dbr_hash_slot< KT > >::count [protected, inherited] |
Definition at line 42 of file direct_hash_base.h.
Referenced by DBRHash< int >::clear(), DBRHash< int >::debugGetAll(), DBRHash< int >::getAll(), DBRHash< int >::put(), and DBRHash< int >::remove().
struct dbr_hash_slot< KT > * DHashBase< KT , struct dbr_hash_slot< KT > >::data [protected, inherited] |
Definition at line 43 of file direct_hash_base.h.
Referenced by DBRHash< int >::clear().
KT* DBRHash< KT >::data_array [protected] |
Definition at line 57 of file dbr_hash.h.
Referenced by DBRHash< int >::DBRHash(), DBRHash< int >::debugGetAll(), DBRHash< int >::getAll(), DBRHash< int >::put(), DBRHash< int >::remove(), and DBRHash< int >::~DBRHash().
KT DBRHash< KT >::deletedKey [protected] |
Definition at line 56 of file dbr_hash.h.
Referenced by DBRHash< int >::isDeletedSlot(), and DBRHash< int >::remove().
Definition at line 55 of file dbr_hash.h.
Referenced by DBRHash< int >::clear(), and DBRHash< int >::isEmptySlot().
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