Singleton< T > Class Template Reference

#include <singleton.h>

Inheritance diagram for Singleton< T >:
zmm::Object TimerSubscriberSingleton< T >

Public Member Functions

void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static zmm::Ref< T > getInstance ()
static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Member Functions

virtual ~Singleton ()
virtual void init ()
virtual void shutdown ()
virtual void registerSingleton ()

Protected Attributes

mt_atomic_t _ref_count

Static Protected Attributes

static zmm::Ref< Mutexmutex
static zmm::Ref< T > instance = nil
static bool singletonActive = true

Private Member Functions

virtual void inactivateSingleton ()
virtual void reactivateSingleton ()

Friends

class SingletonManager

Detailed Description

template<class T>
class Singleton< T >

Definition at line 59 of file singleton.h.


Constructor & Destructor Documentation

template<class T>
virtual Singleton< T >::~Singleton (  )  [inline, protected, virtual]

Definition at line 85 of file singleton.h.


Member Function Documentation

template<class T>
static zmm::Ref<T> Singleton< T >::getInstance (  )  [inline, static]

Reimplemented in Storage.

Definition at line 62 of file singleton.h.

Referenced by Singleton< SessionManager >::registerSingleton().

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

References zmm::Object::_ref_count, and atomic_get().

template<class T>
virtual void Singleton< T >::inactivateSingleton (  )  [inline, private, virtual]

Definition at line 101 of file singleton.h.

template<class T>
virtual void Singleton< T >::init (  )  [inline, protected, virtual]

Reimplemented in ContentManager, Server, SQLStorage, Storage, and UpdateManager.

Definition at line 87 of file singleton.h.

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.

template<class T>
virtual void Singleton< T >::reactivateSingleton (  )  [inline, private, virtual]

Definition at line 107 of file singleton.h.

template<class T>
virtual void Singleton< T >::registerSingleton (  )  [inline, protected, virtual]

Definition at line 94 of file singleton.h.

void Object::release (  )  [inherited]
void Object::retain (  )  [inherited]
template<class T>
virtual void Singleton< T >::shutdown (  )  [inline, protected, virtual]

Reimplemented in ContentManager, Server, SQLStorage, Storage, Timer, and UpdateManager.

Definition at line 88 of file singleton.h.


Friends And Related Function Documentation

template<class T>
friend class SingletonManager [friend]

Definition at line 109 of file singleton.h.


Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]
template<class T>
zmm::Ref< T > Singleton< T >::instance = nil [inline, static, protected]
template<class T>
zmm::Ref<Mutex> Singleton< T >::mutex [static, protected]

Reimplemented from zmm::Object.

Definition at line 90 of file singleton.h.

Referenced by Singleton< SessionManager >::getInstance().

template<class T>
bool Singleton< T >::singletonActive = true [inline, static, protected]

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

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