![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
设计模式
文章平均质量分 76
海透了心
xubuntu@foxmail.com
展开
-
设计模式_适配器
//类适配器#include#includeusing namespace std;class Target { public: virtual void request(){ cout << "Target::Request"<<endl; }};class Adaptee{public: void SpecificRequest(){原创 2015-02-19 00:22:32 · 1067 阅读 · 1 评论 -
设计模式_简单工厂
#include#include#include#include#include#include#includeusing namespace std;enum Ctype {coreA,coreB};class SingleCore{public: virtual void print(){ cout "siglecore_p原创 2015-02-12 16:50:08 · 366 阅读 · 0 评论 -
设计模式_抽象工厂
#include#include#include#include#include#include#includeusing namespace std;enum Ctype {coreA,coreB};class SingleCore{public: virtual void print(){ cout << "siglecore_print"<<end原创 2015-02-13 13:07:08 · 415 阅读 · 0 评论 -
设计模式_单例模式
#include#include#include#include#include#include#include//#include"log.h"using namespace std;class SingleMode{public: static SingleMode* GetInstance(){ if (m_Instance == NULL){原创 2015-02-14 20:21:55 · 391 阅读 · 0 评论 -
设计模式_工厂方法
缺点:创建类较多适用:后期扩展较多,或比较复杂#include#include#include#include#include#include#includeusing namespace std;enum Ctype {coreA,coreB};class SingleCore{public: virtual void print(){ cou原创 2015-02-12 21:51:55 · 436 阅读 · 0 评论