OGRE 14.3
Object-Oriented Graphics Rendering Engine
|
Template class for creating single-instance global classes. More...
#include <OgreSingleton.h>
Public Member Functions | |
Singleton (void) | |
~Singleton (void) | |
Static Public Member Functions | |
static T & | getSingleton (void) |
Get the singleton instance. | |
static T * | getSingletonPtr (void) |
Get the singleton instance. | |
Template class for creating single-instance global classes.
This implementation [1] slightly derives from the textbook pattern, by requiring manual instantiation, instead of implicitly doing it in getSingleton. This is useful for classes that want to do some involved initialization, which should be done at a well defined time-point or need some additional parameters in their constructor.
It also allows you to manage the singleton lifetime through RAII.
|
inline |
References OgreAssert.
Get the singleton instance.
Get the singleton instance.