summaryrefslogtreecommitdiff
path: root/doc/html/boost/date_time/time_duration.html
blob: 732404a8297dcb4b0d1d52022c651f988777c6e3 (plain)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class template time_duration</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../date_time/doxy.html#header.boost.date_time.time_duration_hpp" title="Header &lt;boost/date_time/time_duration.hpp&gt;">
<link rel="prev" href="second_clock.html" title="Class template second_clock">
<link rel="next" href="subsecond_duration.html" title="Class template subsecond_duration">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="second_clock.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.time_duration_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="subsecond_duration.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.date_time.time_duration"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template time_duration</span></h2>
<p>boost::date_time::time_duration &#8212; Represents some amount of elapsed time measure to a given resolution. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../date_time/doxy.html#header.boost.date_time.time_duration_hpp" title="Header &lt;boost/date_time/time_duration.hpp&gt;">boost/date_time/time_duration.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">,</span> <span class="keyword">typename</span> rep_type<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a> <span class="special">:</span>
  <span class="keyword">private</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">less_than_comparable</span><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">equality_comparable</span><span class="special">&lt;</span> <span class="identifier">T</span> <span class="special">&gt;</span> <span class="special">&gt;</span>
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="keyword">void</span>                              <a name="boost.date_time.time_duration.is_boost_date_idp516211264"></a><span class="identifier">_is_boost_date_time_duration</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">T</span>                                 <a name="boost.date_time.time_duration.duration_type"></a><span class="identifier">duration_type</span><span class="special">;</span>               
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span>                          <a name="boost.date_time.time_duration.traits_type"></a><span class="identifier">traits_type</span><span class="special">;</span>                 
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">day_type</span>                <a name="boost.date_time.time_duration.day_type"></a><span class="identifier">day_type</span><span class="special">;</span>                    
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">hour_type</span>               <a name="boost.date_time.time_duration.hour_type"></a><span class="identifier">hour_type</span><span class="special">;</span>                   
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">min_type</span>                <a name="boost.date_time.time_duration.min_type"></a><span class="identifier">min_type</span><span class="special">;</span>                    
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">sec_type</span>                <a name="boost.date_time.time_duration.sec_type"></a><span class="identifier">sec_type</span><span class="special">;</span>                    
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">fractional_seconds_type</span> <a name="boost.date_time.time_duration.fractional_seconds_type"></a><span class="identifier">fractional_seconds_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">tick_type</span>               <a name="boost.date_time.time_duration.tick_type"></a><span class="identifier">tick_type</span><span class="special">;</span>                   
  <span class="keyword">typedef</span> <span class="identifier">rep_type</span><span class="special">::</span><span class="identifier">impl_type</span>               <a name="boost.date_time.time_duration.impl_type"></a><span class="identifier">impl_type</span><span class="special">;</span>                   

  <span class="comment">// <a class="link" href="time_duration.html#boost.date_time.time_durationconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="time_duration.html#idp516263296-bb"><span class="identifier">time_duration</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="time_duration.html#idp516263584-bb"><span class="identifier">time_duration</span></a><span class="special">(</span><span class="identifier">hour_type</span><span class="special">,</span> <span class="identifier">min_type</span><span class="special">,</span> <span class="identifier">sec_type</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> 
                <span class="identifier">fractional_seconds_type</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="time_duration.html#idp516267200-bb"><span class="identifier">time_duration</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">rep_type</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="time_duration.html#idp516269648-bb"><span class="identifier">time_duration</span></a><span class="special">(</span><span class="identifier">special_values</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="time_duration.html#idp516278160-bb"><span class="identifier">time_duration</span></a><span class="special">(</span><span class="identifier">impl_type</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="time_duration.html#idp516219776-bb">public member functions</a></span>
  <span class="identifier">hour_type</span> <a class="link" href="time_duration.html#idp516220336-bb"><span class="identifier">hours</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">min_type</span> <a class="link" href="time_duration.html#idp516221776-bb"><span class="identifier">minutes</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">sec_type</span> <a class="link" href="time_duration.html#idp516223200-bb"><span class="identifier">seconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">sec_type</span> <a class="link" href="time_duration.html#idp516224640-bb"><span class="identifier">total_seconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">tick_type</span> <a class="link" href="time_duration.html#idp516226096-bb"><span class="identifier">total_milliseconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">tick_type</span> <a class="link" href="time_duration.html#idp516227568-bb"><span class="identifier">total_nanoseconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">tick_type</span> <a class="link" href="time_duration.html#idp516229040-bb"><span class="identifier">total_microseconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">fractional_seconds_type</span> <a class="link" href="time_duration.html#idp516230512-bb"><span class="identifier">fractional_seconds</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#idp516231968-bb"><span class="identifier">invert_sign</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="time_duration.html#idp516233088-bb"><span class="identifier">is_negative</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="time_duration.html#idp516234208-bb"><span class="keyword">operator</span><span class="special">&lt;</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="time_duration.html#idp516236464-bb"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#idp516238720-bb"><span class="keyword">operator</span><span class="special">-</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#idp516240864-bb"><span class="keyword">operator</span><span class="special">-</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#idp516242672-bb"><span class="keyword">operator</span><span class="special">+</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#idp516244480-bb"><span class="keyword">operator</span><span class="special">/</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#idp516246288-bb"><span class="keyword">operator</span><span class="special">-=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#idp516247824-bb"><span class="keyword">operator</span><span class="special">+=</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#idp516249360-bb"><span class="keyword">operator</span><span class="special">/=</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#idp516251216-bb"><span class="keyword">operator</span><span class="special">*</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#idp516253360-bb"><span class="keyword">operator</span><span class="special">*=</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">tick_type</span> <a class="link" href="time_duration.html#idp516254896-bb"><span class="identifier">ticks</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="time_duration.html#idp516256016-bb"><span class="identifier">is_special</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="time_duration.html#idp516257440-bb"><span class="identifier">is_pos_infinity</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="time_duration.html#idp516258864-bb"><span class="identifier">is_neg_infinity</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="time_duration.html#idp516260288-bb"><span class="identifier">is_not_a_date_time</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">impl_type</span> <a class="link" href="time_duration.html#idp516261712-bb"><span class="identifier">get_rep</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="time_duration.html#idp516270928-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="identifier">duration_type</span> <a class="link" href="time_duration.html#idp516271488-bb"><span class="identifier">unit</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="identifier">tick_type</span> <a class="link" href="time_duration.html#idp516272928-bb"><span class="identifier">ticks_per_second</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="identifier">time_resolutions</span> <a class="link" href="time_duration.html#idp516274368-bb"><span class="identifier">resolution</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="keyword">unsigned</span> <span class="keyword">short</span> <a class="link" href="time_duration.html#idp516275808-bb"><span class="identifier">num_fractional_digits</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp203958400"></a><h2>Description</h2>
<p>This class represents a standard set of capabilities for all counted time durations. Time duration implementations should derive from this class passing their type as the first template parameter. This design allows the subclass duration types to provide custom construction policies or other custom features not provided here.</p>
<p>
</p>
<div class="refsect2">
<a name="idp203959664"></a><h3>
<a name="boost.date_time.time_durationconstruct-copy-destruct"></a><code class="computeroutput">time_duration</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><a name="idp516263296-bb"></a><span class="identifier">time_duration</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><a name="idp516263584-bb"></a><span class="identifier">time_duration</span><span class="special">(</span><span class="identifier">hour_type</span> hours_in<span class="special">,</span> <span class="identifier">min_type</span> minutes_in<span class="special">,</span> 
              <span class="identifier">sec_type</span> seconds_in <span class="special">=</span> <span class="number">0</span><span class="special">,</span> 
              <span class="identifier">fractional_seconds_type</span> frac_sec_in <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><a name="idp516267200-bb"></a><span class="identifier">time_duration</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a><span class="special">&lt;</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">rep_type</span> <span class="special">&gt;</span> <span class="special">&amp;</span> other<span class="special">)</span><span class="special">;</span></pre>Construct from another <code class="computeroutput"><a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a></code> (Copy constructor) </li>
<li class="listitem">
<pre class="literallayout"><a name="idp516269648-bb"></a><span class="identifier">time_duration</span><span class="special">(</span><span class="identifier">special_values</span> sv<span class="special">)</span><span class="special">;</span></pre>Construct from special_values. </li>
<li class="listitem"><pre class="literallayout"><span class="keyword">explicit</span> <a name="idp516278160-bb"></a><span class="identifier">time_duration</span><span class="special">(</span><span class="identifier">impl_type</span> in<span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp203996096"></a><h3>
<a name="idp516219776-bb"></a><code class="computeroutput">time_duration</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">hour_type</span> <a name="idp516220336-bb"></a><span class="identifier">hours</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns number of hours in the duration. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">min_type</span> <a name="idp516221776-bb"></a><span class="identifier">minutes</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns normalized number of minutes. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">sec_type</span> <a name="idp516223200-bb"></a><span class="identifier">seconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns normalized number of seconds (0..60) </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">sec_type</span> <a name="idp516224640-bb"></a><span class="identifier">total_seconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns total number of seconds truncating any fractional seconds. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">tick_type</span> <a name="idp516226096-bb"></a><span class="identifier">total_milliseconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns total number of milliseconds truncating any fractional seconds. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">tick_type</span> <a name="idp516227568-bb"></a><span class="identifier">total_nanoseconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns total number of nanoseconds truncating any sub millisecond values. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">tick_type</span> <a name="idp516229040-bb"></a><span class="identifier">total_microseconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns total number of microseconds truncating any sub microsecond values. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">fractional_seconds_type</span> <a name="idp516230512-bb"></a><span class="identifier">fractional_seconds</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns count of fractional seconds at given resolution. </li>
<li class="listitem"><pre class="literallayout"><span class="identifier">duration_type</span> <a name="idp516231968-bb"></a><span class="identifier">invert_sign</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idp516233088-bb"></a><span class="identifier">is_negative</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idp516234208-bb"></a><span class="keyword">operator</span><span class="special">&lt;</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">bool</span> <a name="idp516236464-bb"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a> <span class="special">&amp;</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">duration_type</span> <a name="idp516238720-bb"></a><span class="keyword">operator</span><span class="special">-</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>unary- Allows for <code class="computeroutput"><a class="link" href="time_duration.html" title="Class template time_duration">time_duration</a></code> td = -td1 </li>
<li class="listitem"><pre class="literallayout"><span class="identifier">duration_type</span> <a name="idp516240864-bb"></a><span class="keyword">operator</span><span class="special">-</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span> d<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">duration_type</span> <a name="idp516242672-bb"></a><span class="keyword">operator</span><span class="special">+</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span> d<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">duration_type</span> <a name="idp516244480-bb"></a><span class="keyword">operator</span><span class="special">/</span><span class="special">(</span><span class="keyword">int</span> divisor<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">duration_type</span> <a name="idp516246288-bb"></a><span class="keyword">operator</span><span class="special">-=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span> d<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">duration_type</span> <a name="idp516247824-bb"></a><span class="keyword">operator</span><span class="special">+=</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration_type</span> <span class="special">&amp;</span> d<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">duration_type</span> <a name="idp516249360-bb"></a><span class="keyword">operator</span><span class="special">/=</span><span class="special">(</span><span class="keyword">int</span> divisor<span class="special">)</span><span class="special">;</span></pre>Division operations on a duration with an integer. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">duration_type</span> <a name="idp516251216-bb"></a><span class="keyword">operator</span><span class="special">*</span><span class="special">(</span><span class="keyword">int</span> rhs<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Multiplication operations an a duration with an integer. </li>
<li class="listitem"><pre class="literallayout"><span class="identifier">duration_type</span> <a name="idp516253360-bb"></a><span class="keyword">operator</span><span class="special">*=</span><span class="special">(</span><span class="keyword">int</span> divisor<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">tick_type</span> <a name="idp516254896-bb"></a><span class="identifier">ticks</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idp516256016-bb"></a><span class="identifier">is_special</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Is ticks_ a special value? </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idp516257440-bb"></a><span class="identifier">is_pos_infinity</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Is duration pos-infinity. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idp516258864-bb"></a><span class="identifier">is_neg_infinity</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Is duration neg-infinity. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idp516260288-bb"></a><span class="identifier">is_not_a_date_time</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Is duration not-a-date-time. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">impl_type</span> <a name="idp516261712-bb"></a><span class="identifier">get_rep</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Used for special_values output. </li>
</ol></div>
</div>
<div class="refsect2">
<a name="idp204155312"></a><h3>
<a name="idp516270928-bb"></a><code class="computeroutput">time_duration</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">duration_type</span> <a name="idp516271488-bb"></a><span class="identifier">unit</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Returns smallest representable duration. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">tick_type</span> <a name="idp516272928-bb"></a><span class="identifier">ticks_per_second</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Return the number of ticks in a second. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="identifier">time_resolutions</span> <a name="idp516274368-bb"></a><span class="identifier">resolution</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Provide the resolution of this duration type. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">unsigned</span> <span class="keyword">short</span> <a name="idp516275808-bb"></a><span class="identifier">num_fractional_digits</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Returns number of possible digits in fractional seconds. </li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2005 CrystalClear Software, Inc<p>Subject to the Boost Software License, Version 1.0. (See accompanying file
    <code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="second_clock.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../date_time/doxy.html#header.boost.date_time.time_duration_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="subsecond_duration.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>