File: classPassenger_1_1SystemTime.html

package info (click to toggle)
passenger 2.2.11debian-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 11,576 kB
  • ctags: 28,138
  • sloc: cpp: 66,323; ruby: 9,646; ansic: 2,425; python: 141; sh: 56; makefile: 29
file content (173 lines) | stat: -rw-r--r-- 14,246 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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Passenger: Passenger::SystemTime Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;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 class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespacePassenger.html">Passenger</a>::<a class="el" href="classPassenger_1_1SystemTime.html">SystemTime</a>
  </div>
</div>
<div class="contents">
<h1>Passenger::SystemTime Class Reference</h1><!-- doxytag: class="Passenger::SystemTime" -->This class allows one to obtain the system time, similar to time() and gettimeofday().  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="SystemTime_8h-source.html">SystemTime.h</a>&gt;</code>
<p>

<p>
<a href="classPassenger_1_1SystemTime-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static time_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1SystemTime.html#d643b3e5748ee929e013517e6aca046c">get</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the time since the Epoch, measured in seconds.  <a href="#d643b3e5748ee929e013517e6aca046c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static unsigned long long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1SystemTime.html#7573bebcacde25571ee1072b046a21a6">getMsec</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the time since the Epoch, measured in milliseconds.  <a href="#7573bebcacde25571ee1072b046a21a6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static unsigned long long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1SystemTime.html#4e7110f4fb3fa2bfd646608f0ae8249d">getUsec</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the time since the Epoch, measured in microseconds.  <a href="#4e7110f4fb3fa2bfd646608f0ae8249d"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e15eaa6cdbbf8ab91ff740a0ca8ad57b"></a><!-- doxytag: member="Passenger::SystemTime::force" ref="e15eaa6cdbbf8ab91ff740a0ca8ad57b" args="(time_t value)" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1SystemTime.html#e15eaa6cdbbf8ab91ff740a0ca8ad57b">force</a> (time_t value)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Force <a class="el" href="classPassenger_1_1SystemTime.html#d643b3e5748ee929e013517e6aca046c" title="Returns the time since the Epoch, measured in seconds.">get()</a> to return the given value. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="76e60fd47ab1f675650b1132b7c10c4c"></a><!-- doxytag: member="Passenger::SystemTime::forceMsec" ref="76e60fd47ab1f675650b1132b7c10c4c" args="(unsigned long long value)" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1SystemTime.html#76e60fd47ab1f675650b1132b7c10c4c">forceMsec</a> (unsigned long long value)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Force <a class="el" href="classPassenger_1_1SystemTime.html#7573bebcacde25571ee1072b046a21a6" title="Returns the time since the Epoch, measured in milliseconds.">getMsec()</a> to return the given value. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="6d4c44acefc39a576ec3f9e628c88ca5"></a><!-- doxytag: member="Passenger::SystemTime::forceUsec" ref="6d4c44acefc39a576ec3f9e628c88ca5" args="(unsigned long long value)" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1SystemTime.html#6d4c44acefc39a576ec3f9e628c88ca5">forceUsec</a> (unsigned long long value)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Force <a class="el" href="classPassenger_1_1SystemTime.html#4e7110f4fb3fa2bfd646608f0ae8249d" title="Returns the time since the Epoch, measured in microseconds.">getUsec()</a> to return the given value. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="aa31ee319abe639741327a535c6d22fd"></a><!-- doxytag: member="Passenger::SystemTime::release" ref="aa31ee319abe639741327a535c6d22fd" args="()" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1SystemTime.html#aa31ee319abe639741327a535c6d22fd">release</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Release the previously forced seconds value, so that <a class="el" href="classPassenger_1_1SystemTime.html#d643b3e5748ee929e013517e6aca046c" title="Returns the time since the Epoch, measured in seconds.">get()</a> returns the system time once again. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="0177ab20f22dca37889261aebbe6519d"></a><!-- doxytag: member="Passenger::SystemTime::releaseMsec" ref="0177ab20f22dca37889261aebbe6519d" args="()" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1SystemTime.html#0177ab20f22dca37889261aebbe6519d">releaseMsec</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Release the previously forced msec value, so that <a class="el" href="classPassenger_1_1SystemTime.html#7573bebcacde25571ee1072b046a21a6" title="Returns the time since the Epoch, measured in milliseconds.">getMsec()</a> returns the system time once again. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e087e2d9503dea21b60d581e4369b235"></a><!-- doxytag: member="Passenger::SystemTime::releaseUsec" ref="e087e2d9503dea21b60d581e4369b235" args="()" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1SystemTime.html#e087e2d9503dea21b60d581e4369b235">releaseUsec</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Release the previously forced usec value, so that <a class="el" href="classPassenger_1_1SystemTime.html#4e7110f4fb3fa2bfd646608f0ae8249d" title="Returns the time since the Epoch, measured in microseconds.">getUsec()</a> returns the system time once again. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="72a1636723f21458d8ba3b504cd56ea9"></a><!-- doxytag: member="Passenger::SystemTime::releaseAll" ref="72a1636723f21458d8ba3b504cd56ea9" args="()" -->
static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPassenger_1_1SystemTime.html#72a1636723f21458d8ba3b504cd56ea9">releaseAll</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Release all previously forced values, so that <a class="el" href="classPassenger_1_1SystemTime.html#d643b3e5748ee929e013517e6aca046c" title="Returns the time since the Epoch, measured in seconds.">get()</a>, <a class="el" href="classPassenger_1_1SystemTime.html#7573bebcacde25571ee1072b046a21a6" title="Returns the time since the Epoch, measured in milliseconds.">getMsec()</a> and <a class="el" href="classPassenger_1_1SystemTime.html#4e7110f4fb3fa2bfd646608f0ae8249d" title="Returns the time since the Epoch, measured in microseconds.">getUsec()</a> return the system time once again. <br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
This class allows one to obtain the system time, similar to time() and gettimeofday(). 
<p>
Unlike time(), it is possible to force a certain time to be returned, which is useful for testing code that depends on the system time.<p>
<a class="el" href="classPassenger_1_1SystemTime.html#d643b3e5748ee929e013517e6aca046c" title="Returns the time since the Epoch, measured in seconds.">get()</a> provides seconds resolution while <a class="el" href="classPassenger_1_1SystemTime.html#7573bebcacde25571ee1072b046a21a6" title="Returns the time since the Epoch, measured in milliseconds.">getMsec()</a> provides milliseconds resolution. Both clocks can be independently forced to a certain value through <a class="el" href="classPassenger_1_1SystemTime.html#e15eaa6cdbbf8ab91ff740a0ca8ad57b" title="Force get() to return the given value.">force()</a> and <a class="el" href="classPassenger_1_1SystemTime.html#76e60fd47ab1f675650b1132b7c10c4c" title="Force getMsec() to return the given value.">forceMsec()</a>. <hr><h2>Member Function Documentation</h2>
<a class="anchor" name="d643b3e5748ee929e013517e6aca046c"></a><!-- doxytag: member="Passenger::SystemTime::get" ref="d643b3e5748ee929e013517e6aca046c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static time_t Passenger::SystemTime::get           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the time since the Epoch, measured in seconds. 
<p>
Or, if a time was forced with <a class="el" href="classPassenger_1_1SystemTime.html#e15eaa6cdbbf8ab91ff740a0ca8ad57b" title="Force get() to return the given value.">force()</a>, then the forced time is returned instead.<p>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classPassenger_1_1TimeRetrievalException.html" title="Unable to retrieve the system time using time().">TimeRetrievalException</a></em>&nbsp;</td><td>Something went wrong while retrieving the time. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>boost::thread_interrupted</em>&nbsp;</td><td></td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="7573bebcacde25571ee1072b046a21a6"></a><!-- doxytag: member="Passenger::SystemTime::getMsec" ref="7573bebcacde25571ee1072b046a21a6" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static unsigned long long Passenger::SystemTime::getMsec           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the time since the Epoch, measured in milliseconds. 
<p>
Or, if a time was forced with <a class="el" href="classPassenger_1_1SystemTime.html#76e60fd47ab1f675650b1132b7c10c4c" title="Force getMsec() to return the given value.">forceMsec()</a>, then the forced time is returned instead.<p>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classPassenger_1_1TimeRetrievalException.html" title="Unable to retrieve the system time using time().">TimeRetrievalException</a></em>&nbsp;</td><td>Something went wrong while retrieving the time. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>boost::thread_interrupted</em>&nbsp;</td><td></td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="4e7110f4fb3fa2bfd646608f0ae8249d"></a><!-- doxytag: member="Passenger::SystemTime::getUsec" ref="4e7110f4fb3fa2bfd646608f0ae8249d" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static unsigned long long Passenger::SystemTime::getUsec           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the time since the Epoch, measured in microseconds. 
<p>
Or, if a time was forced with <a class="el" href="classPassenger_1_1SystemTime.html#6d4c44acefc39a576ec3f9e628c88ca5" title="Force getUsec() to return the given value.">forceUsec()</a>, then the forced time is returned instead.<p>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classPassenger_1_1TimeRetrievalException.html" title="Unable to retrieve the system time using time().">TimeRetrievalException</a></em>&nbsp;</td><td>Something went wrong while retrieving the time. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>boost::thread_interrupted</em>&nbsp;</td><td></td></tr>
  </table>
</dl>

</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="SystemTime_8h-source.html">SystemTime.h</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Feb 8 22:53:23 2010 for Passenger by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>