Class Singleton
-
template<class T>
class Singleton -
A singleton template that lets you make a singleton out of a type.
Note you can use this on multiple types simultaneously to get multiple singletons.
- Template Parameters:
-
T – The type to make a singleton out of
Public Static Functions
- static inline bool HasInstance()
-
Does there exist a singleton of this type already?
- Returns:
-
true iff there is a pre-existing instance of this singleton
- static inline T *GetInstance()
-
Get the typed singleton instance if it exists, otherwise create one.
- Returns:
-
A pointer to the singleton instance