/
githubmirror
/
interview
Обзор
Документация
Войти
/
githubmirror
/
interview
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DesignPattern/BridgePattern/concrete_implementor.h
44 строки
869 B
huihut
Design mode code comments are changed to English
16 дек 2020, 11:07
16 дек 2020, 11:07
3a9e212
Код
Авторство
О чём код?
// // Created by xiemenghui on 2018/7/21. // #ifndef DESIGNPATTERN_CONCRETE_IMPLEMENTOR_H #define DESIGNPATTERN_CONCRETE_IMPLEMENTOR_H #include "implementor.h" #include <iostream> // Electric lights class Light : public IElectricalEquipment { public: // Turn on the lights virtual void PowerOn() override { std::cout << "Light is on." << std::endl; } // Turn off the lights virtual void PowerOff() override { std::cout << "Light is off." << std::endl; } }; // Electric Fan class Fan : public IElectricalEquipment { public: // Turn on the fan virtual void PowerOn() override { std::cout << "Fan is on." << std::endl; } // Turn off the fan virtual void PowerOff() override { std::cout << "Fan is off." << std::endl; } }; #endif //DESIGNPATTERN_CONCRETE_IMPLEMENTOR_H