|
SuperTuxKart
|
Manages the abstract singleton at runtime. This has been designed to allow multi-inheritance. This is advised to re-declare getInstance, but whithout templates parameters in the inheriting classes. More...
#include <singleton.hpp>
Static Public Member Functions | |
| template<typename S > | |
| static S * | getInstance () |
| Used to get the instance, after a dynamic cast. This is important when making a double-inheritance of this class. For example, if A is a singleton inherited by B, you can call B::getInstance<A>() to have the instance returned as a A*. If the cast fails, a log message will notify it. | |
| static T * | getInstance () |
| Used to get the instance. | |
| static void | kill () |
| Used to kill the singleton, if needed. | |
Protected Member Functions | |
| AbstractSingleton () | |
| Constructor. | |
| virtual | ~AbstractSingleton () |
| Destructor. | |
Static Private Attributes | |
| static T * | m_singleton = NULL |
Manages the abstract singleton at runtime. This has been designed to allow multi-inheritance. This is advised to re-declare getInstance, but whithout templates parameters in the inheriting classes.