factory.cpp

来自「设计模式实例: 远行(ProtoType)模式源代码」· C++ 代码 · 共 27 行

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

#include "Factory.h"

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

Factory::Factory()
{
	for(int i=0;i<4;i++)
		m_pProtoType[i]=NULL;
}

Factory::~Factory()
{ 
	for(int i=0;i<4;i++)
	{
		if(m_pProtoType[i]!=NULL)
			delete m_pProtoType[i];
	}
}


⌨️ 快捷键说明

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