?? prototype.cpp
字號:
/********************************************************************
created: 2006/07/20
filename: Prototype.cpp
author: 李創
http://www.cppblog.com/converse/
purpose: Prototype模式的演示代碼
*********************************************************************/
#include "Prototype.h"
#include <iostream>
ConcreatePrototype1::ConcreatePrototype1()
{
std::cout << "construction of ConcreatePrototype1\n";
}
ConcreatePrototype1::~ConcreatePrototype1()
{
std::cout << "destruction of ConcreatePrototype1\n";
}
ConcreatePrototype1::ConcreatePrototype1(const ConcreatePrototype1&)
{
std::cout << "copy construction of ConcreatePrototype1\n";
}
Prototype* ConcreatePrototype1::Clone()
{
return new ConcreatePrototype1(*this);
}
ConcreatePrototype2::ConcreatePrototype2()
{
std::cout << "construction of ConcreatePrototype2\n";
}
ConcreatePrototype2::~ConcreatePrototype2()
{
std::cout << "destruction of ConcreatePrototype2\n";
}
ConcreatePrototype2::ConcreatePrototype2(const ConcreatePrototype2&)
{
std::cout << "copy construction of ConcreatePrototype2\n";
}
Prototype* ConcreatePrototype2::Clone()
{
return new ConcreatePrototype2(*this);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -