library of assembled shared sources

http://lass.cocamware.com

lass::util::impl::SingletonBase Class Reference

base class of all singletons. More...

#include <singleton_impl.h>

Inheritance diagram for lass::util::impl::SingletonBase:

Inheritance graph
[legend]
Collaboration diagram for lass::util::impl::SingletonBase:

Collaboration graph
[legend]

Public Member Functions

 SingletonBase ()
 constructor.
virtual ~SingletonBase ()
int destructionPriority () const

Protected Member Functions

void subscribeInstance (int iDestructionPriority)
 Subscribe to the singleton guard.

Private Member Functions

void swap (NonCopyable &)

Private Attributes

int destructionPriority_

Detailed Description

base class of all singletons.

Definition at line 60 of file singleton_impl.h.


Constructor & Destructor Documentation

lass::util::impl::SingletonBase::SingletonBase (  ) 

constructor.

Warning:
The singleton base DOES NOT subsribes itself at construction. Singleton<> must do this at the construction of a new singleton. Why? We better don't do it here, because the singleton is being constructed! it might not be complete yet.

Definition at line 154 of file singleton_impl.cpp.

lass::util::impl::SingletonBase::~SingletonBase (  )  [virtual]

Definition at line 161 of file singleton_impl.cpp.


Member Function Documentation

int lass::util::impl::SingletonBase::destructionPriority (  )  const

void lass::util::impl::SingletonBase::subscribeInstance ( int  iDestructionPriority  )  [protected]

Subscribe to the singleton guard.

Do this only once for each singleton, and in fact, don't do it yourself at all since Singleton<> already does it :)

Warning:
this isn't thread safe as it is, but that's ok because its only caller Singleton::instance() is already locking on SingletonGuard level.

Definition at line 181 of file singleton_impl.cpp.

References destructionPriority_, and lass::util::impl::SingletonGuard::instance().

Referenced by lass::util::Singleton< T, destructPriority >::instance().

void lass::util::NonCopyable::swap ( NonCopyable  )  [inline, protected, inherited]

Definition at line 60 of file non_copyable.h.

Referenced by lass::io::Image::readLine().


Field Documentation

Definition at line 75 of file singleton_impl.h.

Referenced by destructionPriority(), and subscribeInstance().


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

Generated on Mon Nov 10 14:22:20 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo