File: ACE_Time_Value.3

package info (click to toggle)
ace 5.2.1-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 26,856 kB
  • ctags: 18,677
  • sloc: cpp: 171,831; makefile: 48,840; sh: 10,192; perl: 8,582; exp: 787; yacc: 387; lex: 140; csh: 20
file content (352 lines) | stat: -rw-r--r-- 9,852 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
.TH ACE_Time_Value 3 "1 Dec 2001" "ACE" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ACE_Time_Value \- Operations on "timeval" structures, which express time in <secs> and <usecs>. 
.SH SYNOPSIS
.br
.PP
\fC#include <OS.h>\fR
.PP
.SS Public Methods

.in +1c
.ti -1c
.RI "\fBACE_Time_Value\fR (void)"
.br
.RI "\fIDefault Constructor.\fR"
.ti -1c
.RI "\fBACE_Time_Value\fR (long sec, long usec = 0)"
.br
.RI "\fIConstructor.\fR"
.ti -1c
.RI "\fBACE_Time_Value\fR (const struct timeval &t)"
.br
.RI "\fIConstruct the  from a <timeval>.\fR"
.ti -1c
.RI "\fBACE_Time_Value\fR (const \fBtimespec_t\fR &t)"
.br
.RI "\fIInitializes the  object from a <timespec_t>.\fR"
.ti -1c
.RI "\fBACE_Time_Value\fR (const ACE_Time_Value &tv)"
.br
.RI "\fICopy constructor.\fR"
.ti -1c
.RI "\fBACE_Time_Value\fR (const FILETIME &ft)"
.br
.RI "\fIInitializes the ACE_Time_Value object from a Win32 FILETIME.\fR"
.ti -1c
.RI "void \fBset\fR (long sec, long usec)"
.br
.RI "\fIConstruct a <Time_Value> from two <long>s.\fR"
.ti -1c
.RI "void \fBset\fR (double d)"
.br
.RI "\fIConstruct a <Time_Value> from a <double>, which is assumed to be in second format, with any remainder treated as microseconds.\fR"
.ti -1c
.RI "void \fBset\fR (const timeval &t)"
.br
.RI "\fIConstruct a <Time_Value> from a <timeval>.\fR"
.ti -1c
.RI "void \fBset\fR (const \fBtimespec_t\fR &t)"
.br
.RI "\fIInitializes the <Time_Value> object from a <timespec_t>.\fR"
.ti -1c
.RI "void \fBset\fR (const FILETIME &ft)"
.br
.RI "\fIInitializes the <Time_Value> object from a <timespec_t>.\fR"
.ti -1c
.RI "long \fBmsec\fR (void) const"
.br
.RI "\fIConverts from <Time_Value> format into milli-seconds format.\fR"
.ti -1c
.RI "void \fBmsec\fR (long)"
.br
.RI "\fIConverts from milli-seconds format into <Time_Value> format.\fR"
.ti -1c
.RI "\fBoperator timespec_t\fR () const"
.br
.RI "\fIReturns the value of the object as a <timespec_t>.\fR"
.ti -1c
.RI "\fBoperator timeval\fR () const"
.br
.RI "\fIReturns the value of the object as a <timeval>.\fR"
.ti -1c
.RI "\fBoperator const timeval *\fR () const"
.br
.RI "\fIReturns a pointer to the object as a <timeval>.\fR"
.ti -1c
.RI "\fBoperator FILETIME\fR () const"
.br
.RI "\fIReturns the value of the object as a Win32 FILETIME.\fR"
.ti -1c
.RI "long \fBsec\fR (void) const"
.br
.RI "\fIGet seconds.\fR"
.ti -1c
.RI "void \fBsec\fR (long sec)"
.br
.RI "\fISet seconds.\fR"
.ti -1c
.RI "long \fBusec\fR (void) const"
.br
.RI "\fIGet microseconds.\fR"
.ti -1c
.RI "void \fBusec\fR (long usec)"
.br
.RI "\fISet microseconds.\fR"
.ti -1c
.RI "void \fBoperator+=\fR (const ACE_Time_Value &tv)"
.br
.RI "\fIAdd <tv> to this.\fR"
.ti -1c
.RI "void \fBoperator-=\fR (const ACE_Time_Value &tv)"
.br
.RI "\fISubtract <tv> to this.\fR"
.ti -1c
.RI "ACE_Time_Value& \fBoperator *=\fR (double d)"
.br
.RI "\fIMultiply the time value by the <d> factor, which must be >= 0.\fR"
.ti -1c
.RI "void \fBdump\fR (void) const"
.br
.RI "\fIDump the state of an object.\fR"
.in -1c
.SS Static Public Attributes

.in +1c
.ti -1c
.RI "const ACE_Time_Value \fBzero\fR"
.br
.RI "\fIConstant "0".\fR"
.ti -1c
.RI "const ACE_Time_Value \fBmax_time\fR"
.br
.ti -1c
.RI "const DWORDLONG \fBFILETIME_to_timval_skew\fR"
.br
.RI "\fIConst time difference between FILETIME and POSIX time.\fR"
.in -1c
.SS Private Methods

.in +1c
.ti -1c
.RI "void \fBnormalize\fR (void)"
.br
.RI "\fIPut the timevalue into a canonical form.\fR"
.in -1c
.SS Private Attributes

.in +1c
.ti -1c
.RI "timeval \fBtv_\fR"
.br
.RI "\fIStore the values as a <timeval>.\fR"
.in -1c
.SS Friends

.in +1c
.ti -1c
.RI "ACE_OS_Export ACE_Time_Value \fBoperator+\fR (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)"
.br
.RI "\fIAdds two ACE_Time_Value objects together, returns the sum.\fR"
.ti -1c
.RI "ACE_OS_Export ACE_Time_Value \fBoperator-\fR (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)"
.br
.RI "\fISubtracts two ACE_Time_Value objects, returns the difference.\fR"
.ti -1c
.RI "ACE_OS_Export int \fBoperator<\fR (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)"
.br
.RI "\fITrue if tv1 < tv2.\fR"
.ti -1c
.RI "ACE_OS_Export int \fBoperator>\fR (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)"
.br
.RI "\fITrue if tv1 > tv2.\fR"
.ti -1c
.RI "ACE_OS_Export int \fBoperator<=\fR (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)"
.br
.RI "\fITrue if tv1 <= tv2.\fR"
.ti -1c
.RI "ACE_OS_Export int \fBoperator>=\fR (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)"
.br
.RI "\fITrue if tv1 >= tv2.\fR"
.ti -1c
.RI "ACE_OS_Export int \fBoperator==\fR (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)"
.br
.RI "\fITrue if tv1 == tv2.\fR"
.ti -1c
.RI "ACE_OS_Export int \fBoperator!=\fR (const ACE_Time_Value &tv1, const ACE_Time_Value &tv2)"
.br
.RI "\fITrue if tv1 != tv2.\fR"
.in -1c
.SH DETAILED DESCRIPTION
.PP 
Operations on "timeval" structures, which express time in <secs> and <usecs>.
.PP
.PP
 This class centralizes all the time related processing in \fBACE\fR. These timers are typically used in conjunction with OS mechanisms like <select>, <poll>, or <cond_timedwait>.  makes the use of these mechanisms portable across OS platforms, 
.PP
.SH CONSTRUCTOR & DESTRUCTOR DOCUMENTATION
.PP 
.SS ACE_Time_Value::ACE_Time_Value (void)
.PP
Default Constructor.
.PP
.SS ACE_Time_Value::ACE_Time_Value (long sec, long usec = 0)
.PP
Constructor.
.PP
.SS ACE_Time_Value::ACE_Time_Value (const struct timeval & t)
.PP
Construct the  from a <timeval>.
.PP
.SS ACE_Time_Value::ACE_Time_Value (const \fBtimespec_t\fR & t)
.PP
Initializes the  object from a <timespec_t>.
.PP
.SS ACE_Time_Value::ACE_Time_Value (const ACE_Time_Value & tv)
.PP
Copy constructor.
.PP
.SS ACE_Time_Value::ACE_Time_Value (const FILETIME & ft)
.PP
Initializes the ACE_Time_Value object from a Win32 FILETIME.
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.PP 
.SS void ACE_Time_Value::dump (void) const
.PP
Dump the state of an object.
.PP
.SS void ACE_Time_Value::msec (long)
.PP
Converts from milli-seconds format into <Time_Value> format.
.PP
.SS long ACE_Time_Value::msec (void) const
.PP
Converts from <Time_Value> format into milli-seconds format.
.PP
.SS void ACE_Time_Value::normalize (void)\fC [private]\fR
.PP
Put the timevalue into a canonical form.
.PP
.SS ACE_Time_Value & ACE_Time_Value::operator *= (double d)
.PP
Multiply the time value by the <d> factor, which must be >= 0.
.PP
.SS ACE_Time_Value::operator FILETIME () const
.PP
Returns the value of the object as a Win32 FILETIME.
.PP
.SS ACE_Time_Value::operator const timeval * () const
.PP
Returns a pointer to the object as a <timeval>.
.PP
.SS ACE_Time_Value::operator \fBtimespec_t\fR () const
.PP
Returns the value of the object as a <timespec_t>.
.PP
.SS ACE_Time_Value::operator timeval () const
.PP
Returns the value of the object as a <timeval>.
.PP
.SS void ACE_Time_Value::operator+= (const ACE_Time_Value & tv)
.PP
Add <tv> to this.
.PP
.SS void ACE_Time_Value::operator-= (const ACE_Time_Value & tv)
.PP
Subtract <tv> to this.
.PP
.SS void ACE_Time_Value::sec (long sec)
.PP
Set seconds.
.PP
.SS long ACE_Time_Value::sec (void) const
.PP
Get seconds.
.PP
.SS void ACE_Time_Value::set (const FILETIME & ft)
.PP
Initializes the <Time_Value> object from a <timespec_t>.
.PP
.SS void ACE_Time_Value::set (const \fBtimespec_t\fR & t)
.PP
Initializes the <Time_Value> object from a <timespec_t>.
.PP
.SS void ACE_Time_Value::set (const timeval & t)
.PP
Construct a <Time_Value> from a <timeval>.
.PP
.SS void ACE_Time_Value::set (double d)
.PP
Construct a <Time_Value> from a <double>, which is assumed to be in second format, with any remainder treated as microseconds.
.PP
.SS void ACE_Time_Value::set (long sec, long usec)
.PP
Construct a <Time_Value> from two <long>s.
.PP
.SS void ACE_Time_Value::usec (long usec)
.PP
Set microseconds.
.PP
.SS long ACE_Time_Value::usec (void) const
.PP
Get microseconds.
.PP
.SH FRIENDS AND RELATED FUNCTION DOCUMENTATION
.PP 
.SS ACE_OS_Export int operator!= (const ACE_Time_Value & tv1, const ACE_Time_Value & tv2)\fC [friend]\fR
.PP
True if tv1 != tv2.
.PP
.SS ACE_OS_Export ACE_Time_Value operator+ (const ACE_Time_Value & tv1, const ACE_Time_Value & tv2)\fC [friend]\fR
.PP
Adds two ACE_Time_Value objects together, returns the sum.
.PP
.SS ACE_OS_Export ACE_Time_Value operator- (const ACE_Time_Value & tv1, const ACE_Time_Value & tv2)\fC [friend]\fR
.PP
Subtracts two ACE_Time_Value objects, returns the difference.
.PP
.SS ACE_OS_Export int operator< (const ACE_Time_Value & tv1, const ACE_Time_Value & tv2)\fC [friend]\fR
.PP
True if tv1 < tv2.
.PP
.SS ACE_OS_Export int operator<= (const ACE_Time_Value & tv1, const ACE_Time_Value & tv2)\fC [friend]\fR
.PP
True if tv1 <= tv2.
.PP
.SS ACE_OS_Export int operator== (const ACE_Time_Value & tv1, const ACE_Time_Value & tv2)\fC [friend]\fR
.PP
True if tv1 == tv2.
.PP
.SS ACE_OS_Export int operator> (const ACE_Time_Value & tv1, const ACE_Time_Value & tv2)\fC [friend]\fR
.PP
True if tv1 > tv2.
.PP
.SS ACE_OS_Export int operator>= (const ACE_Time_Value & tv1, const ACE_Time_Value & tv2)\fC [friend]\fR
.PP
True if tv1 >= tv2.
.PP
.SH MEMBER DATA DOCUMENTATION
.PP 
.SS const DWORDLONG ACE_Time_Value::FILETIME_to_timval_skew\fC [static]\fR
.PP
Const time difference between FILETIME and POSIX time.
.PP
.SS const ACE_Time_Value ACE_Time_Value::max_time\fC [static]\fR
.PP
Constant for maximum time representable. Note that this time is not intended for use with <select> or other calls that may have *their own* implementation-specific maximum time representations. Its primary use is in time computations such as those used by the dynamic subpriority strategies in the  class. 
.SS timeval ACE_Time_Value::tv_\fC [private]\fR
.PP
Store the values as a <timeval>.
.PP
.SS const ACE_Time_Value ACE_Time_Value::zero\fC [static]\fR
.PP
Constant "0".
.PP


.SH AUTHOR
.PP 
Generated automatically by Doxygen for ACE from the source code.