semf
clock.h
Go to the documentation of this file.
1
10#ifndef SEMF_SYSTEM_CLOCK_H_
11#define SEMF_SYSTEM_CLOCK_H_
12
14#include <semf/system/rtc.h>
15
16namespace semf
17{
21class Clock : public app::Clock
22{
23public:
28 explicit Clock(Rtc& rtc);
29 explicit Clock(const Clock& other) = delete;
31 virtual ~Clock() = default;
33
34 DateTime& now() override;
35 void set(DateTime& datetimeToSet) override;
36 app::Clock& operator=(const DateTime& datetimeToSet) override;
37
38private:
40 Rtc* m_rtc = nullptr;
42 DateTime m_dateTime;
43};
44} /* namespace semf */
45#endif /* SEMF_SYSTEM_CLOCK_H_ */
The Clock class provides real time clock functionality. It can return a DateTime object with actual d...
Definition: clock.h:22
app::Clock & operator=(const DateTime &datetimeToSet) override
Copies the date time.
Definition: clock.cpp:38
Clock(Rtc &rtc)
Constructor.
Definition: clock.cpp:15
Clock(const Clock &other)=delete
DateTime & now() override
Returns the momentary date time from Rtc.
Definition: clock.cpp:20
void set(DateTime &datetimeToSet) override
Sets the DateTime information from datetimeToSet to the Rtc.
Definition: clock.cpp:27
The DateTime class provides date and time functionality as a point of time. It combines features of t...
Definition: datetime.h:31
Interface for the real time clock.
Definition: rtc.h:23
The Clock class provides real time clock functionality. It can return a DateTime object with actual d...
Definition: clock.h:31
virtual ~Clock()=default