Timer Class Reference

#include <timer.h>

Inheritance diagram for Timer:
Singleton< Timer > zmm::Object

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< TimergetInstance ()
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< Condcond
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< Mutexmutex
static zmm::Ref< Timerinstance
static bool singletonActive

Detailed Description

Definition at line 67 of file timer.h.


Constructor & Destructor Documentation

Timer::Timer (  ) 

Definition at line 58 of file timer.cc.

References cond, Singleton< Timer >::mutex, subscribersObject, and subscribersSingleton.

virtual Timer::~Timer (  )  [inline, virtual]

Definition at line 71 of file timer.h.

References log_debug.


Member Function Documentation

template<class T >
void Timer::addTimerSubscriber ( zmm::Ref< T >  timerSubscriber,
unsigned int  notifyInterval,
zmm::Ref< zmm::Object parameter = nil,
bool  once = false 
) [inline]

Definition at line 77 of file timer.h.

References _, AUTOLOCK, log_debug, Singleton< Timer >::mutex, and signal().

Ref< Array< Timer::TimerSubscriberElement< TimerSubscriberObject > > > Timer::getAppropriateSubscribers< TimerSubscriberObject > (  )  [inline, protected]
static zmm::Ref<Timer > Singleton< Timer >::getInstance (  )  [inline, static, inherited]
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().

virtual void Singleton< Timer >::init (  )  [inline, protected, virtual, inherited]

Definition at line 87 of file singleton.h.

template<class T >
void Timer::notify (  )  [inline, protected]
void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

virtual void Singleton< Timer >::registerSingleton (  )  [inline, protected, virtual, inherited]

Definition at line 94 of file singleton.h.

void Object::release (  )  [inherited]
template<class T >
void Timer::removeTimerSubscriber ( zmm::Ref< T >  timerSubscriber,
zmm::Ref< zmm::Object parameter = nil,
bool  dontFail = false 
) [inline]

Definition at line 97 of file timer.h.

References _, AUTOLOCK, log_debug, Singleton< Timer >::mutex, and signal().

void Object::retain (  )  [inherited]
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 (  ) 

Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]
zmm::Ref<Cond> Timer::cond [protected]

Definition at line 154 of file timer.h.

Referenced by signal(), Timer(), and triggerWait().

zmm::Ref<Timer > Singleton< Timer >::instance [static, protected, inherited]

Definition at line 91 of file singleton.h.

zmm::Ref<Mutex> Singleton< Timer >::mutex [static, protected, inherited]

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.

Definition at line 157 of file timer.h.

Referenced by getNextNotifyTime(), shutdown(), Timer(), and triggerWait().

Definition at line 156 of file timer.h.

Referenced by getNextNotifyTime(), shutdown(), Timer(), and triggerWait().


The documentation for this class was generated from the following files:

Generated on Fri Mar 26 20:16:57 2010 for MediaTomb by  doxygen 1.6.1