-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDevice.cpp
More file actions
45 lines (37 loc) · 692 Bytes
/
Copy pathDevice.cpp
File metadata and controls
45 lines (37 loc) · 692 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
38
39
40
41
42
43
44
45
#include "Device.h"
// Constructor to initialize default values
Device::Device() : id(0), type(PC), os("Unknown"), active(false) {}
// Method to initialize the device
void Device::init(unsigned int id, DeviceType type, std::string os)
{
this->id = id;
this->type = type;
this->os = os;
this->active = true;
}
// Getters - mark them as const
unsigned int Device::getID() const
{
return id;
}
DeviceType Device::getType() const
{
return type;
}
std::string Device::getOS() const
{
return os;
}
bool Device::isActive() const
{
return active;
}
// Methods to change device state
void Device::activate()
{
active = true;
}
void Device::deactivate()
{
active = false;
}