blob: 68c6e5ea595c745eadd88f7b6d3aa285bb455bdb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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;
}
|