Fawkes API
Fawkes Development Version
|
25 #ifndef _UTILS_TIME_CLOCK_H_
26 #define _UTILS_TIME_CLOCK_H_
28 #include <utils/time/time.h>
57 void get_time(
struct timeval *tv)
const;
80 static Clock *_instance;
void set_ext_default_timesource(bool ext_is_default)
Set/unset the external time source as the default time source.
void get_time(struct timeval *tv) const
Returns the time of the selected time source.
Time native_to_time(const Time &t)
Convert some native time to a Fawkes time.
void remove_ext_timesource(TimeSource *ts=0)
Remove external time source.
float elapsed(Time *t) const
How much time has elapsed since t? Calculated as "now - t" in seconds.
@ EXTERNAL
select the external time source
TimesourceSelector
Select the time source.
@ REALTIME
select the system time source
static void finalize()
Finalize.
virtual ~Clock()
Destructor.
@ DEFAULT
select the default time source
Time now() const
Get the current time.
Fawkes library namespace.
void register_ext_timesource(TimeSource *ts, bool make_default=false)
Register an external time source.
Time ext_to_realtime(const Time &t)
Convert a time given w.r.t.
void get_systime(struct timeval *tv) const
Returns the system time.
A class for handling time.
static Clock * instance()
Clock initializer.
bool is_ext_default_timesource() const
Checks whether the external time source is the default time soucre.
This is supposed to be the central clock in Fawkes.
float sys_elapsed(Time *t) const
How much system time has elapsed since t? Use only for system time criteria like timeouts.
bool has_ext_timesource() const
Check whether an external time source is registered.