EPICS Base
7.0.6.1
|
C++ time stamp object. More...
#include <epicsTime.h>
Public Types | |
typedef std::runtime_error | unableToFetchCurrentTime |
Exception: Time provider problem. | |
typedef std::logic_error | formatProblemWithStructTM |
Exception: Bad field(s) in struct tm | |
Public Member Functions | |
epicsTime () | |
The default constructor sets the time to the EPICS epoch. | |
size_t | strftime (char *pBuff, size_t bufLength, const char *pFormat) const |
Convert to string in user-specified format. More... | |
void | show (unsigned interestLevel) const |
Dump current state to standard out. | |
epicsTimeStamp conversions | |
Convert to and from EPICS epicsTimeStamp format | |
operator const epicsTimeStamp & () const | |
Convert to epicsTimeStamp. | |
epicsTime (const epicsTimeStamp &replace) | |
Construct from epicsTimeStamp. | |
epicsTime & | operator= (const epicsTimeStamp &replace) |
Assign from epicsTimeStamp. | |
ANSI C time_t conversions | |
Convert to and from ANSI C | |
operator time_t_wrapper () const | |
Convert to ANSI C time_t . | |
epicsTime (const time_t_wrapper &replace) | |
Construct from ANSI C time_t . | |
epicsTime & | operator= (const time_t_wrapper &replace) |
Assign from ANSI C time_t . | |
ANSI C struct tm local-time conversions | |
Convert to and from ANSI Cs | |
operator local_tm_nano_sec () const | |
Convert to struct tm in local time zone. | |
epicsTime (const local_tm_nano_sec &replace) | |
Construct from struct tm in local time zone. | |
epicsTime & | operator= (const local_tm_nano_sec &replace) |
Assign from struct tm in local time zone. | |
ANSI C struct tm UTC conversions | |
Convert to and from ANSI Cs | |
operator gm_tm_nano_sec () const | |
Convert to struct tm in UTC/GMT. | |
epicsTime (const gm_tm_nano_sec &replace) | |
Construct from struct tm in UTC/GMT. | |
epicsTime & | operator= (const gm_tm_nano_sec &replace) |
Assign from struct tm in UTC. | |
POSIX RT struct timespec conversions | |
Convert to and from the POSIX RealTime | |
operator struct timespec () const | |
Convert to struct timespec | |
epicsTime (const struct timespec &replace) | |
Construct from struct timespec | |
epicsTime & | operator= (const struct timespec &replace) |
Assign from struct timespec | |
BSD's struct timeval conversions | |
Convert to and from the BSD | |
operator struct timeval () const | |
Convert to struct timeval | |
epicsTime (const struct timeval &replace) | |
Construct from struct timeval | |
epicsTime & | operator= (const struct timeval &replace) |
Assign from struct timeval | |
Arithmetic operators | |
Standard operators involving epicsTime objects and time differences which are always expressed as a | |
double | operator- (const epicsTime &other) const |
lhs minus rhs , in seconds | |
epicsTime | operator+ (double delta) const |
lhs plus rhs seconds | |
epicsTime | operator- (double delta) const |
lhs minus rhs seconds | |
epicsTime | operator+= (double delta) |
add rhs seconds to lhs | |
epicsTime | operator-= (double delta) |
subtract rhs seconds from lhs | |
Comparison operators | |
Standard comparisons between epicsTime objects. | |
bool | operator== (const epicsTime &other) const |
lhs equals rhs | |
bool | operator!= (const epicsTime &other) const |
lhs not equal to rhs | |
bool | operator<= (const epicsTime &other) const |
rhs no later than lhs | |
bool | operator< (const epicsTime &other) const |
lhs was before rhs | |
bool | operator>= (const epicsTime &other) const |
rhs not before lhs | |
bool | operator> (const epicsTime &other) const |
lhs was after rhs | |
Static Public Member Functions | |
static epicsTime | getEvent (const epicsTimeEvent &evt) |
Get time of event system event. More... | |
static epicsTime | getCurrent () |
Get current clock time. More... | |
static epicsTime | getMonotonic () |
Get current monotonic time. More... | |
Holds an EPICS time stamp, and provides conversion functions for both input and output from/to other types.
Definition at line 320 of file epicsTime.h.
|
inlinestatic |
Returns an epicsTime indicating when the associated event system event last occurred.
|
static |
Returns an epicsTime containing the current time. For example:
|
inlinestatic |
Returns an epicsTime containing the current monotonic time, an OS clock which never going backwards or jumping forwards. This time is has an undefined epoch, and is only useful for measuring time differences.
Definition at line 360 of file epicsTime.h.
|
inline |
This method extends the standard C library routine strftime(). See your OS documentation for details about the standard routine. The epicsTime method adds support for printing the fractional portion of the time. It searches the format string for the sequence %0nf
where n is the desired precision, and uses this format to convert the fractional seconds with the requested precision. For example:
This will print the current time in the format:
Definition at line 568 of file epicsTime.h.