![]() |
This is Unofficial EPICS BASE Doxygen Site
|
Methods for manipulating timeStamp. More...
#include "timeStamp.h"
Public Member Functions | |
TimeStamp () | |
TimeStamp (int64 secondsPastEpoch, int32 nanoseconds=0, int32 userTag=0) | |
void | normalize () |
void | fromTime_t (const time_t &time) |
void | toTime_t (time_t &time) const |
int64 | getSecondsPastEpoch () const |
int64 | getEpicsSecondsPastEpoch () const |
int32 | getNanoseconds () const |
int32 | getUserTag () const |
void | setUserTag (int32 userTag) |
void | put (int64 secondsPastEpoch, int32 nanoseconds=0) |
void | put (int64 milliseconds) |
void | getCurrent () |
double | toSeconds () const |
bool | operator== (TimeStamp const &) const |
bool | operator!= (TimeStamp const &) const |
bool | operator<= (TimeStamp const &) const |
bool | operator< (TimeStamp const &) const |
bool | operator>= (TimeStamp const &) const |
bool | operator> (TimeStamp const &) const |
TimeStamp & | operator+= (int64 seconds) |
TimeStamp & | operator-= (int64 seconds) |
TimeStamp & | operator+= (double seconds) |
TimeStamp & | operator-= (double seconds) |
int64 | getMilliseconds () |
Static Public Member Functions | |
static double | diff (TimeStamp const &a, TimeStamp const &b) |
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.
Definition at line 43 of file timeStamp.h.
|
inline |
Default constructor
Definition at line 48 of file timeStamp.h.
epics::pvData::TimeStamp::TimeStamp | ( | int64 | secondsPastEpoch, |
int32 | nanoseconds = 0 , |
||
int32 | userTag = 0 |
||
) |
Constructor
secondsPastEpoch | seconds since 1970 UTC |
nanoseconds | nanoseconds since secondsPastEpoch |
userTag | application specific |
Definition at line 29 of file timeStamp.cpp.
Return a-b as a double value with units of seconds.
a | first timeStamp |
b | second timeStamp |
Definition at line 141 of file timeStamp.cpp.
void epics::pvData::TimeStamp::fromTime_t | ( | const time_t & | time | ) |
Set timeStamp from standard C time
time | time as returned by std::time |
Definition at line 48 of file timeStamp.cpp.
void epics::pvData::TimeStamp::getCurrent | ( | ) |
Set the timeStamp to the current time.
Definition at line 70 of file timeStamp.cpp.
|
inline |
Get secondsPastEpoch for EPICS V3. This is seconds since 1990 UTC.
Definition at line 84 of file timeStamp.h.
int64 epics::pvData::TimeStamp::getMilliseconds | ( | ) |
Get number of milliseconds past epoch.
Definition at line 182 of file timeStamp.cpp.
|
inline |
|
inline |
|
inline |
void epics::pvData::TimeStamp::normalize | ( | ) |
adjust secondsPastEpoch and nanoseconds so that 0 <= nanoseconds < nanoSecPerSec
Definition at line 35 of file timeStamp.cpp.
bool epics::pvData::TimeStamp::operator!= | ( | TimeStamp const & | right | ) | const |
Standard C++ operator.
Definition at line 149 of file timeStamp.cpp.
TimeStamp & epics::pvData::TimeStamp::operator+= | ( | double | seconds | ) |
Standard C++ operator.
Definition at line 155 of file timeStamp.cpp.
TimeStamp & epics::pvData::TimeStamp::operator-= | ( | double | seconds | ) |
Standard C++ operator.
Definition at line 177 of file timeStamp.cpp.
bool epics::pvData::TimeStamp::operator< | ( | TimeStamp const & | right | ) | const |
bool epics::pvData::TimeStamp::operator<= | ( | TimeStamp const & | right | ) | const |
bool epics::pvData::TimeStamp::operator== | ( | TimeStamp const & | right | ) | const |
bool epics::pvData::TimeStamp::operator> | ( | TimeStamp const & | right | ) | const |
bool epics::pvData::TimeStamp::operator>= | ( | TimeStamp const & | right | ) | const |
Set time fields in timeStamp. Result will be normalized.
secondsPastEpoch | seconds part of timeStamp. |
nanoseconds | nanoseconds part of timeStamp. |
Definition at line 108 of file timeStamp.h.
void epics::pvData::TimeStamp::put | ( | int64 | milliseconds | ) |
Set time fields in timeStamp.
milliseconds | The number of milliseconds since the epoch. |
Definition at line 64 of file timeStamp.cpp.
|
inline |
double epics::pvData::TimeStamp::toSeconds | ( | ) | const |
Convert the timeStamp to a double value that is seconds past epoch.
Definition at line 79 of file timeStamp.cpp.
void epics::pvData::TimeStamp::toTime_t | ( | time_t & | time | ) | const |
Set time from timeStamp
time | time as defined by std::time |
Definition at line 56 of file timeStamp.cpp.