library of assembled shared sources |
http://lass.cocamware.com |
Data Structures | |
class | CustomSemaphore |
Special semaphore for the guard. More... | |
Public Member Functions | |
~SingletonGuard () | |
on destruction, you have to kill all singletons. | |
void | subscribe (SingletonBase *iSingleton) |
subscribe singleton to the destruction list | |
Static Public Member Functions | |
static SingletonGuard * | instance () |
return the SingletonGuard singleton instance =) | |
Private Types | |
typedef std::priority_queue < SingletonBase *, std::vector < SingletonBase * > , CompareDestructionPriority > | TDeathRow |
Private Member Functions | |
SingletonGuard () | |
Static Private Member Functions | |
static void | killEmAll () |
kills singleton guard and all its guarded singleton. | |
static bool | deadReference (bool iSetReferenceToDead=false) |
return true if singleton guard is destructed. | |
Private Attributes | |
TDeathRow | deathRow_ |
Static Private Attributes | |
static SingletonGuard * | instance_ = 0 |
Definition at line 87 of file singleton_impl.cpp.
typedef std::priority_queue<SingletonBase*, std::vector<SingletonBase*>, CompareDestructionPriority> lass::util::impl::SingletonGuard::TDeathRow [private] |
Definition at line 133 of file singleton_impl.cpp.
lass::util::impl::SingletonGuard::~SingletonGuard | ( | ) |
on destruction, you have to kill all singletons.
This isn't thread safe as it is, but that's ok because it's only "caller" singletonCleanUp() is already locking on SingletonGuard level for us.
Definition at line 207 of file singleton_impl.cpp.
References deadReference(), and deathRow_.
lass::util::impl::SingletonGuard::SingletonGuard | ( | ) | [inline, private] |
Definition at line 99 of file singleton_impl.cpp.
void lass::util::impl::SingletonGuard::subscribe | ( | SingletonBase * | iSingleton | ) |
subscribe singleton to the destruction list
This isn't thread safe as it is, but that's ok because it's only indirect caller Singleton::instance() is already locking on SingletonGuard level for us.
Definition at line 229 of file singleton_impl.cpp.
References deathRow_.
SingletonGuard * lass::util::impl::SingletonGuard::instance | ( | ) | [static] |
return the SingletonGuard singleton instance =)
Definition at line 238 of file singleton_impl.cpp.
References lass::io::cerr(), deadReference(), instance_, and killEmAll().
Referenced by lass::util::impl::SingletonBase::subscribeInstance().
void killEmAll | ( | ) | [static, private] |
kills singleton guard and all its guarded singleton.
This function is subscribed to atexit to kill all singletons at exit of the application<
Definition at line 267 of file singleton_impl.cpp.
References instance_.
Referenced by instance().
bool lass::util::impl::SingletonGuard::deadReference | ( | bool | iSetReferenceToDead = false |
) | [static, private] |
return true if singleton guard is destructed.
iSetReferenceToDead | - call this method with true on destruction of singleton
|
Definition at line 280 of file singleton_impl.cpp.
Referenced by instance(), and ~SingletonGuard().
Definition at line 135 of file singleton_impl.cpp.
Referenced by subscribe(), and ~SingletonGuard().
SingletonGuard * lass::util::impl::SingletonGuard::instance_ = 0 [static, private] |
Generated on Mon Nov 10 14:22:20 2008 for Library of Assembled Shared Sources by 1.5.7.1 |