设计模式例程

This commit is contained in:
2025-06-02 13:57:29 +08:00
commit 22124bb827
32 changed files with 2149 additions and 0 deletions

22
inc/prototype.hpp Normal file
View 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&); //
};