init
This commit is contained in:
30
sdk/srvlib/include/Singleton.hpp
Normal file
30
sdk/srvlib/include/Singleton.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
/************************************************************************/
|
||||
/* 单例模式
|
||||
/*
|
||||
/*
|
||||
/************************************************************************/
|
||||
|
||||
|
||||
class CSingleton
|
||||
{
|
||||
|
||||
private:
|
||||
static CSingleton* m_pInstance;
|
||||
|
||||
public:
|
||||
static CSingleton * GetInstance ()
|
||||
{
|
||||
if (m_pInstance == 0)
|
||||
{
|
||||
m_pInstance = new CSingleton();
|
||||
|
||||
}
|
||||
return m_pInstance;
|
||||
}
|
||||
|
||||
private:
|
||||
CSingleton();
|
||||
};
|
||||
//CSingleton* CSingleton::m_pInstance= 0;
|
||||
Reference in New Issue
Block a user