接口隔离

踏踏实实做事

导航

单例模式

#include <iostream>
#include <string>
#include <vector>
#include <map>

using namespace std;


class singlgSys
{
private:
    static singlgSys * pSingle;
    singlgSys(){}
public:
    static singlgSys * getInstance()
    {
        if(NULL == pSingle)
        {
            pSingle = new singlgSys();
            return pSingle;
        }
        return pSingle;
    }
};

posted on 2016-10-27 11:24  接口隔离  阅读(128)  评论(0编辑  收藏  举报