-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTV.cpp
More file actions
37 lines (32 loc) · 702 Bytes
/
TV.cpp
File metadata and controls
37 lines (32 loc) · 702 Bytes
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
//////////////////////////////////////////
// Workfile : TV.cpp
// Author : Pascal Lang
// Date : 09.01.2021
// Description : Source Code for TV-Devices.
//////////////////////////////////////////
#include "TV.h"
#include "TStatePower.h"
using namespace std;
void TV::Info(ostream& ost) const
{
ost << "TV is ";
//print the current powerstate to
//the given ostream
switch(mState){
case TStatePower::eOn: ost << "on" << endl;
break;
case TStatePower::eOff: ost << "off" << endl;
break;
}
}
void TV::SetState(TStatePower const& state)
{
//Set internal powerstate to
//given value
mState = state;
}
TStatePower TV::GetState() const
{
//returns current powerstate
return mState;
}