设计模式例程
This commit is contained in:
22
inc/prototype.hpp
Normal file
22
inc/prototype.hpp
Normal file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
#include "common.hpp"
|
||||
|
||||
class Prototype // C++ <20><><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊdz<CEAA><C7B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD>ģʽΪ<CABD><EFBFBD><EEBFBD>
|
||||
{
|
||||
public:
|
||||
Prototype() {}
|
||||
~Prototype() {}
|
||||
|
||||
virtual Prototype* Clone() = 0;
|
||||
};
|
||||
|
||||
class ConcretePrototype :public Prototype
|
||||
{
|
||||
public:
|
||||
ConcretePrototype() {}
|
||||
~ConcretePrototype() {}
|
||||
|
||||
virtual Prototype* Clone();
|
||||
private:
|
||||
ConcretePrototype(const ConcretePrototype&); //
|
||||
};
|
Reference in New Issue
Block a user