diff options
Diffstat (limited to 'Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.cpp')
| -rw-r--r-- | Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.cpp b/Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.cpp new file mode 100644 index 0000000..68c6e5e --- /dev/null +++ b/Bachelor/Prog2/Prakt2/SmartHouse/Coffeemachine.cpp @@ -0,0 +1,42 @@ +#include "Coffeemachine.h"
+#include <iostream>
+
+using std::cout;
+using std::endl;
+using std::string;
+//using std::istream;
+using std::ostream;
+
+Coffeemachine::Coffeemachine()
+{
+ numberOfCups=0;
+ cout << "Konstruktor Coffeemachine called" << endl;
+}
+
+Coffeemachine::Coffeemachine(char * devName)
+ :GeneralDevice(devName)
+{
+ numberOfCups=0;
+ cout << "Überladener Konstruktor Coffeemachine called" << endl;
+}
+
+Coffeemachine::~Coffeemachine()
+{
+ cout << "Destruktor Coffeemachine called" << endl;
+}
+
+void Coffeemachine::operator++(int)
+{
+ numberOfCups++;
+}
+
+void Coffeemachine::operator--(int)
+{
+ numberOfCups<=0?numberOfCups=0:numberOfCups--;
+}
+
+void Coffeemachine::print()
+{
+ cout << "Name: " << getDeviceName()
+ << " Cups: " << numberOfCups << endl;
+}
|
