#ifndef _TSINGLETON_H_
#define _TSINGLETON_H_

template <class T> class TSingleton
{
	public:
	TSingleton()
	{ 
	}

	~TSingleton()
	{ 
	}

	static T* getSingleton()
	{
		if(!m_pInstance)
			m_pInstance = new T;
		return m_pInstance;
	}

	static void deleteSingleton()
	{
		delete m_pInstance;
		m_pInstance = 0;
	}

	protected:
	static T *m_pInstance;
};

#endif
