设计模式05——原型模式
摘要://prototype.cpp //原型模式:用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象 #include "gtest/gtest.h" class Prototype { public: Prototype() {} virtual ~Prototype() {} virtual Prototype* Clone() = 0; }; cla...
阅读全文
posted @
2018-01-06 22:41
生活的艺术
阅读(153)
推荐(0)
设计模式01——开始总结
摘要:最近阅读了《大话设计模式》,接下来结合用例总结典型设计模式,并将代码上传到github: https://github.com/BillZPage/PatternCase.git
阅读全文
posted @
2018-01-06 22:36
生活的艺术
阅读(103)
推荐(0)
设计模式03——工厂模式
摘要://factory.cpp //工厂模式 #include #include "gtest/gtest.h" class Operation { public: Operation() : x(0), y(0) {} virtual ~Operation() {} int x; int y; vi...
阅读全文
posted @
2018-01-06 22:32
生活的艺术
阅读(122)
推荐(0)