/* ----------------------------------------------------------------------------- GSFramework Copyright 2001-2013 Emmanuel Julien. All Rights Reserved. ----------------------------------------------------------------------------- */ #ifndef __SINGLETON__ #define __SINGLETON__ namespace GS { template class Singleton { static T *i; public: static T &Get() { return *i; } static void Set(T *s) { i = s; } static void Free() { delete i; i = nullptr; } }; } #endif // __SINGLETON__