2018-07-22 14:50:54 +08:00
|
|
|
//
|
|
|
|
// Created by xiemenghui on 2018/7/21.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef DESIGNPATTERN_ABSTRACTION_H
|
|
|
|
#define DESIGNPATTERN_ABSTRACTION_H
|
|
|
|
|
|
|
|
#include "implementor.h"
|
|
|
|
|
2020-12-16 16:07:24 +08:00
|
|
|
// Switch
|
2018-07-22 14:50:54 +08:00
|
|
|
class ISwitch
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ISwitch(IElectricalEquipment *ee){ m_pEe = ee; }
|
|
|
|
virtual ~ISwitch(){}
|
2020-12-16 16:07:24 +08:00
|
|
|
virtual void On() = 0; // Turn on the appliance
|
|
|
|
virtual void Off() = 0; // Turn off the appliance
|
2018-07-22 14:50:54 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
IElectricalEquipment * m_pEe;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //DESIGNPATTERN_ABSTRACTION_H
|