From 33613a85afc4b1481367fbe92a17ee59c240250b Mon Sep 17 00:00:00 2001 From: Sven Eisenhauer Date: Fri, 10 Nov 2023 15:11:48 +0100 Subject: add new repo --- Bachelor/Prog2/Prakt2/SmartHouse/Heating.cpp | 40 ++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Bachelor/Prog2/Prakt2/SmartHouse/Heating.cpp (limited to 'Bachelor/Prog2/Prakt2/SmartHouse/Heating.cpp') diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Heating.cpp b/Bachelor/Prog2/Prakt2/SmartHouse/Heating.cpp new file mode 100644 index 0000000..1669848 --- /dev/null +++ b/Bachelor/Prog2/Prakt2/SmartHouse/Heating.cpp @@ -0,0 +1,40 @@ +#include "Heating.h" +#include + +using std::cout; +using std::endl; +using std::string; + +Heating::Heating() +{ + temperature=0; + cout << "Konstruktor Heating called" << endl; +} + +Heating::Heating(char * devName) + : GeneralDevice(devName) +{ + temperature=0; + cout << "Überladener Konstruktor Heating called" << endl; +} + +Heating::~Heating() +{ + cout << "Destruktor Heating called" << endl; +} + +void Heating::operator++(int) +{ + temperature++; +} + +void Heating::operator--(int) +{ + temperature<=0?temperature=0:temperature--; +} + +void Heating::print() +{ + cout << "Name: " << getDeviceName() + << " Temperatur: " << temperature << endl; +} -- cgit v1.2.3