stream  0.10.0
stream analysis framework
Public Member Functions | Protected Attributes
base::LocalStampConverter Class Reference

LocalStampConverter class should perform conversion of time stamps to time in seconds. More...

#include <base/TimeStamp.h>

Public Member Functions

 LocalStampConverter ()
 constructor
 
 ~LocalStampConverter ()
 destructor
 
void SetT0 (int64_t t0)
 set T0
 
void SetTimeSystem (unsigned wrapbits, double coef)
 Set major timing parameters - wrap value and coefficient.
 
int64_t distance (LocalStamp_t t1, LocalStamp_t t2) const
 Method calculates distance between two stamps In simplest case just should return t2-t1.
 
uint64_t abs_distance (LocalStamp_t t1, LocalStamp_t t2)
 Method returns abs(t1-t2)
 
double ToSeconds (LocalStamp_t stamp) const
 Method convert time stamp to seconds, taking into account probable wrap relative to fRef value.
 
void MoveRef (LocalStamp_t newref)
 Move reference to the new position.
 

Protected Attributes

int64_t fT0
 ! time stamp, used as t0 for time production
 
uint64_t fWrapSize
 ! value of time stamp which wraps - MUST be power of 2
 
uint64_t fHalfWrapSize
 ! fWrapSize/2 - used very often in calculations
 
uint64_t fValueMask
 ! mask to extract bits related to stamp
 
uint64_t fCurrentWrap
 ! summed wraps since begin
 
LocalStamp_t fRef
 ! reference time, used to detect wraps of timestamp
 
int64_t fConvRef
 ! value used for time conversion
 
double fCoef
 ! time coefficient to convert to seconds
 

Detailed Description

LocalStampConverter class should perform conversion of time stamps to time in seconds.

Main problem to solve - handle correctly time stamp wraps.


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