From c986b9045089eb9439d6449167d05db184a99cba Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Mon, 3 May 1999 16:06:36 +0000 Subject: [PATCH] added osiTime.cc --- src/libCom/Makefile.Host | 1 + src/libCom/osiTime.cc | 41 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/libCom/osiTime.cc diff --git a/src/libCom/Makefile.Host b/src/libCom/Makefile.Host index 47837e03d..af7c7f559 100644 --- a/src/libCom/Makefile.Host +++ b/src/libCom/Makefile.Host @@ -86,6 +86,7 @@ LIBSRCS += osiSleep.c # LIBSRCS += $(patsubst %,fdManager.cc,$(strip $(CPLUSPLUS))) LIBSRCS += $(patsubst %,osiTimer.cc,$(strip $(CPLUSPLUS))) +LIBSRCS += $(patsubst %,osiTime.cc,$(strip $(CPLUSPLUS))) LIBSRCS += $(patsubst %,osdTime.cc,$(strip $(CPLUSPLUS))) # WIN32 has no getopt, we add it to the Com lib, diff --git a/src/libCom/osiTime.cc b/src/libCom/osiTime.cc new file mode 100644 index 000000000..7873061ce --- /dev/null +++ b/src/libCom/osiTime.cc @@ -0,0 +1,41 @@ +// +// osiTime.cc +// +// Author: Jeff Hill +// + + +#define epicsExportSharedSymbols +// +// force this module to include code to convert to TS_STAMP +// +#include + +// +// force this module to include code that can convert +// to GDD's aitTimeStamp, but dont force it +// to link with gdd +// +#define aitHelpersInclude +class aitTimeStamp { +public: + aitTimeStamp (const unsigned long tv_secIn, const unsigned long tv_nsecIn) : + tv_sec(tv_secIn), tv_nsec(tv_nsecIn) {} + + void get(unsigned long &tv_secOut, unsigned long &tv_nsecOut) const + { + tv_secOut = this->tv_sec; + tv_nsecOut = this->tv_nsec; + } +private: + unsigned long tv_sec; + unsigned long tv_nsec; +}; + +#include + +// +// 1/1/90 20 yr (5 leap) of seconds +// +const unsigned osiTime::epicsEpochSecPast1970 = 7305 * 86400; +