diff options
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;
+}
|
