AEM
|
#include <timeStamper.h>
Public Member Functions | |
TimeStamper (timeStamp_t tInit) | |
timeStamp_t | getTimeStamp () |
timeStamp_t | getCompensatedTimeStamp (const timeStamp_t &uTime) |
void | setTime0 (timeStamp_t t) |
Data Fields | |
timeStamp_t | t0 |
Static Public Attributes | |
static TimeStamper * | theTimeStamper = NULL |
TimeStamper class provides time services at instanciation, or after by a call to setTime0, the time0, i.e. the reference time that should be called 0 microseconds can be set.
All members are public, but should not be abused!
The services are:
getTimeStamp() returns time in micro secs since t0
getCompensatedTimeStamp(timeStamp_t uTime) returns the uTime (uncompensated time) minus t0, thus the compensated value.
setTime0(timeStamp_t t) sets t0 to the arg.
The class provides a public static instance via the pointer TimeStamper::theTimeStamper. This should be the only instance created.
TimeStamper::TimeStamper | ( | timeStamp_t | tInit | ) |
constructor
tInit | the value to be used to initialize t0 |
timeStamp_t TimeStamper::getCompensatedTimeStamp | ( | const timeStamp_t & | uTime | ) |
gets the compensated timestamp of the argument, if the argument is less than t0, resets t0 to 0 micro seconds
uTime | a time value |
timeStamp_t TimeStamper::getTimeStamp | ( | ) |
gets the current timestamp, i.e. current time - t0 in microsecs if time is less than t0, resets t0 to 0
void TimeStamper::setTime0 | ( | timeStamp_t | t | ) |
Resets the value of t0 to the arg
t | the new value of t0 |
timeStamp_t TimeStamper::t0 |
the zero time in microseconds
|
static |
pointer to a public instance of TimeStamper for use by anyone wh o needs it. Only one instance should be needed per slave.