#pragma once /************************************************************************************************** ÀÛ¼ºÀÏ: 2008-07-08 ÀÛ¼ºÀÚ: ¹®»óÇö (youngmoon@webzen.co.kr) ¼³¸í: ½ÌŬſ Áö¿ø **************************************************************************************************/ #define _instance(_class) WZPUBLIC::CSingleton<_class>::GetInstance() #define _releaseinstance(_class) WZPUBLIC::CSingleton<_class>::ReleaseInstance() namespace WZPUBLIC { template class CSingleton { public: CSingleton(void); ~CSingleton(void); static _TInstance* GetInstance() { if(NULL == m_Instance) { m_Instance = new _TInstance(); } return m_Instance; }; static void ReleaseInstance() { if( NULL != m_Instance ) { delete m_Instance; m_Instance = NULL; } }; private: static _TInstance* m_Instance; }; template _TInstance* CSingleton<_TInstance>::m_Instance = NULL; }