-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDevice.cpp
78 lines (65 loc) · 1.7 KB
/
Device.cpp
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
///-------------------------------------------------------------------------------------------------
/// @file POC\Device.cpp.
///
/// @brief Implements the device class
#include "Device.h"
list<Device*> Device::deviceList;
///-------------------------------------------------------------------------------------------------
/// @fn Device::Device(string name)
///
/// @brief Constructor
///
/// @author Benjamin
/// @date 28.09.2020
///
/// @param name The name.
Device::Device(string name) {
this->name = name;
Device::deviceList.push_back(this);
}
///-------------------------------------------------------------------------------------------------
/// @fn string Device::getName()
///
/// @brief Gets the name
///
/// @author Benjamin
/// @date 28.09.2020
///
/// @returns The name.
string Device::getName() {
return name;
}
///-------------------------------------------------------------------------------------------------
/// @fn void Device::initAll()
///
/// @brief Initializes all
///
/// @author Benjamin
/// @date 28.09.2020
void Device::initAll() {
for (auto e = deviceList.begin(); e != deviceList.end(); e++) {
(*e)->init();
}
}
///-------------------------------------------------------------------------------------------------
/// @fn void Device::selfTestAll()
///
/// @brief Self test all
///
/// @author Benjamin
/// @date 28.09.2020
void Device::selfTestAll() {
for (auto e = deviceList.begin(); e != deviceList.end(); e++) {
(*e)->selfTest();
}
}
///-------------------------------------------------------------------------------------------------
/// @fn Device::~Device()
///
/// @brief Destructor
///
/// @author Benjamin
/// @date 28.09.2020
Device::~Device() {
deviceList.remove(this);
}