#include <Singleton.h>
Inheritance diagram for Singleton:


Public Methods | |
| Singleton () | |
| ~Singleton () | |
Static Public Methods | |
| T & | GetSingleton () |
| T * | GetSingletonPtr () |
|
|||||||||
|
00025 {
00026 assert(!ms_Singleton && "Pointer to ms_Singleton is NULL");
00027 int offset = (int)(T*)1 - (int)(Singleton <T>*)(T*)1;
00028 ms_Singleton = (T*)((int)this + offset);
00029 }
|
|
|||||||||
|
00032 {
00033 assert(ms_Singleton && "Nothing to destroy");
00034 ms_Singleton = 0;
00035 }
|
|
|||||||||
|
00038 {
00039 assert(ms_Singleton && "Singleton not initialized correctly");
00040 return (*ms_Singleton);
00041 }
|
|
|||||||||
|
00044 {
00045 return (ms_Singleton);
00046 }
|
1.2.11.1 written by Dimitri van Heesch,
© 1997-2001