![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++设计模式
Huan_Tao
这个作者很懒,什么都没留下…
展开
-
C++设计模式 -> 创建型 -> 抽象工厂(Abstract Factory)
抽象工厂模式(Abstract Factory)工厂车逻辑头文件Base_Factory.h#ifndef FACTORY_H#define FACTORY_H#include "Base_Product.h"/* 抽象工厂 */class Base_Factory{public: enum FACTORY_TYPE { BENZ_FACTORY, /*原创 2017-08-02 21:17:14 · 328 阅读 · 0 评论 -
C++设计模式 -> 行为型 -> 观察者模式(Observer Pattern)
———————– 抽象事件 | 具体事件 ——————————————– 抽象观察者 | 具体观察者 ——————-逻辑Base_Event.h#ifndef SUBJECT_H#define SUBJECT_Hclass Base_Observer;// 抽象事件class Base_Event{public: virtual void Add_Observer_Into_Cont原创 2017-10-17 19:06:05 · 301 阅读 · 0 评论 -
C++设计模式 -> 创建型 -> 工厂方式(FactoryMethod)
工厂模式头文件base_product.h#ifndef PRODUCT_H#define PRODUCT_H#include <string>using namespace std;// 汽车接口class ___Car{public: virtual string Produce() = 0; // 汽车名称protected:private:};#endif // PROD原创 2017-08-05 15:30:01 · 402 阅读 · 0 评论 -
C++设计模式 -> 创建型 -> 建造者(Builder)
建造者Product.h#ifndef PRODUCT_H#define PRODUCT_H#include <iostream>using namespace std;// 产品(电脑)class ___Computer{public: void Set_Cpu(string cpu) { this->cpu = cpu; } void Set_Mainboard(strin原创 2017-08-03 16:19:48 · 542 阅读 · 0 评论