factory.cpp

来自「设计模式实例: 工厂方法(Factory)源代码)」· C++ 代码 · 共 27 行

CPP
27
字号
// Factory.cpp: implementation of the Factory class.
//
//////////////////////////////////////////////////////////////////////

#include "Factory.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Factory::Factory()
{
	m_Officer=NULL;
}

Factory::~Factory()
{ 
	if(m_Officer!=NULL)
		delete m_Officer;
}


void Factory::PartyLine()
{
	if(m_Officer!=NULL)
		m_Officer->PartyLine();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?