![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
设计模式
杜xx
这个作者很懒,什么都没留下…
展开
-
单例模式( Singleton)
#ifndef _SINGLETON_H #define _SINGLETON_H #include "stdafx.h" class Singleton { public: static Singleton * instance(); private: static Singleton * _instance; }; #endif #include "stdafx.转载 2015-08-28 15:00:49 · 284 阅读 · 0 评论 -
工厂模式
// factory.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include "Factory1.h" #include "Product.h" int _tmain(int argc, _TCHAR* argv[]) { Factory *factory = new CreateFactory; Product *pr转载 2015-08-28 14:39:12 · 246 阅读 · 0 评论 -
抽象工厂(AbstractFactory)
//#include "Product.h" class AbstractProductA; class AbstractProductB; class AbstractFactory { public: //AbstractFactory(); virtual ~AbstractFactory(); virtual AbstractProductA* CreateProd转载 2015-08-28 14:51:49 · 261 阅读 · 0 评论 -
builder模式
// Builder.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include "Builder.h" #include "Product.h" #include "Director.h" #include using namespace std; int _tmain(int argc, _TCHAR* argv[])原创 2015-09-25 14:11:47 · 264 阅读 · 0 评论