Singleton
Engine/source/core/util/tSingleton.h
This is a simple thread safe singleton class based on the design of boost::singleton_default (see
Classes:
Private Static Attributes
SingletonCreator
Private Functions
This is private on purpose.
Detailed Description
This is a simple thread safe singleton class based on the design of boost::singleton_default (see
This singleton is guaranteed to be constructed before main() is called and destroyed after main() exits. It will also be created on demand if Singleton
This thread safety only works within the execution context of main(). Access to the singleton from multiple threads outside of main() is is not guaranteed to be thread safe.
To create a singleton you only need to access it once in your code:
Singleton
You do not need to derive from this class.
note:Generally stay away from this class (!!) except if your class T has no meaningful constructor. Otherwise, it is very easy to make execution of global ctors ordering dependent.