#include <storage_cache.h>
Public Member Functions | |
| StorageCache () | |
| zmm::Ref< CacheObject > | getObject (int id) |
| zmm::Ref< CacheObject > | getObjectDefinitely (int id) |
| bool | removeObject (int id) |
| void | clear () |
| zmm::Ref< zmm::Array < CacheObject > > | getObjects (zmm::String location) |
| void | checkLocation (zmm::Ref< CacheObject > obj) |
| void | addChild (int id) |
| bool | flushed () |
| zmm::Ref< Mutex > | getMutex () |
| 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 | |
| mt_atomic_t | _ref_count |
Private Member Functions | |
| void | ensureFillLevelOk () |
Private Attributes | |
| int | capacity |
| int | maxfill |
| bool | hasBeenFlushed |
| zmm::Ref< DBOHash< int, CacheObject > > | idHash |
| zmm::Ref< DSOHash< zmm::Array < CacheObject > > > | locationHash |
| zmm::Ref< Mutex > | mutex |
Definition at line 44 of file storage_cache.h.
| StorageCache::StorageCache | ( | ) |
Definition at line 40 of file storage_cache.cc.
References capacity, hasBeenFlushed, idHash, INVALID_OBJECT_ID, INVALID_OBJECT_ID_2, locationHash, maxfill, mutex, STORAGE_CACHE_CAPACITY, and STORAGE_CACHE_MAXFILL.
| void StorageCache::addChild | ( | int | id | ) |
Definition at line 80 of file storage_cache.cc.
| void StorageCache::checkLocation | ( | zmm::Ref< CacheObject > | obj | ) |
Definition at line 111 of file storage_cache.cc.
References locationHash, mutex, and nil.
| void StorageCache::clear | ( | ) |
Definition at line 50 of file storage_cache.cc.
References AUTOLOCK, idHash, locationHash, and mutex.
| void StorageCache::ensureFillLevelOk | ( | ) | [private] |
Definition at line 146 of file storage_cache.cc.
References hasBeenFlushed, idHash, locationHash, maxfill, and mutex.
Referenced by getObjectDefinitely().
| bool StorageCache::flushed | ( | ) |
Definition at line 136 of file storage_cache.cc.
References hasBeenFlushed.
Definition at line 63 of file storage_cache.h.
References mutex.
| Ref< CacheObject > StorageCache::getObject | ( | int | id | ) |
Definition at line 57 of file storage_cache.cc.
Referenced by removeObject().
| Ref< CacheObject > StorageCache::getObjectDefinitely | ( | int | id | ) |
Definition at line 65 of file storage_cache.cc.
References ensureFillLevelOk(), idHash, mutex, and nil.
| Ref< Array< CacheObject > > StorageCache::getObjects | ( | zmm::String | location | ) |
Definition at line 103 of file storage_cache.cc.
References locationHash, and mutex.
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| 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 StorageCache::removeObject | ( | int | id | ) |
Definition at line 92 of file storage_cache.cc.
References AUTOLOCK, getObject(), idHash, locationHash, mutex, and nil.
| 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().
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 StorageCache::capacity [private] |
Definition at line 67 of file storage_cache.h.
Referenced by StorageCache().
bool StorageCache::hasBeenFlushed [private] |
Definition at line 69 of file storage_cache.h.
Referenced by ensureFillLevelOk(), flushed(), and StorageCache().
zmm::Ref<DBOHash<int,CacheObject> > StorageCache::idHash [private] |
Definition at line 73 of file storage_cache.h.
Referenced by addChild(), clear(), ensureFillLevelOk(), getObject(), getObjectDefinitely(), removeObject(), and StorageCache().
zmm::Ref<DSOHash<zmm::Array<CacheObject> > > StorageCache::locationHash [private] |
Definition at line 74 of file storage_cache.h.
Referenced by checkLocation(), clear(), ensureFillLevelOk(), getObjects(), removeObject(), and StorageCache().
int StorageCache::maxfill [private] |
Definition at line 68 of file storage_cache.h.
Referenced by ensureFillLevelOk(), and StorageCache().
zmm::Ref<Mutex> StorageCache::mutex [private] |
Reimplemented from zmm::Object.
Definition at line 75 of file storage_cache.h.
Referenced by addChild(), checkLocation(), clear(), ensureFillLevelOk(), getMutex(), getObject(), getObjectDefinitely(), getObjects(), removeObject(), and StorageCache().
1.6.1