AEM
TimeStamper Class Reference

#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 TimeStampertheTimeStamper = NULL
 

Detailed Description

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.

Constructor & Destructor Documentation

TimeStamper::TimeStamper ( timeStamp_t  tInit)

constructor

Parameters
tInitthe value to be used to initialize t0

Member Function Documentation

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

Parameters
uTimea time value
Returns
, uTime- t0 in microsecs
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

Returns
timeStamp time
void TimeStamper::setTime0 ( timeStamp_t  t)

Resets the value of t0 to the arg

Parameters
tthe new value of t0

Field Documentation

timeStamp_t TimeStamper::t0

the zero time in microseconds

TimeStamper * TimeStamper::theTimeStamper = NULL
static

pointer to a public instance of TimeStamper for use by anyone wh o needs it. Only one instance should be needed per slave.


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