sipxportlib  Version 3.3
OsDateTimeWnt.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 
12 #ifndef _OsDateTimeWnt_h_
13 #define _OsDateTimeWnt_h_
14 
15 // SYSTEM INCLUDES
16 
17 // APPLICATION INCLUDES
18 #include "os/OsDefs.h"
19 #include "os/OsDateTime.h"
20 
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 // FORWARD DECLARATIONS
29 
30 //:DateTime management functions for Windows NT
32 {
33 /* //////////////////////////// PUBLIC //////////////////////////////////// */
34 public:
35 
36 /* ============================ CREATORS ================================== */
37 
38  OsDateTimeWnt();
39  //:Default constructor
40 
41  OsDateTimeWnt(const unsigned short year,
42  const unsigned char month,
43  const unsigned char day,
44  const unsigned char hour,
45  const unsigned char minute,
46  const unsigned char second,
47  const unsigned int microsecond);
48  //:Constructor
49 
50  OsDateTimeWnt(const OsDateTimeWnt& rOsDateTimeWnt);
51  //:Copy constructor
52 
54  OsDateTimeWnt(const OsTime& toTime);
55 
56  virtual
58  //:Destructor
59 
60 /* ============================ MANIPULATORS ============================== */
61 
63  //:Assignment operator
64 
65  static void setTime(struct timespec gmt, int tzOffsetSecs,
66  DstRule dstRule);
67  //:Set the system time. For now, this is a no-op for Windows platforms.
71 
72 
73  static void setTimeZone(int tzOffsetSecs, DstRule dstRule);
74  //:Set the time zone and daylight savings time information
77 
78 /* ============================ ACCESSORS ================================= */
79 
80  virtual OsStatus cvtToTimeSinceBoot(OsTime& rTime) const;
81  //:Convert the OsDateTimeBase value to an OsTime value
82  // The OsTime value is relative to when the system was booted.
83 
84  static void getCurTime(OsDateTimeWnt& rDateTime);
85  //:Return the current time as an OsDateTime value
86 
87  static void getCurTime(OsTime& rTime);
88  //:Return the current time as an OsTime value
89 
90  static void getCurTimeSinceBoot(OsTime& rTime);
91  //:Return the current time as an OsTime value
92  // The OsTime value is relative to when the system was booted.
93 
94  static unsigned long getSecsSinceEpoch(void);
95  //:Current time as the number of seconds since midnight (0 hour) 01/01/70
96 
97 /* ============================ INQUIRY =================================== */
98 
99 /* //////////////////////////// PROTECTED ///////////////////////////////// */
100 protected:
101 
102 /* //////////////////////////// PRIVATE /////////////////////////////////// */
103 private:
104 
105 
106 };
107 
108 /* ============================ INLINE METHODS ============================ */
109 
110 #endif // _OsDateTimeWnt_h_
111 
static void setTimeZone(int tzOffsetSecs, DstRule dstRule)
param: (in) gmt - time relative to the beginning of 1970 (GMT) param: (in) tzOffsetSecs - local time ...
Definition: OsDateTimeWnt.cpp:156
static unsigned long getSecsSinceEpoch(void)
Definition: OsDateTimeWnt.cpp:338
Definition: OsDateTimeWnt.h:31
OsStatus
Definition: OsStatus.h:27
OsDateTimeWnt & operator=(const OsDateTimeWnt &rhs)
Definition: OsDateTimeWnt.cpp:136
OsDateTimeWnt()
Definition: OsDateTimeWnt.cpp:70
static void setTime(struct timespec gmt, int tzOffsetSecs, DstRule dstRule)
Definition: OsDateTimeWnt.cpp:149
static void getCurTimeSinceBoot(OsTime &rTime)
Definition: OsDateTimeWnt.cpp:323
virtual ~OsDateTimeWnt()
Definition: OsDateTimeWnt.cpp:127
DstRule
Definition: OsDateTime.h:59
Definition: OsTime.h:37
virtual OsStatus cvtToTimeSinceBoot(OsTime &rTime) const
param: (in) tzOffsetSecs - local time offset (seconds relative to GMT) param: (in) dstRule - daylight...
Definition: OsDateTimeWnt.cpp:165
Definition: OsDateTime.h:54
static void getCurTime(OsDateTimeWnt &rDateTime)
Definition: OsDateTimeWnt.cpp:306