Telescope Control Library
UTCClock.h@5:2ee2c36f4d87, 2018-09-09 (annotated)
- Committer:
- caoyuan9642
- Date:
- Sun Sep 09 19:03:07 2018 +0000
- Revision:
- 5:2ee2c36f4d87
- Parent:
- 0:6cb2eaf8b133
- Child:
- 18:3ea58b079adc
Updated docs
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
caoyuan9642 | 0:6cb2eaf8b133 | 1 | #include <time.h> |
caoyuan9642 | 0:6cb2eaf8b133 | 2 | |
caoyuan9642 | 0:6cb2eaf8b133 | 3 | #ifndef UTCCLOCK_H_ |
caoyuan9642 | 0:6cb2eaf8b133 | 4 | #define UTCCLOCK_H_ |
caoyuan9642 | 0:6cb2eaf8b133 | 5 | /** |
caoyuan9642 | 0:6cb2eaf8b133 | 6 | * This class provides an interface to a general clock that provides information about the current time. |
caoyuan9642 | 0:6cb2eaf8b133 | 7 | * In most systems, this class is implemented by RTCClock to read time from the RTC. |
caoyuan9642 | 0:6cb2eaf8b133 | 8 | */ |
caoyuan9642 | 0:6cb2eaf8b133 | 9 | class UTCClock |
caoyuan9642 | 0:6cb2eaf8b133 | 10 | { |
caoyuan9642 | 0:6cb2eaf8b133 | 11 | public: |
caoyuan9642 | 0:6cb2eaf8b133 | 12 | UTCClock() |
caoyuan9642 | 0:6cb2eaf8b133 | 13 | { |
caoyuan9642 | 0:6cb2eaf8b133 | 14 | } |
caoyuan9642 | 0:6cb2eaf8b133 | 15 | virtual ~UTCClock() |
caoyuan9642 | 0:6cb2eaf8b133 | 16 | { |
caoyuan9642 | 0:6cb2eaf8b133 | 17 | } |
caoyuan9642 | 0:6cb2eaf8b133 | 18 | |
caoyuan9642 | 5:2ee2c36f4d87 | 19 | /** @return current UTC time in Unix timestamp format |
caoyuan9642 | 5:2ee2c36f4d87 | 20 | */ |
caoyuan9642 | 0:6cb2eaf8b133 | 21 | virtual time_t getTime() = 0; |
caoyuan9642 | 5:2ee2c36f4d87 | 22 | |
caoyuan9642 | 5:2ee2c36f4d87 | 23 | /** Set system time |
caoyuan9642 | 5:2ee2c36f4d87 | 24 | */ |
caoyuan9642 | 0:6cb2eaf8b133 | 25 | virtual void setTime(time_t time) = 0; |
caoyuan9642 | 0:6cb2eaf8b133 | 26 | |
caoyuan9642 | 0:6cb2eaf8b133 | 27 | }; |
caoyuan9642 | 0:6cb2eaf8b133 | 28 | |
caoyuan9642 | 0:6cb2eaf8b133 | 29 | #endif /*UTCCLOCK_H_*/ |
caoyuan9642 | 0:6cb2eaf8b133 | 30 |