#include <update_manager.h>
Public Member Functions | |
| UpdateManager () | |
| virtual void | shutdown () |
| virtual void | init () |
| void | containerChanged (int objectID, int flushPolicy=FLUSH_SPEC) |
| void | containersChanged (zmm::Ref< zmm::IntArray > objectIDs, int flushPolicy=FLUSH_SPEC) |
| void | retain () |
| void | release () |
| int | getRefCount () |
Static Public Member Functions | |
| static zmm::Ref< UpdateManager > | getInstance () |
| static void * | operator new (size_t size) |
| static void | operator delete (void *ptr) |
Protected Member Functions | |
| void | threadProc () |
| bool | haveUpdates () |
| virtual void | registerSingleton () |
Static Protected Member Functions | |
| static void * | staticThreadProc (void *arg) |
Protected Attributes | |
| pthread_t | updateThread |
| zmm::Ref< Cond > | cond |
| zmm::Ref< DBRHash< int > > | objectIDHash |
| bool | shutdownFlag |
| int | flushPolicy |
| int | lastContainerChanged |
| mt_atomic_t | _ref_count |
Static Protected Attributes | |
| static zmm::Ref< Mutex > | mutex |
| static zmm::Ref< UpdateManager > | instance |
| static bool | singletonActive |
Definition at line 43 of file update_manager.h.
| UpdateManager::UpdateManager | ( | ) |
Definition at line 56 of file update_manager.cc.
References cond, FLUSH_SPEC, flushPolicy, INVALID_OBJECT_ID, INVALID_OBJECT_ID_2, lastContainerChanged, MAX_OBJECT_IDS, MAX_OBJECT_IDS_OVERLOAD, Singleton< UpdateManager >::mutex, OBJECT_ID_HASH_CAPACITY, objectIDHash, and shutdownFlag.
| void UpdateManager::containerChanged | ( | int | objectID, | |
| int | flushPolicy = FLUSH_SPEC | |||
| ) |
Definition at line 145 of file update_manager.cc.
References AUTOLOCK, cond, haveUpdates(), INVALID_OBJECT_ID, lastContainerChanged, log_debug, MAX_OBJECT_IDS, Singleton< UpdateManager >::mutex, and objectIDHash.
| void UpdateManager::containersChanged | ( | zmm::Ref< zmm::IntArray > | objectIDs, | |
| int | flushPolicy = FLUSH_SPEC | |||
| ) |
Definition at line 99 of file update_manager.cc.
References AUTOLOCK, AUTORELOCK, AUTOUNLOCK, cond, haveUpdates(), lastContainerChanged, log_debug, MAX_OBJECT_IDS, MAX_OBJECT_IDS_OVERLOAD, Singleton< UpdateManager >::mutex, nil, and objectIDHash.
| static zmm::Ref<UpdateManager > Singleton< UpdateManager >::getInstance | ( | ) | [inline, static, inherited] |
Definition at line 62 of file singleton.h.
Referenced by FileRequestHandler::open(), staticThreadProc(), and threadProc().
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
| bool UpdateManager::haveUpdates | ( | ) | [inline, protected] |
Definition at line 68 of file update_manager.h.
References objectIDHash.
Referenced by containerChanged(), containersChanged(), and threadProc().
| void UpdateManager::init | ( | ) | [virtual] |
Reimplemented from Singleton< UpdateManager >.
Definition at line 65 of file update_manager.cc.
References NULL, staticThreadProc(), and updateThread.
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| virtual void Singleton< UpdateManager >::registerSingleton | ( | ) | [inline, protected, virtual, inherited] |
Definition at line 94 of file singleton.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().
| 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().
| void UpdateManager::shutdown | ( | ) | [virtual] |
Reimplemented from Singleton< UpdateManager >.
Definition at line 84 of file update_manager.cc.
References AUTOLOCK, AUTOUNLOCK, cond, log_debug, Singleton< UpdateManager >::mutex, NULL, shutdownFlag, and updateThread.
| void * UpdateManager::staticThreadProc | ( | void * | arg | ) | [static, protected] |
Definition at line 289 of file update_manager.cc.
References Singleton< UpdateManager >::getInstance(), log_debug, NULL, and threadProc().
Referenced by init().
| void UpdateManager::threadProc | ( | ) | [protected] |
Definition at line 186 of file update_manager.cc.
References AUTOLOCK, AUTORELOCK, AUTOUNLOCK, zmm::String::c_str(), cond, hash_data_array_t< KT >::data, FLUSH_ASAP, FLUSH_SPEC, flushPolicy, getDeltaMillis(), Singleton< UpdateManager >::getInstance(), zmm::Exception::getMessage(), getTimespecAfterMillis(), getTimespecNow(), haveUpdates(), INVALID_OBJECT_ID, lastContainerChanged, log_debug, log_error, MAX_OBJECT_IDS, MIN_SLEEP, Singleton< UpdateManager >::mutex, objectIDHash, print_backtrace, zmm::Exception::printStackTrace(), shutdownFlag, hash_data_array_t< KT >::size, SPEC_INTERVAL, and string_ok().
Referenced by staticThreadProc().
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().
zmm::Ref<Cond> UpdateManager::cond [protected] |
Definition at line 56 of file update_manager.h.
Referenced by containerChanged(), containersChanged(), shutdown(), threadProc(), and UpdateManager().
int UpdateManager::flushPolicy [protected] |
Definition at line 61 of file update_manager.h.
Referenced by threadProc(), and UpdateManager().
zmm::Ref<UpdateManager > Singleton< UpdateManager >::instance [static, protected, inherited] |
Definition at line 91 of file singleton.h.
int UpdateManager::lastContainerChanged [protected] |
Definition at line 63 of file update_manager.h.
Referenced by containerChanged(), containersChanged(), threadProc(), and UpdateManager().
zmm::Ref<Mutex> Singleton< UpdateManager >::mutex [static, protected, inherited] |
Reimplemented from zmm::Object.
Definition at line 90 of file singleton.h.
Referenced by containerChanged(), containersChanged(), shutdown(), threadProc(), and UpdateManager().
zmm::Ref<DBRHash<int> > UpdateManager::objectIDHash [protected] |
Definition at line 58 of file update_manager.h.
Referenced by containerChanged(), containersChanged(), haveUpdates(), threadProc(), and UpdateManager().
bool UpdateManager::shutdownFlag [protected] |
Definition at line 60 of file update_manager.h.
Referenced by shutdown(), threadProc(), and UpdateManager().
bool Singleton< UpdateManager >::singletonActive [static, protected, inherited] |
Definition at line 92 of file singleton.h.
pthread_t UpdateManager::updateThread [protected] |
Definition at line 55 of file update_manager.h.
Referenced by init(), and shutdown().
1.6.1