#include <timer.h>
Data Structures | |
| class | TimerSubscriberElement |
Public Member Functions | |
| Timer () | |
| virtual | ~Timer () |
| virtual void | shutdown () |
| template<class T > | |
| void | addTimerSubscriber (zmm::Ref< T > timerSubscriber, unsigned int notifyInterval, zmm::Ref< zmm::Object > parameter=nil, bool once=false) |
| template<class T > | |
| void | removeTimerSubscriber (zmm::Ref< T > timerSubscriber, zmm::Ref< zmm::Object > parameter=nil, bool dontFail=false) |
| void | triggerWait () |
| void | signal () |
| void | retain () |
| void | release () |
| int | getRefCount () |
Static Public Member Functions | |
| static zmm::Ref< Timer > | getInstance () |
| static void * | operator new (size_t size) |
| static void | operator delete (void *ptr) |
Protected Member Functions | |
| template<class T > | |
| zmm::Ref< zmm::Array < TimerSubscriberElement< T > > > | getAppropriateSubscribers () |
| template<class T > | |
| void | notify () |
| struct timespec * | getNextNotifyTime () |
| virtual void | init () |
| virtual void | registerSingleton () |
Protected Attributes | |
| zmm::Ref< Cond > | cond |
| zmm::Ref< zmm::Array < TimerSubscriberElement < TimerSubscriberSingleton < Object > > > > | subscribersSingleton |
| zmm::Ref< zmm::Array < TimerSubscriberElement < TimerSubscriberObject > > > | subscribersObject |
| mt_atomic_t | _ref_count |
Static Protected Attributes | |
| static zmm::Ref< Mutex > | mutex |
| static zmm::Ref< Timer > | instance |
| static bool | singletonActive |
Definition at line 67 of file timer.h.
| Timer::Timer | ( | ) |
Definition at line 58 of file timer.cc.
References cond, Singleton< Timer >::mutex, subscribersObject, and subscribersSingleton.
| virtual Timer::~Timer | ( | ) | [inline, virtual] |
| void Timer::addTimerSubscriber | ( | zmm::Ref< T > | timerSubscriber, | |
| unsigned int | notifyInterval, | |||
| zmm::Ref< zmm::Object > | parameter = nil, |
|||
| bool | once = false | |||
| ) | [inline] |
| Ref< Array< Timer::TimerSubscriberElement< TimerSubscriberObject > > > Timer::getAppropriateSubscribers< TimerSubscriberObject > | ( | ) | [inline, protected] |
Definition at line 62 of file singleton.h.
Referenced by main(), CMRescanDirectoryTask::run(), and ContentManager::setAutoscanDirectory().
| struct timespec * Timer::getNextNotifyTime | ( | ) | [read, protected] |
Definition at line 103 of file timer.cc.
References compareTimespecs(), NULL, subscribersObject, and subscribersSingleton.
Referenced by triggerWait().
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
Definition at line 87 of file singleton.h.
| void Timer::notify | ( | ) | [inline, protected] |
Definition at line 163 of file timer.h.
References compareTimespecs(), getTimespecNow(), log_debug, and zmm::Exception::printStackTrace().
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, 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 Timer::removeTimerSubscriber | ( | zmm::Ref< T > | timerSubscriber, | |
| zmm::Ref< zmm::Object > | parameter = nil, |
|||
| bool | dontFail = false | |||
| ) | [inline] |
| 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 Timer::shutdown | ( | ) | [virtual] |
Reimplemented from Singleton< Timer >.
Definition at line 125 of file timer.cc.
References log_debug, nil, subscribersObject, and subscribersSingleton.
| void Timer::signal | ( | ) | [inline] |
Definition at line 121 of file timer.h.
References cond.
Referenced by addTimerSubscriber(), and removeTimerSubscriber().
| void Timer::triggerWait | ( | ) |
Definition at line 65 of file timer.cc.
References _, _Exception, AUTOLOCK, compareTimespecs(), cond, getNextNotifyTime(), getTimespecNow(), log_debug, Singleton< Timer >::mutex, subscribersObject, and subscribersSingleton.
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> Timer::cond [protected] |
Definition at line 154 of file timer.h.
Referenced by signal(), Timer(), and triggerWait().
Definition at line 91 of file singleton.h.
Reimplemented from zmm::Object.
Definition at line 90 of file singleton.h.
Referenced by addTimerSubscriber(), removeTimerSubscriber(), Timer(), and triggerWait().
bool Singleton< Timer >::singletonActive [static, protected, inherited] |
Definition at line 92 of file singleton.h.
zmm::Ref<zmm::Array<TimerSubscriberElement<TimerSubscriberObject> > > Timer::subscribersObject [protected] |
Definition at line 157 of file timer.h.
Referenced by getNextNotifyTime(), shutdown(), Timer(), and triggerWait().
zmm::Ref<zmm::Array<TimerSubscriberElement<TimerSubscriberSingleton<Object> > > > Timer::subscribersSingleton [protected] |
Definition at line 156 of file timer.h.
Referenced by getNextNotifyTime(), shutdown(), Timer(), and triggerWait().
1.6.1