Timer Console
Loading...
Searching...
No Matches
alarmData.h
Go to the documentation of this file.
1/*
2MIT License
4Copyright (c) 2025 Ryan Large
5
6Permission is hereby granted, free of charge, to any person obtaining a copy
7of this software and associated documentation files (the "Software"), to deal
8in the Software without restriction, including without limitation the rights
9to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10copies of the Software, and to permit persons to whom the Software is
11furnished to do so, subject to the following conditions:
12
13The above copyright notice and this permission notice shall be included in all
14copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22SOFTWARE.
23*/
24
25#ifndef ALARM_DATA_H
26#define ALARM_DATA_H
27
28#include "./alarm.h"
29#include <vector>
30#include <map>
31
35class AlarmData {
36 public:
37
44 struct Vibrate {
45 bool on;
46 double intensity;
47
48 Vibrate(const bool& on, const double& intensity): on(on),
50 };
51
57 struct AlarmTime {
58 int hour;
59 int minute;
60
61 AlarmTime(const int& h, cont int& m): hour(h),
62 minute(m) {}
63 }
64
75 const std::vector < Alarm::DaysOfWeek>& daysOfWeek,
76 const AlarmTime& alarmTime,
77 const bool& on,
78 const std::string& meridiem,
79 const Vibrate& vibrate
80 const std::string& message
81 );
82
87 void changeTime(const AlarmTime& newTime);
88
93 bool toggleOnOff();
94
98 void toggleMeridiem();
99
103 void print();
104
105 protected:
106 private:
107};
108
109#endif
AlarmTime(const int &h, cont int &m)
Definition alarmData.h:3
void changeTime(const AlarmTime &newTime)
change the time of the alarm by creating a new AlarmTime struct after prompting. This method also upd...
Definition alarmData.cpp:46
struct AlarmData::AlarmTime AlarmData(const std::vector< Alarm::DaysOfWeek > &daysOfWeek, const AlarmTime &alarmTime, const bool &on, const std::string &meridiem, const Vibrate &vibrate const std::string &message)
AlarmData constructor takes in all necessary data to build a functional alarm to be stored and used i...
Definition alarmData.cpp:31
void toggleMeridiem()
toggleMeridiem will ch age the string value to AM if currently PM and PM if currently AM....
Definition alarmData.cpp:55
bool toggleOnOff()
toggleOnOff turns the alarm on state to the opposite of what it current is set as
Definition alarmData.cpp:50
void print()
Print specializes in printing the alarm in a user friendly way to the console along with the shortene...
Definition alarmData.cpp:65
int minute
Definition alarmData.h:59
int hour
Definition alarmData.h:58
AlarmTime(const int &h, cont int &m)
Definition alarmData.h:61
bool on
Definition alarmData.h:45
Vibrate(const bool &on, const double &intensity)
Definition alarmData.h:48
double intensity
Definition alarmData.h:46