/* Singleton */ /* This is sample code for a singleton. */ /* The design DOES NOT allow for inheritence. */ /* If you want to inherit from a singleton */ /* class you should see me. */ #include #include "singleton.h" Singleton* Singleton::Instance() { if (_instance == 0) _instance = new Singleton; return _instance; } void Singleton::printMessage(void) { cout << "Hello world!" << endl; }