This repository was archived by the owner on May 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecurityCamera.cpp
More file actions
54 lines (49 loc) · 1.57 KB
/
Copy pathSecurityCamera.cpp
File metadata and controls
54 lines (49 loc) · 1.57 KB
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
#include <iostream>
#include <string>
#include "Device.h"
#include "SecurityCamera.h"
SecurityCamera::SecurityCamera(int id, const std::string& deviceName, const std::string& deviceManufacturer, bool status = false, const std::string& quality, const std::string& power)
: Device(id, deviceName, deviceManufacturer, status) {
setId(id);
setDeviceName(deviceName);
setManufacturer(deviceManufacturer);
setStatus(status);
//additional attributes
setQuality(quality);
setPower(power);
}
//setter and getter definitions for m_quality
void SecurityCamera::setQuality(const std::string& quality) {
m_quality = quality;
}
std::string SecurityCamera::getQuality() const {
return m_quality;
}
//setter and getter definition for m_power
void SecurityCamera::setPower(const std::string& power) {
m_power = power;
}
std::string SecurityCamera::getPower() const {
return m_power;
}
void SecurityCamera::interactionEvent() { //override
if (getStatus() == true) {
std::cout << "Now viewing camera: " << getDeviceName() << std::endl;
}
else {
std::cout << getDeviceName() << " is not activated!" << std::endl;
}
}
void SecurityCamera::viewInfo() {
std::cout << "Device ID: " << getId() << std::endl;
std::cout << "Device Name: " << getDeviceName() << std::endl;
std::cout << "Manufacturer: " << getManufacturer() << std::endl;
std::cout << "Camera Quality: " << getQuality() << std::endl;
std::cout << "Power Source: " << getPower() << std::endl;
if (getStatus() == true) {
std::cout << "Status: Activated" << std::endl;
}
else {
std::cout << "Status: Deactivated" << std::endl;
}
}