添加设计模式及例子,包括:单例、抽象工厂、适配器、桥接、观察者模式

This commit is contained in:
huihut
2018-07-22 14:50:54 +08:00
parent 92bc715c1f
commit b69685a5a7
31 changed files with 839 additions and 31 deletions

View File

@@ -0,0 +1,17 @@
//
// Created by xiemenghui on 2018/7/21.
//
#ifndef DESIGNPATTERN_IMPLEMENTOR_H
#define DESIGNPATTERN_IMPLEMENTOR_H
// 电器
class IElectricalEquipment
{
public:
virtual ~IElectricalEquipment(){}
virtual void PowerOn() = 0; // 打开
virtual void PowerOff() = 0; // 关闭
};
#endif //DESIGNPATTERN_IMPLEMENTOR_H