12345678910111213141516171819202122232425 |
- /*
- * Copyright 2010, Pier Luigi Fiorini. All rights reserved.
- * Distributed under the terms of the MIT License.
- */
- #ifndef _SINGLETON_H
- #define _SINGLETON_H
- template<typename T>
- class Singleton {
- public:
- static T* Get()
- {
- if (!fInstance)
- fInstance = new T();
- return fInstance;
- }
- protected:
- static T* fInstance;
- Singleton() {}
- };
- #endif // _SINGLETON_H
|