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

Alarm class handles all high level alarm tasks and management including adding, removing, providing interface for updating and defining crucial data for alarm functionality. More...

#include <alarm.h>

Public Member Functions

 Alarm ()
 

Private Member Functions

enum DaysOfWeek std::map< int code, std::string day > daysOfTheWeek std::vector< AlarmData > alarms void loadAlarms ()
 For easy interfacing between days of the week an alarm is triggered and the integer which represents them.
 
void printOptions ()
 Print and prompt user for input to be handled.
 
void handleOption (const int &answer)
 Run the input from user through switch statement to better handle many choices.
 
void handleAddAlarm ()
 All alarm member methods branched from.
 
void handleRemoveAlarm ()
 
void handleUpdateAlarmDay ()
 
void handleUpdateAlarmTime ()
 
void handleToggleOnOffAlarm ()
 
void handleRemoveAllAlarms ()
 
void handleQuit ()
 
AlarmData getAlarm ()
 Helper methods.
 
bool includes (const int &dayCode, const std::vector< int > &daysSelected)
 Checks if an integer exists within a vector.
 
void setAlarmMeridiem (AlarmData &alarmToUpdate)
 Alarm instance updating methods.
 
void setAlarmTime (AlarmData &alarmToUpdate)
 
void setAlarmDays (AlarmData &alarmToUpdate)
 

Detailed Description

Alarm class handles all high level alarm tasks and management including adding, removing, providing interface for updating and defining crucial data for alarm functionality.

Constructor & Destructor Documentation

◆ Alarm()

Alarm::Alarm ( )

Member Function Documentation

◆ getAlarm()

AlarmData Alarm::getAlarm ( )
private

Helper methods.

Prompt the user for input selecting a valid existing alarm

Returns
See also
AlarmData to the caller of this method

◆ handleAddAlarm()

void Alarm::handleAddAlarm ( )
private

All alarm member methods branched from.

See also
handleOption()

◆ handleOption()

void Alarm::handleOption ( const int & answer)
private

Run the input from user through switch statement to better handle many choices.

Parameters
answerInteger selection from options menu

◆ handleQuit()

void Alarm::handleQuit ( )
private

◆ handleRemoveAlarm()

void Alarm::handleRemoveAlarm ( )
private

◆ handleRemoveAllAlarms()

void Alarm::handleRemoveAllAlarms ( )
private

◆ handleToggleOnOffAlarm()

void Alarm::handleToggleOnOffAlarm ( )
private

◆ handleUpdateAlarmDay()

void Alarm::handleUpdateAlarmDay ( )
private

◆ handleUpdateAlarmTime()

void Alarm::handleUpdateAlarmTime ( )
private

◆ includes()

bool Alarm::includes ( const int & dayCode,
const std::vector< int > & daysSelected )
private

Checks if an integer exists within a vector.

Parameters
dayCodethe integer in search for
daysSelectedthe vector you check in fir specified integer

◆ loadAlarms()

void Alarm::loadAlarms ( )
private

For easy interfacing between days of the week an alarm is triggered and the integer which represents them.

See also
daysOfTheWeek map

All user alarms to be stored in this vector from persistent memory and ram

◆ printOptions()

void Alarm::printOptions ( )
private

Print and prompt user for input to be handled.

◆ setAlarmDays()

void Alarm::setAlarmDays ( AlarmData & alarmToUpdate)
private

◆ setAlarmMeridiem()

void Alarm::setAlarmMeridiem ( AlarmData & alarmToUpdate)
private

Alarm instance updating methods.

Parameters
alarmToUpdatethe alarm instance needing to be updated
See also
AlarmData

◆ setAlarmTime()

void Alarm::setAlarmTime ( AlarmData & alarmToUpdate)
private

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