diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp')
| -rw-r--r-- | Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp b/Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp new file mode 100644 index 0000000..6cbc24b --- /dev/null +++ b/Bachelor/Prog2/Prakt2/SmartHouse/Radio.cpp @@ -0,0 +1,38 @@ +#include "Radio.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+
+Radio::Radio()
+{
+ volume=0;
+ cout << "Konstruktor Radio called" << endl;
+}
+
+Radio::Radio(char * devName)
+ :GeneralDevice(devName)
+{
+ volume=0;
+ cout << "Überladener Konstruktor Radio called" << endl;
+}
+
+Radio::~Radio()
+{
+ cout << "Destruktor Radio called" << endl;
+}
+
+void Radio::operator++(int)
+{
+ volume++;
+}
+
+void Radio::operator--(int)
+{
+ volume<=0?volume=0:volume--;
+}
+
+void Radio::print()
+{
+ cout << "Name: "<< getDeviceName() << " Volume: " << volume << endl;
+}
|
