File: a00001.html

package info (click to toggle)
qpid-cpp 0.16-6%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 37,232 kB
  • sloc: cpp: 158,939; python: 8,947; sh: 6,701; ruby: 2,080; makefile: 1,838; cs: 1,774; ansic: 1,771; xml: 281; perl: 15; sed: 10
file content (349 lines) | stat: -rw-r--r-- 17,665 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
<!--
 
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
   http://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 
-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>qpid::sys::AbsTime Class Reference</title>
    <link href="doxygen.css" rel="stylesheet" type="text/css">
    <link href="tabs.css" rel="stylesheet" type="text/css">
  </head>
  <body bgcolor="#FFFFFF">
  <table border="0" width="90%" align="center">
    <tr>
      <td align="left">
	<a title="Apache Qpid Project Page" href="http://qpid.apache.org">Apache Qpid - AMQP Messaging for Java JMS, C++, Python, Ruby, and .NET</a>
      </td>

      <td align="right">	
	<a title="Apache Qpid Documentation" href="http://qpid.apache.org/documentation.html">Apache Qpid Documentation</a>
      </td>
    </tr>
  </table>

<!-- Generated by Doxygen 1.7.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00574.html">qpid</a>      </li>
      <li class="navelem"><a class="el" href="a00592.html">sys</a>      </li>
      <li class="navelem"><a class="el" href="a00001.html">AbsTime</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">qpid::sys::AbsTime Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="qpid::sys::AbsTime" -->
<p>Class to represent an instant in time.  
 <a href="a00001.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00563_source.html">qpid/sys/Time.h</a>&gt;</code></p>

<p><a href="a00893.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00001.html#acf3a166cb6df2d823a415d3c6ef2e137">AbsTime</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00001.html#a1e3f8ed571d1a9fd86a99788675af9c2">AbsTime</a> (const <a class="el" href="a00001.html">AbsTime</a> &amp;time0, const <a class="el" href="a00103.html">Duration</a> &amp;duration)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00001.html#a6ef078995d9a68036402a71e59607466">operator==</a> (const <a class="el" href="a00001.html">AbsTime</a> &amp;t) const </td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="a00001.html">AbsTime</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00001.html#a0ed4b5707126f2efe347ee9627d0ada7">now</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="a00001.html">AbsTime</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00001.html#af7016ce54c65f48a69eeb89e724cb9d4">FarFuture</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static <a class="el" href="a00001.html">AbsTime</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00001.html#a555e78f7c6826c7a4afabc5c9355b7de">Epoch</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00001.html#ab362ae8135e030b4c798ae7c022a4bdd">operator&lt;</a> (const <a class="el" href="a00001.html">AbsTime</a> &amp;a, const <a class="el" href="a00001.html">AbsTime</a> &amp;b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00001.html#ac51bbeb0df704f6ce1764e517bf0fbc6">operator&gt;</a> (const <a class="el" href="a00001.html">AbsTime</a> &amp;a, const <a class="el" href="a00001.html">AbsTime</a> &amp;b)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00243.html">std::ostream</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00001.html#a1ed078452bd3db4988f97830c7f60edd">operator&lt;&lt;</a> (<a class="el" href="a00243.html">std::ostream</a> &amp;, const <a class="el" href="a00001.html">AbsTime</a> &amp;)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Class to represent an instant in time. </p>
<p>The time resolution is in nanosecs, and this is held with 64 bits giving a total time span from about 25 million years ago to 25 million years hence. As an aside the internal time can sensibly be negative meaning before the epoch (probably 1/1/1970 although this class doesn't care).</p>
<p>The <a class="el" href="a00001.html" title="Class to represent an instant in time.">AbsTime</a> class is a value class and so you don't need to add any accessors to its internal state. If you think you want to replace its value, you need to construct a new <a class="el" href="a00001.html" title="Class to represent an instant in time.">AbsTime</a> and assign it, viz:</p>
<p><a class="el" href="a00001.html" title="Class to represent an instant in time.">AbsTime</a> when = <a class="el" href="a00001.html#a0ed4b5707126f2efe347ee9627d0ada7">now()</a>; ... when = AbsTime(when, 2*TIME_SEC); // Advance timer 2 secs</p>
<p><a class="el" href="a00001.html" title="Class to represent an instant in time.">AbsTime</a> is not intended to be used to represent calendar dates/times but you can construct a <a class="el" href="a00103.html" title="Class to represent the duration between instants of time.">Duration</a> since the Unix Epoch, 1970-1-1-00:00, so that you can convert to a date/time if needed:</p>
<p>int64_t nanosec_since_epoch = <a class="el" href="a00103.html" title="Class to represent the duration between instants of time.">Duration</a>(EPOCH, <a class="el" href="a00001.html#a0ed4b5707126f2efe347ee9627d0ada7">now()</a>);</p>
<p>There are some sensible operations that are currently missing from <a class="el" href="a00001.html" title="Class to represent an instant in time.">AbsTime</a>, but nearly all that's needed can be done with a mixture of AbsTimes and Durations.</p>
<p>For example, convenience operators to add a <a class="el" href="a00103.html" title="Class to represent the duration between instants of time.">Duration</a> and <a class="el" href="a00001.html" title="Class to represent an instant in time.">AbsTime</a> returning an <a class="el" href="a00001.html" title="Class to represent an instant in time.">AbsTime</a> would fit here (although you can already perform the operation with one of the <a class="el" href="a00001.html" title="Class to represent an instant in time.">AbsTime</a> constructors). However trying to add 2 AbsTimes doesn't make sense. </p>

<p>Definition at line <a class="el" href="a00563_source.html#l00044">44</a> of file <a class="el" href="a00563_source.html">Time.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="acf3a166cb6df2d823a415d3c6ef2e137"></a><!-- doxytag: member="qpid::sys::AbsTime::AbsTime" ref="acf3a166cb6df2d823a415d3c6ef2e137" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">qpid::sys::AbsTime::AbsTime </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="a00563_source.html#l00088">88</a> of file <a class="el" href="a00563_source.html">Time.h</a>.</p>

</div>
</div>
<a class="anchor" id="a1e3f8ed571d1a9fd86a99788675af9c2"></a><!-- doxytag: member="qpid::sys::AbsTime::AbsTime" ref="a1e3f8ed571d1a9fd86a99788675af9c2" args="(const AbsTime &amp;time0, const Duration &amp;duration)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">qpid::sys::AbsTime::AbsTime </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00001.html">AbsTime</a> &amp;&#160;</td>
          <td class="paramname"><em>time0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="a00103.html">Duration</a> &amp;&#160;</td>
          <td class="paramname"><em>duration</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a555e78f7c6826c7a4afabc5c9355b7de"></a><!-- doxytag: member="qpid::sys::AbsTime::Epoch" ref="a555e78f7c6826c7a4afabc5c9355b7de" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="a00001.html">AbsTime</a> qpid::sys::AbsTime::Epoch </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="af7016ce54c65f48a69eeb89e724cb9d4"></a><!-- doxytag: member="qpid::sys::AbsTime::FarFuture" ref="af7016ce54c65f48a69eeb89e724cb9d4" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="a00001.html">AbsTime</a> qpid::sys::AbsTime::FarFuture </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a0ed4b5707126f2efe347ee9627d0ada7"></a><!-- doxytag: member="qpid::sys::AbsTime::now" ref="a0ed4b5707126f2efe347ee9627d0ada7" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="a00001.html">AbsTime</a> qpid::sys::AbsTime::now </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Referenced by <a class="el" href="a00563_source.html#l00129">qpid::sys::now()</a>.</p>

</div>
</div>
<a class="anchor" id="a6ef078995d9a68036402a71e59607466"></a><!-- doxytag: member="qpid::sys::AbsTime::operator==" ref="a6ef078995d9a68036402a71e59607466" args="(const AbsTime &amp;t) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool qpid::sys::AbsTime::operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00001.html">AbsTime</a> &amp;&#160;</td>
          <td class="paramname"><em>t</em></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="a00563_source.html#l00097">97</a> of file <a class="el" href="a00563_source.html">Time.h</a>.</p>

</div>
</div>
<hr/><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="ab362ae8135e030b4c798ae7c022a4bdd"></a><!-- doxytag: member="qpid::sys::AbsTime::operator&lt;" ref="ab362ae8135e030b4c798ae7c022a4bdd" args="(const AbsTime &amp;a, const AbsTime &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool operator&lt; </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00001.html">AbsTime</a> &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="a00001.html">AbsTime</a> &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="a00563_source.html#l00131">131</a> of file <a class="el" href="a00563_source.html">Time.h</a>.</p>

</div>
</div>
<a class="anchor" id="a1ed078452bd3db4988f97830c7f60edd"></a><!-- doxytag: member="qpid::sys::AbsTime::operator&lt;&lt;" ref="a1ed078452bd3db4988f97830c7f60edd" args="(std::ostream &amp;, const AbsTime &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="a00243.html">std::ostream</a>&amp; operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="a00243.html">std::ostream</a> &amp;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="a00001.html">AbsTime</a> &amp;&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="ac51bbeb0df704f6ce1764e517bf0fbc6"></a><!-- doxytag: member="qpid::sys::AbsTime::operator&gt;" ref="ac51bbeb0df704f6ce1764e517bf0fbc6" args="(const AbsTime &amp;a, const AbsTime &amp;b)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool operator&gt; </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="a00001.html">AbsTime</a> &amp;&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="a00001.html">AbsTime</a> &amp;&#160;</td>
          <td class="paramname"><em>b</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [friend]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="a00563_source.html#l00133">133</a> of file <a class="el" href="a00563_source.html">Time.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>qpid/sys/<a class="el" href="a00563_source.html">Time.h</a></li>
</ul>
</div>
<!--
 
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at
 
   http://www.apache.org/licenses/LICENSE-2.0
 
 Unless required by applicable law or agreed to in writing,
 software distributed under the License is distributed on an
 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
 specific language governing permissions and limitations
 under the License.
 
-->

<hr size="1">
<address style="text-align: left;"><small>
Qpid C++ API Reference</small></address>

<address style="text-align: right;">
<small>
Generated on Thu May 10 2012 for Qpid C++ Client API by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.5</small>
</address>
</body>
</html>