📄 commonfactory.cpp
字号:
// CommonFactory.cpp: implementation of the CommonFactory class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "PainterUsePattern.h"
#include "CommonFactory.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//=================================================================
//静态成员初始化;
//=================================================================
CommonFactory* CommonFactory::m_onlyOneInstance = 0;
bool CommonFactory::m_onlyOne = false;
//=================================================================
//构造函数;
//=================================================================
CommonFactory::CommonFactory()
{
}
//=================================================================
//析构函数;
//=================================================================
CommonFactory::~CommonFactory()
{
}
//=================================================================
//实例化函数;
//=================================================================
CommonFactory* CommonFactory::Instance()
{
if( m_onlyOne == false )
{
m_onlyOne = true;
m_onlyOneInstance = new CommonFactory;
}
return m_onlyOneInstance;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -