Class TimeStamp¶
Defined in File timeStamp.h
Class Documentation¶
-
class TimeStamp¶
Methods for manipulating timeStamp.
A timeStamp structure has the following fields:
This is a class that holds values corresponding to the fields in a timeStamp structure. It is meant to be used together with pvTimeStamp which allows values to be copied between an timeStamp structure and this class. This class should not be extended.structure long secondsPastEpoch int nanoseconds int userTag
Public Functions
-
inline TimeStamp()¶
Default constructor
-
TimeStamp(int64 secondsPastEpoch, int32 nanoseconds = 0, int64 userTag = 0)¶
Constructor
- Parameters
secondsPastEpoch – seconds since 1970 UTC
nanoseconds – nanoseconds since secondsPastEpoch
userTag – application specific
-
void normalize()¶
adjust secondsPastEpoch and nanoseconds so that 0 <= nanoseconds < nanoSecPerSec
-
void fromTime_t(const time_t &time)¶
Set timeStamp from standard C time
- Parameters
time – time as returned by std::time
-
void toTime_t(time_t &time) const¶
Set time from timeStamp
- Parameters
time – time as defined by std::time
-
inline int64 getEpicsSecondsPastEpoch() const¶
Get secondsPastEpoch for EPICS V3. This is seconds since 1990 UTC.
- Returns
The epics V3 secondsPastEpoch.
-
inline void put(int64 secondsPastEpoch, int32 nanoseconds = 0)¶
Set time fields in timeStamp. Result will be normalized.
- Parameters
secondsPastEpoch – seconds part of timeStamp.
nanoseconds – nanoseconds part of timeStamp.
-
void put(int64 milliseconds)¶
Set time fields in timeStamp.
- Parameters
milliseconds – The number of milliseconds since the epoch.
-
void getCurrent()¶
Set the timeStamp to the current time.
-
inline TimeStamp()¶