Fawkes API  Fawkes Development Version
fawkes::TimeSource Class Referenceabstract

TimeSource interface. More...

#include <timesource.h>

Inheritance diagram for fawkes::TimeSource:

Public Member Functions

virtual ~TimeSource ()
 Destructor. More...
 
virtual void get_time (timeval *tv) const =0
 Get the current time. More...
 
virtual timeval conv_to_realtime (const timeval *tv) const =0
 Convert a time given w.r.t. More...
 
virtual timeval conv_native_to_exttime (const timeval *tv) const =0
 Convert a native time to the external time. More...
 

Detailed Description

TimeSource interface.

This interfaces describes a way to interact with time sources that can be given to a Clock (for instance for simulation environments).

Author
Daniel Beck

Definition at line 36 of file timesource.h.

Constructor & Destructor Documentation

◆ ~TimeSource()

virtual fawkes::TimeSource::~TimeSource ( )
inlinevirtual

Destructor.

Definition at line 40 of file timesource.h.

References conv_native_to_exttime(), conv_to_realtime(), and get_time().

Member Function Documentation

◆ conv_native_to_exttime()

virtual timeval fawkes::TimeSource::conv_native_to_exttime ( const timeval *  tv) const
pure virtual

Convert a native time to the external time.

When communicating with another instance which provides times in some timeformat native to the underlying time source (e.g. received from a simulation) it must be converted to a Fawkes time.

Parameters
tvtime in external time source native format
Returns
time in Fawkes comparable to other times generated using the external timesource.

Implemented in fawkes::GazsimTimesource, and fawkes::SimulatorTimeSource.

Referenced by fawkes::Clock::native_to_time(), and ~TimeSource().

◆ conv_to_realtime()

virtual timeval fawkes::TimeSource::conv_to_realtime ( const timeval *  tv) const
pure virtual

Convert a time given w.r.t.

this time sources into system time.

Parameters
tvthe time to convert
Returns
the converted time

Implemented in fawkes::GazsimTimesource, and fawkes::SimulatorTimeSource.

Referenced by fawkes::Clock::ext_to_realtime(), and ~TimeSource().

◆ get_time()

virtual void fawkes::TimeSource::get_time ( timeval *  tv) const
pure virtual

Get the current time.

Parameters
tvthe current time is written to this timeval

Implemented in fawkes::GazsimTimesource, and fawkes::SimulatorTimeSource.

Referenced by fawkes::Clock::get_time(), and ~TimeSource().


The documentation for this class was generated from the following file: