HomeWaterLeaksDetection
|
#include <DateTime.h>
Public Member Functions | |
String | getDateTimeStr () const |
Returns the current datatime in a string format. More... | |
String | getDateStr () const |
Returns the current day in a string format. More... | |
String | getTimeStr () const |
Returns the current time in a string format. More... | |
RTCDateTime | getDateTime () const |
Returns the current datatime. More... | |
const String | getHTMLData (const int id) const |
Since this class is registered as a source of data for the HTML content, it needs return the appropriate value according to the id given as a parameter. More... | |
Static Public Member Functions | |
static DateTime * | getInstance () |
Returns the instance of the class. More... | |
Private Member Functions | |
DateTime () | |
Constructor of the class. More... | |
~DateTime () | |
Destructor of the class. More... | |
DateTime (DateTime const &) | |
Copy constructor of the class. More... | |
DateTime & | operator= (DateTime const &) |
Assignment operator of the class. More... | |
Private Attributes | |
DS3231 | rtc |
real-time module More... | |
String | startDate |
start day of the system More... | |
String | startTime |
start time of the system More... | |
std::map< int, String(*)(const DateTime &dateTime)> | htmlData |
A map of different values (keys) and their associated functions which returns the appropriate values. More... | |
Static Private Attributes | |
static DateTime * | instance = NULL |
the instance of the class (Singleton) More... | |
Friends | |
String | HTML_startDate (const DateTime &dateTime) |
Associated function for returing the start day of the device. More... | |
String | HTML_startTime (const DateTime &dateTime) |
Associated function for returing the start time of the device. More... | |
Additional Inherited Members | |
![]() | |
static const String | UNDEFINED_DATA = String("UNDEFINED") |
string "UNDEFINED" More... | |
This class holds information about datetimes. This includes values such as the system start time, current datatime, etc. If the webserver is enabled, this class also works a source of data for the HTML content.
Definition at line 158 of file DateTime.h.
|
private |
Constructor of the class.
Definition at line 10 of file DateTime.cpp.
References getDateStr(), getTimeStr(), HTML_startDate, HTML_startTime, htmlData, rtc, startDate, and startTime.
Referenced by getInstance().
|
private |
Destructor of the class.
|
inlineprivate |
String DateTime::getDateStr | ( | ) | const |
Returns the current day in a string format.
Definition at line 39 of file DateTime.cpp.
References rtc.
Referenced by DateTime(), and getDateTimeStr().
RTCDateTime DateTime::getDateTime | ( | ) | const |
Returns the current datatime.
Definition at line 51 of file DateTime.cpp.
References rtc.
Referenced by Consumption::Consumption(), DailyOverview::DailyOverview(), Consumption::update(), and DailyOverview::update().
String DateTime::getDateTimeStr | ( | ) | const |
Returns the current datatime in a string format.
Definition at line 47 of file DateTime.cpp.
References getDateStr(), and getTimeStr().
Referenced by LowLeakDetection::testActiveLeak(), HighLeakDetection::testActiveLeak(), and TotalLeakDetection::testActiveLeak().
|
virtual |
Since this class is registered as a source of data for the HTML content, it needs return the appropriate value according to the id given as a parameter.
id | - the id of the piece of data |
Implements HTMLDataSource.
|
static |
Returns the instance of the class.
If the instance has not been created, it will create it and then return it.
Definition at line 26 of file DateTime.cpp.
References DateTime(), and instance.
Referenced by Consumption::Consumption(), DailyOverview::DailyOverview(), setup(), LowLeakDetection::testActiveLeak(), HighLeakDetection::testActiveLeak(), TotalLeakDetection::testActiveLeak(), Consumption::update(), DailyOverview::update(), and LeaksController::update().
String DateTime::getTimeStr | ( | ) | const |
Returns the current time in a string format.
Definition at line 32 of file DateTime.cpp.
References FORMAT_2_DIGITS, and rtc.
Referenced by DateTime(), and getDateTimeStr().
|
friend |
Associated function for returing the start day of the device.
dateTime | - the instance of the DateTime class |
Referenced by DateTime().
|
friend |
Associated function for returing the start time of the device.
dateTime | - the instance of the DateTime class |
Referenced by DateTime().
|
private |
A map of different values (keys) and their associated functions which returns the appropriate values.
Definition at line 215 of file DateTime.h.
Referenced by DateTime().
|
staticprivate |
the instance of the class (Singleton)
Definition at line 165 of file DateTime.h.
Referenced by getInstance().
|
private |
real-time module
Definition at line 166 of file DateTime.h.
Referenced by DateTime(), getDateStr(), getDateTime(), and getTimeStr().
|
private |
|
private |