Telescope Control Library

Dependents:   PushToGo-F429

UTCClock.h

Committer:
caoyu@caoyuan9642-desktop.MIT.EDU
Date:
2018-09-23
Revision:
18:3ea58b079adc
Parent:
5:2ee2c36f4d87

File content as of revision 18:3ea58b079adc:

#include <time.h>

#ifndef UTCCLOCK_H_
#define UTCCLOCK_H_
/**
 * This class provides an interface to a general clock that provides information about the current time.
 * In most systems, this class is implemented by RTCClock to read time from the RTC.
 */
class UTCClock {
public:
	UTCClock() {
	}
	virtual ~UTCClock() {
	}

	/** @return current UTC time in Unix timestamp format
	 */
	virtual time_t getTime() = 0;

	/** @return current UTC time in high resolution (fraction of seconds)
	 */
	virtual double getTimeHighResolution() {
		return (double) getTime();
	}

	/** Set system time
	 */
	virtual void setTime(time_t time) = 0;

};

#endif /*UTCCLOCK_H_*/