#ifndef __JLANG__JSINGLETON__ #define __JLANG__JSINGLETON__ /** * \author mdejong */ namespace JLANG {} namespace JPP { using namespace JLANG; } namespace JLANG { /** * Simple singleton class. */ template struct JSingleton { typedef T data_type; /** * Get unique instance of template class. * * \return object */ static data_type& getInstance() { static data_type value; return value; } protected: /** * Default constructor. */ JSingleton() {} /** * Copy constructor. */ JSingleton(const JSingleton&) {} private: JSingleton& operator=(const JSingleton&); }; } #endif