goptions
Loading...
Searching...
No Matches
gswitch.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
13class GSwitch {
14
15public:
16
23 GSwitch() = default;
24
32 GSwitch(const std::string &d) : description(d), status(false) {}
33
39 void turnOn() { status = true; }
40
46 void turnOff() { status = false; }
47
53 bool getStatus() const { return status; }
54
60 const std::string &getDescription() const { return description; }
61
62private:
66 std::string description;
67
74 bool status{false};
75
76};
77
Represents a switch with a description and a status.
Definition gswitch.h:13
void turnOn()
Turns the switch on.
Definition gswitch.h:39
const std::string & getDescription() const
Retrieves the description of the switch.
Definition gswitch.h:60
void turnOff()
Turns the switch off.
Definition gswitch.h:46
GSwitch(const std::string &d)
Parameterized constructor.
Definition gswitch.h:32
bool getStatus() const
Retrieves the current status of the switch.
Definition gswitch.h:53
GSwitch()=default
Default constructor.