-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpen.cpp
More file actions
35 lines (30 loc) · 681 Bytes
/
Open.cpp
File metadata and controls
35 lines (30 loc) · 681 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
//////////////////////////////////////////
// Workfile : Open.cpp
// Author : Michael Enzelsberger
// Date : 09.01.2021
// Description : Concrete Open Command.
//////////////////////////////////////////
#include "Open.h"
using namespace std;
Open::Open(StereoCD::SPtr const& cd)
{
//check nullpointer
if (cd == nullptr)
{
throw string("null pointer in CTOR Open");
}
//store device pointer
mCD = cd;
}
void Open::Execute()
{
//store current state as previous state
mPrevState = mCD->GetStateCD();
//overwrite current state
mCD->SetStateCD(TStateCD::eOpen);
}
void Open::Undo() const
{
//overwrite current state with previous state
mCD->SetStateCD(mPrevState);
}