From 6c48319c60c4eb6ad4ff3631f5caa6b297d2e787 Mon Sep 17 00:00:00 2001 From: LYW <leeyeanwoo@diteam.co.kr> Date: 수, 18 8월 2021 09:06:18 +0900 Subject: [PATCH] Merge branch 'feature/#3561_CF_AOI_Review_Align_카메라_끊김_현상_조치' into feature/#3562_CF_AOI_Review_실행_프로그램_경로_변경 --- ReviewHistory/ReveiwHistory/Singleton.h | 35 +++++++++++++++++++++++++++++++++++ 1 files changed, 35 insertions(+), 0 deletions(-) diff --git a/ReviewHistory/ReveiwHistory/Singleton.h b/ReviewHistory/ReveiwHistory/Singleton.h new file mode 100644 index 0000000..003088b --- /dev/null +++ b/ReviewHistory/ReveiwHistory/Singleton.h @@ -0,0 +1,35 @@ +#pragma once + +template <typename T> +class CSingleton +{ +public: + CSingleton() {} + virtual ~CSingleton() {} + + static void CreateClass() + { + if ( !m_pMgr ) + m_pMgr = new T; + } + + static void DestroyClass() + { + if ( m_pMgr ) + { + delete m_pMgr; + + m_pMgr = NULL; + } + } + + static T* GetMgr() + { + return m_pMgr; + } + +private: + static T* m_pMgr; +}; + +template<typename T> T* CSingleton<T>::m_pMgr = NULL; \ No newline at end of file -- Gitblit v1.9.3