Library of Assembled Shared Sources
lass::util::impl::SingletonBase Class Reference

base class of all singletons. More...

#include <singleton_impl.h>

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

Public Member Functions

 SingletonBase ()
 constructor.
 

Protected Member Functions

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

Detailed Description

base class of all singletons.

Definition at line 60 of file singleton_impl.h.

Constructor & Destructor Documentation

◆ SingletonBase()

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 180 of file singleton_impl.cpp.

Member Function Documentation

◆ subscribeInstance()

void lass::util::impl::SingletonBase::subscribeInstance ( int destructionPriority)
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.

Definition at line 207 of file singleton_impl.cpp.

References lass::util::destructionPriorityNever.

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


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