mirror of
https://github.com/huihut/interview.git
synced 2024-03-22 13:10:48 +08:00
24 lines
452 B
C++
24 lines
452 B
C++
//
|
|
// Created by xiemenghui on 2018/7/21.
|
|
//
|
|
|
|
#ifndef DESIGNPATTERN_ABSTRACTION_H
|
|
#define DESIGNPATTERN_ABSTRACTION_H
|
|
|
|
#include "implementor.h"
|
|
|
|
// Switch
|
|
class ISwitch
|
|
{
|
|
public:
|
|
ISwitch(IElectricalEquipment *ee){ m_pEe = ee; }
|
|
virtual ~ISwitch(){}
|
|
virtual void On() = 0; // Turn on the appliance
|
|
virtual void Off() = 0; // Turn off the appliance
|
|
|
|
protected:
|
|
IElectricalEquipment * m_pEe;
|
|
};
|
|
|
|
#endif //DESIGNPATTERN_ABSTRACTION_H
|