Timer Console
Loading...
Searching...
No Matches
AlarmData Class Reference

AlarmData class handles the implementation of the actual alarm that is stored or in memory to be manipulated and used. More...

#include <alarmData.h>

Classes

struct  AlarmTime
 AlarmTime struct enables an integer pair for defining the time the alarm should be set for by hour and minute. More...
 
struct  Vibrate
 Vibrate struct provides more customization over how the device will react to an alarm being triggered. More...
 

Public Member Functions

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 in the app.
 
void changeTime (const AlarmTime &newTime)
 change the time of the alarm by creating a new AlarmTime struct after prompting. This method also updates AlarmData.meridiem
 
bool toggleOnOff ()
 toggleOnOff turns the alarm on state to the opposite of what it current is set as
 
void toggleMeridiem ()
 toggleMeridiem will ch age the string value to AM if currently PM and PM if currently AM. This method also updates the hour in the instances alarmTime struct
 
void print ()
 Print specializes in printing the alarm in a user friendly way to the console along with the shortened day of the week strings associated with.
 

Detailed Description

AlarmData class handles the implementation of the actual alarm that is stored or in memory to be manipulated and used.

Constructor & Destructor Documentation

◆ AlarmData()

AlarmData::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 in the app.

Parameters
daysOfWeekVector of integers correlating to the days of the week an alarm will be triggered on
alarmTime
See also
AlarmTime struct. Gives the hour and minute the alarm should be triggered
Parameters
onBoolean indicating if the alarm is active or not
meridiemString indicating if the alarm is for AM or PM. Used only when creating an alarm and when showing the user
vibrate
See also
Vibrate struct. Indicating the type of vibration pattern should be applied to the device when the alarm triggers
Parameters
messageString optional. Provided to the user when the alarm triggers

Member Function Documentation

◆ changeTime()

void AlarmData::changeTime ( const AlarmTime & newTime)

change the time of the alarm by creating a new AlarmTime struct after prompting. This method also updates AlarmData.meridiem

Parameters
newTome
See also
AlarmTime which provides the hour and minute the alarm should trigger

◆ print()

void AlarmData::print ( )

Print specializes in printing the alarm in a user friendly way to the console along with the shortened day of the week strings associated with.

See also
Alarm::DaysOfWeek.

◆ toggleMeridiem()

void AlarmData::toggleMeridiem ( )

toggleMeridiem will ch age the string value to AM if currently PM and PM if currently AM. This method also updates the hour in the instances alarmTime struct

See also
AlarmData.alarmTime

◆ toggleOnOff()

void AlarmData::toggleOnOff ( )

toggleOnOff turns the alarm on state to the opposite of what it current is set as

Returns
Boolean

The documentation for this class was generated from the following files: