This is Unofficial EPICS BASE Doxygen Site
osdTime.cpp File Reference
#include <cmath>
#include <ctime>
#include <climits>
#include <cstdio>
#include <windows.h>
#include <process.h>
#include "epicsTime.h"
#include "generalTimeSup.h"
#include "epicsTimer.h"
#include "errlog.h"
#include "epicsAssert.h"
#include "epicsThread.h"
+ Include dependency graph for osdTime.cpp:

Go to the source code of this file.

Classes

class  currentTime
 

Macros

#define VC_EXTRALEAN
 
#define STRICT
 
#define EPICS_EXPOSE_LIBCOM_MONOTONIC_PRIVATE
 
#define debugPrintf(argsInParen)
 
#define MAXLONGLONG   0x7fffffffffffffffLL
 
#define MINLONGLONG   ~0x7fffffffffffffffLL
 
#define STACK_SIZE_PARAM_IS_A_RESERVATION   0x00010000
 

Functions

void setThreadName (DWORD dwThreadID, LPCSTR szThreadName)
 
int osdTimeGetCurrent (epicsTimeStamp *pDest)
 
int epicsStdCall epicsTime_gmtime (const time_t *pAnsiTime, struct tm *pTM)
 Break down a time_t into a struct tm in the UTC timezone. More...
 
int epicsStdCall epicsTime_localtime (const time_t *pAnsiTime, struct tm *pTM)
 Break down a time_t into a struct tm in the local timezone. More...
 

Macro Definition Documentation

#define debugPrintf (   argsInParen)

Definition at line 44 of file osdTime.cpp.

#define EPICS_EXPOSE_LIBCOM_MONOTONIC_PRIVATE

Definition at line 33 of file osdTime.cpp.

#define MAXLONGLONG   0x7fffffffffffffffLL

Definition at line 54 of file osdTime.cpp.

#define MINLONGLONG   ~0x7fffffffffffffffLL

Definition at line 57 of file osdTime.cpp.

#define STACK_SIZE_PARAM_IS_A_RESERVATION   0x00010000

Definition at line 60 of file osdTime.cpp.

#define STRICT

Definition at line 26 of file osdTime.cpp.

#define VC_EXTRALEAN

Definition at line 25 of file osdTime.cpp.

Function Documentation

int epicsStdCall epicsTime_gmtime ( const time_t *  pAnsiTime,
struct tm *  pTM 
)

Break down a time_t into a struct tm in the UTC timezone.

Definition at line 128 of file osdTime.cpp.

129 {
130  struct tm * pRet = gmtime ( pAnsiTime );
131  if ( pRet ) {
132  *pTM = *pRet;
133  return epicsTimeOK;
134  }
135  else {
136  return errno;
137  }
138 }
#define epicsTimeOK
Success.
Definition: epicsTime.h:339
int epicsStdCall epicsTime_localtime ( const time_t *  pAnsiTime,
struct tm *  pTM 
)

Break down a time_t into a struct tm in the local timezone.

Definition at line 141 of file osdTime.cpp.

143 {
144  struct tm * pRet = localtime ( pAnsiTime );
145  if ( pRet ) {
146  *pTM = *pRet;
147  return epicsTimeOK;
148  }
149  else {
150  return errno;
151  }
152 }
#define epicsTimeOK
Success.
Definition: epicsTime.h:339
int osdTimeGetCurrent ( epicsTimeStamp pDest)

Definition at line 119 of file osdTime.cpp.

120 {
121  assert ( pCurrentTime );
122 
123  pCurrentTime->getCurrentTime ( *pDest );
124  return epicsTimeOK;
125 }
#define assert(exp)
Declare that a condition should be true.
Definition: epicsAssert.h:70
void getCurrentTime(epicsTimeStamp &dest)
Definition: osdTime.cpp:238
#define epicsTimeOK
Success.
Definition: epicsTime.h:339
void setThreadName ( DWORD  dwThreadID,
LPCSTR  szThreadName 
)

Definition at line 26 of file setThreadName.cpp.

27 {
28 #if _MSC_VER >= 1300 && defined ( _DEBUG )
29  typedef struct tagTHREADNAME_INFO
30  {
31  DWORD dwType; // must be 0x1000
32  LPCSTR szName; // pointer to name (in user addr space)
33  DWORD dwThreadID; // thread ID (-1=caller thread)
34  DWORD dwFlags; // reserved for future use, must be zero
35  } THREADNAME_INFO;
36  THREADNAME_INFO info;
37  info.dwType = 0x1000;
38  info.szName = szThreadName;
39  info.dwThreadID = dwThreadID;
40  info.dwFlags = 0;
41 
42  __try
43  {
44  RaiseException( 0x406D1388, 0,
45  sizeof(info)/sizeof(DWORD), (const ULONG_PTR*)&info );
46  }
47  __except(EXCEPTION_CONTINUE_EXECUTION)
48  {
49  }
50 #endif
51 }