7448 lines
946 KiB
HTML
7448 lines
946 KiB
HTML
<!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=UTF-8">
|
||
<title>Reference</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="../chrono.html" title="Chapter 7. Boost.Chrono 2.0.8">
|
||
<link rel="prev" href="users_guide.html" title="User's Guide">
|
||
<link rel="next" href="appendices.html" title="Appendices">
|
||
</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="users_guide.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../chrono.html"><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="appendices.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
||
<a name="chrono.reference"></a><a class="link" href="reference.html" title="Reference">Reference </a>
|
||
</h2></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.chrono_include_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">include</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x">Included on the C++11 Recommendation</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io_v1">Chrono I/O V1</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io">Chrono I/O V2</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.round">Chrono Rounding Utilities</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks">Other Clocks</a></span></dt>
|
||
</dl></div>
|
||
<p>
|
||
As <code class="computeroutput"><span class="keyword">constexpr</span></code> will not be supported
|
||
by some compilers, it is replaced in the code by <code class="computeroutput"><span class="identifier">BOOST_CONSTEXPR</span></code>
|
||
for <code class="computeroutput"><span class="keyword">constexpr</span></code> functions and <code class="computeroutput"><span class="identifier">BOOST_STATIC_CONSTEXPR</span></code> for struct/class static
|
||
fields. The same applies to <code class="computeroutput"><span class="identifier">noexecpt</span></code>
|
||
which is replaced by <code class="computeroutput"><span class="keyword">noexcept</span></code>
|
||
in the code.
|
||
</p>
|
||
<p>
|
||
The documentation doesn't use these macros.
|
||
</p>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h3 class="title">
|
||
<a name="chrono.reference.chrono_include_hpp"></a><a class="link" href="reference.html#chrono.reference.chrono_include_hpp" title="Header <boost/chrono/include.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">include</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h3></div></div></div>
|
||
<p>
|
||
Include all the chrono header files.
|
||
</p>
|
||
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">process_cpu_clocks</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">thread_clocks</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">ceil</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">floor</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">round</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h3 class="title">
|
||
<a name="chrono.reference.cpp0x"></a><a class="link" href="reference.html#chrono.reference.cpp0x" title="Included on the C++11 Recommendation">Included on the C++11 Recommendation</a>
|
||
</h3></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.chrono_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.duration_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">duration</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.clock"><code class="computeroutput"><span class="identifier">Clock</span></code>
|
||
Requirements</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.trivial_clock"><code class="computeroutput"><span class="identifier">TrivialClock</span></code> Requirements</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.ecclock"><code class="computeroutput"><span class="identifier">EcClock</span></code>
|
||
Requirements</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.time_point_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">time_point</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.system_clocks_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">system_clocks</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.clock_strings_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">clock_strings</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.chrono_typeof_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">typeof</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
</dl></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.cpp0x.chrono_hpp"></a><a class="link" href="reference.html#chrono.reference.cpp0x.chrono_hpp" title="Header <boost/chrono.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<p>
|
||
Include only the standard files.
|
||
</p>
|
||
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.cpp0x.chrono_chrono_hpp"></a><a class="link" href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp" title="Header <boost/chrono/chrono.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp.limitations">Limitations
|
||
and Extensions</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp.conf">Configuration
|
||
Macros</a></span></dt>
|
||
</dl></div>
|
||
<p>
|
||
Include only the standard files.
|
||
</p>
|
||
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">duration</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">time_point</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">system_clocks</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">typeof</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.chrono_chrono_hpp.limitations"></a><a class="link" href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp.limitations" title="Limitations and Extensions">Limitations
|
||
and Extensions</a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
At present, there is no know limitation respect to the C++11 standard.
|
||
</p>
|
||
<p>
|
||
The current implementation provides in addition:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
clock error handling as specified in <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3135.html#935" target="_top">clock
|
||
error handling needs to be specified</a>.
|
||
</li>
|
||
<li class="listitem">
|
||
process and thread clocks.
|
||
</li>
|
||
</ul></div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.chrono_chrono_hpp.conf"></a><a class="link" href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp.conf" title="Configuration Macros">Configuration
|
||
Macros</a>
|
||
</h5></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.chrono_chrono_hpp.conf.assert"></a><a class="link" href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp.conf.assert" title="How Assert Behaves?">How
|
||
Assert Behaves?</a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
When <code class="computeroutput"><span class="identifier">BOOST_NO_CXX11_STATIC_ASSERT</span></code>
|
||
is defined, the user can select the way static assertions are reported.
|
||
Define
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_USES_STATIC_ASSERT</span></code>:
|
||
define it if you want to use Boost.StaticAssert.
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_USES_MPL_ASSERT</span></code>:
|
||
define it if you want to use Boost.MPL static assertions.
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_USES_ARRAY_ASSERT</span></code>:
|
||
define it if you want to use internal static assertions.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
The default behavior is as <code class="computeroutput"><span class="identifier">BOOST_CHRONO_USES_ARRAY_ASSERT</span></code>
|
||
was defined.
|
||
</p>
|
||
<p>
|
||
When <code class="computeroutput"><span class="identifier">BOOST_CHRONO_USES_MPL_ASSERT</span></code>
|
||
is not defined the following symbols are defined as
|
||
</p>
|
||
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_A_DURATION_REPRESENTATION_CAN_NOT_BE_A_DURATION</span> <span class="special">\</span>
|
||
<span class="string">"A duration representation can not be a duration"</span>
|
||
<span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_DURATION_MUST_BE_A_STD_RATIO</span> <span class="special">\</span>
|
||
<span class="string">"Second template parameter of duration must be a boost::ratio"</span>
|
||
<span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_DURATION_PERIOD_MUST_BE_POSITIVE</span> <span class="special">\</span>
|
||
<span class="string">"duration period must be positive"</span>
|
||
<span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_SECOND_TEMPLATE_PARAMETER_OF_TIME_POINT_MUST_BE_A_BOOST_CHRONO_DURATION</span> <span class="special">\</span>
|
||
<span class="string">"Second template parameter of time_point must be a boost::chrono::duration"</span>
|
||
</pre>
|
||
<p>
|
||
Depending on the static assertion used system you will have an hint
|
||
of the failing assertion either through the symbol or through the text.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.chrono_chrono_hpp.conf.no_hybrid"></a><a class="link" href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp.conf.no_hybrid" title="Don't provide Hybrid Error Handling">Don't
|
||
provide Hybrid Error Handling</a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
When <code class="computeroutput"><span class="identifier">BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING</span></code>
|
||
is defined the lib doesn't provides the hybrid error handling prototypes:
|
||
</p>
|
||
<pre class="programlisting"><span class="identifier">Clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">(</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span><span class="special">&</span><span class="identifier">ec</span><span class="special">=</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">throws</span><span class="special">());</span>
|
||
</pre>
|
||
<p>
|
||
This allow to be closer to the standard and to avoid the Boost.System
|
||
dependency, making possible to have Boost.Chrono as a header-only library.
|
||
</p>
|
||
<p>
|
||
By default <code class="computeroutput"><span class="identifier">BOOST_CHRONO_PROVIDE_HYBRID_ERROR_HANDLING</span></code>
|
||
is defined.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.chrono_chrono_hpp.conf.header_only"></a><a class="link" href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp.conf.header_only" title="How to Build Boost.Chrono as a Header Only Library?">How
|
||
to Build Boost.Chrono as a Header Only Library?</a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
When <code class="computeroutput"><span class="identifier">BOOST_CHRONO_HEADER_ONLY</span></code>
|
||
is defined the lib is header-only.
|
||
</p>
|
||
<p>
|
||
If in addition <code class="computeroutput"><span class="identifier">BOOST_USE_WINDOWS_H</span></code>
|
||
is defined <code class="computeroutput"><span class="special"><</span><span class="identifier">windows</span><span class="special">.</span><span class="identifier">h</span><span class="special">></span></code> is included, otherwise files in
|
||
<code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">detail</span><span class="special">/</span><span class="identifier">win</span></code> are used to reduce the impact
|
||
of including <code class="computeroutput"><span class="special"><</span><span class="identifier">windows</span><span class="special">.</span><span class="identifier">h</span><span class="special">></span></code>.
|
||
</p>
|
||
<p>
|
||
However, you will either need to define <code class="computeroutput"><span class="identifier">BOOST_CHRONO_DONT_PROVIDE_HYBRID_ERROR_HANDLING</span></code>
|
||
or link with Boost.System.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.chrono_chrono_hpp.conf.deprecated_io"></a><a class="link" href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp.conf.deprecated_io" title="Deprecated IO">Deprecated
|
||
IO</a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
Version 2.0.0 deprecates the preceding IO features.
|
||
</p>
|
||
<p>
|
||
However the default version is always version 1. If you don't want
|
||
to include the deprecated features you could define <code class="computeroutput"><span class="identifier">BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section"><div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.chrono_chrono_hpp.conf.system_clock_time_point"></a><a class="link" href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp.conf.system_clock_time_point" title="time_point<system_clock,D> specialization limitation">time_point<system_clock,D>
|
||
specialization limitation</a>
|
||
</h6></div></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.chrono_chrono_hpp.conf.version"></a><a class="link" href="reference.html#chrono.reference.cpp0x.chrono_chrono_hpp.conf.version" title="Version">Version</a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_VERSION</span></code>
|
||
defines the Boost.Chrono version. The default version is 1. In this
|
||
case the following breaking or extending macros are defined if the
|
||
opposite is not requested:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0</span></code>
|
||
</li></ul></div>
|
||
<p>
|
||
The user can request the version 2 by defining <code class="computeroutput"><span class="identifier">BOOST_CHRONO_VERSION</span></code>
|
||
to 2. In this case the following breaking or extending macros are defined
|
||
if the opposite is not requested:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
Breaking change <code class="computeroutput"><span class="identifier">BOOST_CHRONO_DONT_PROVIDES_DEPRECATED_IO_SINCE_V2_0_0</span>
|
||
</code>
|
||
</li></ul></div>
|
||
<p>
|
||
The default value for <code class="computeroutput"><span class="identifier">BOOST_CHRONO_VERSION</span></code>
|
||
will be changed to 2 since Boost 1.55.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp" title="Header <boost/chrono/duration.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">duration</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.duration_hpp.traits">Time-related
|
||
Traits</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.duration_hpp.common_type_spe"><code class="computeroutput"><span class="identifier">common_type</span></code> Specialization</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.duration_hpp.duration">Class
|
||
Template <code class="computeroutput"><span class="identifier">duration</span><span class="special"><></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.duration_hpp.arith"><code class="computeroutput"><span class="identifier">duration</span></code> Non-Member Arithmetic</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp"><code class="computeroutput"><span class="identifier">duration</span></code> Non-Member Comparaisons</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_cast">Non-Member
|
||
Function <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special">(</span><span class="identifier">duration</span><span class="special">)</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs"><code class="computeroutput"><span class="identifier">duration</span></code> typedefs</a></span></dt>
|
||
</dl></div>
|
||
<p>
|
||
This file contains duration specific classes and non-member functions.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span> <span class="special">=</span> <code class="computeroutput"><span class="identifier">ratio</span></code><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="special">></span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">;</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.common_type_spe" title="common_type Specialization"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span>
|
||
<span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>;</span>
|
||
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="comment">// customization traits</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.treat_as_floating_point" title="Metafunction treat_as_floating_point<>"><code class="computeroutput"><span class="identifier">treat_as_floating_point</span></code></a><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span> <span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values" title="Class Template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a><span class="special">;</span>
|
||
|
||
<span class="comment">// duration arithmetic</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_plus_1" title="Non-Member Function operator+(duration,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">+</span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_minus_1" title="Non-Member Function operator-(duration,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_mult_1" title="Non-Member Function operator*(duration,Rep1)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">*</span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_mult_2" title="Non-Member Function operator*(Rep1,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">*</span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="identifier">duration</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_div_2" title="Non-Member Function operator/(duration,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">/</span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_div_3" title="Non-Member Function operator/(Rep1,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">/</span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_EXTENSIONS</span>
|
||
<span class="comment">// Used to get frequency of events</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">double</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_div_1" title="Non-Member Function operator/(duration,Rep2)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">/</span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
<span class="preprocessor">#endif</span>
|
||
|
||
<span class="comment">// duration comparisons</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp.duration__op_eq_1" title="Non-Member Function operator==(duration,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">==</span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp.duration__op_neq_1" title="Non-Member Function operator!=(duration,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">!=</span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">__duration__op_le_1</span><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp.duration__op_leq_1" title="Non-Member Function operator<=(duration,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special"><=</span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp.duration__op_gt_1" title="Non-Member Function operator>(duration,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">></span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp.duration__op_geq_1" title="Non-Member Function operator>=(duration,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">>=</span></code></a><span class="special">(</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="comment">// duration_cast</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">ToDuration</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="identifier">ToDuration</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_cast" title="Non-Member Function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
<span class="comment">// convenience typedefs</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">nano</span><span class="special">></span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a><span class="special">;</span> <span class="comment">// at least 64 bits needed</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">microseconds</span></code></a><span class="special">;</span> <span class="comment">// at least 55 bits needed</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">milliseconds</span></code></a><span class="special">;</span> <span class="comment">// at least 45 bits needed</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">></span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">seconds</span></code></a><span class="special">;</span> <span class="comment">// at least 35 bits needed</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span> <span class="number">60</span><span class="special">></span> <span class="special">></span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">minutes</span></code></a><span class="special">;</span> <span class="comment">// at least 29 bits needed</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">3600</span><span class="special">></span> <span class="special">></span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">hours</span></code></a><span class="special">;</span> <span class="comment">// at least 23 bits needed</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.traits"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits" title="Time-related Traits">Time-related
|
||
Traits</a>
|
||
</h5></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.traits.treat_as_floating_point"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.treat_as_floating_point" title="Metafunction treat_as_floating_point<>">Metafunction
|
||
<code class="computeroutput"><span class="identifier">treat_as_floating_point</span><span class="special"><></span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span> <span class="keyword">struct</span> <span class="identifier">treat_as_floating_point</span>
|
||
<span class="special">:</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">is_floating_point</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="special">{};</span>
|
||
</pre>
|
||
<p>
|
||
The <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> template uses the
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.treat_as_floating_point" title="Metafunction treat_as_floating_point<>"><code class="computeroutput"><span class="identifier">treat_as_floating_point</span></code></a> trait
|
||
to help determine if a <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> with one tick period
|
||
can be converted to another <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> with a different
|
||
tick period. If <code class="computeroutput"><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">>::</span><span class="identifier">value</span></code>
|
||
is <code class="computeroutput"><span class="keyword">true</span></code>, then <code class="computeroutput"><span class="identifier">Rep</span></code> is a floating-point type and
|
||
implicit conversions are allowed among <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>s. Otherwise, the
|
||
implicit convertibility depends on the tick periods of the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>s. If <code class="computeroutput"><span class="identifier">Rep</span></code> is a class type which emulates
|
||
a floating-point type, the author of <code class="computeroutput"><span class="identifier">Rep</span></code>
|
||
can specialize <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.treat_as_floating_point" title="Metafunction treat_as_floating_point<>"><code class="computeroutput"><span class="identifier">treat_as_floating_point</span></code></a> so
|
||
that <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> will treat this
|
||
<code class="computeroutput"><span class="identifier">Rep</span></code> as if it were a
|
||
floating-point type. Otherwise <code class="computeroutput"><span class="identifier">Rep</span></code>
|
||
is assumed to be an integral type, or a class emulating an integral
|
||
type.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.traits.duration_values"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values" title="Class Template duration_values">Class
|
||
Template <code class="computeroutput"><span class="identifier">duration_values</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">duration_values</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">Rep</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values.zero" title="Static Member Function zero()"><code class="computeroutput"><span class="identifier">zero</span></code></a><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">Rep</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values.max" title="Static Member Function max()"><code class="computeroutput"><span class="identifier">max</span></code></a><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">Rep</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values.min" title="Static Member Function min()"><code class="computeroutput"><span class="identifier">min</span></code></a><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
The <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> template uses the
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values" title="Class Template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a> trait to construct
|
||
special values of the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>'s representation
|
||
(<code class="computeroutput"><span class="identifier">Rep</span></code>). This is done
|
||
because the representation might be a class type with behavior which
|
||
requires some other implementation to return these special values.
|
||
In that case, the author of that class type should specialize <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values" title="Class Template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a> to return
|
||
the indicated values.
|
||
</p>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.traits.duration_values.zero"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values.zero" title="Static Member Function zero()">Static
|
||
Member Function <code class="computeroutput"><span class="identifier">zero</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">Rep</span> <span class="identifier">zero</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">Rep</span><span class="special">(</span><span class="number">0</span><span class="special">)</span></code>. <span class="bold"><strong>Note:</strong></span>
|
||
<code class="computeroutput"><span class="identifier">Rep</span><span class="special">(</span><span class="number">0</span><span class="special">)</span></code>
|
||
is specified instead of <code class="computeroutput"><span class="identifier">Rep</span><span class="special">()</span></code> since <code class="computeroutput"><span class="identifier">Rep</span><span class="special">()</span></code> may have some other meaning, such
|
||
as an uninitialized value.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Remarks:</strong></span> The value returned corresponds
|
||
to the additive identity.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.traits.duration_values.max"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values.max" title="Static Member Function max()">Static
|
||
Member Function <code class="computeroutput"><span class="identifier">max</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">Rep</span> <span class="identifier">max</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">numeric_limits</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">>::</span><span class="identifier">max</span><span class="special">()</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Remarks:</strong></span> The value returned compares
|
||
greater than zero().
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.traits.duration_values.min"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values.min" title="Static Member Function min()">Static
|
||
Member Function <code class="computeroutput"><span class="identifier">min</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">Rep</span> <span class="identifier">min</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">numeric_limits</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">>::</span><span class="identifier">lowest</span><span class="special">()</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Remarks:</strong></span> The value returned compares
|
||
less than or equal to <code class="computeroutput"><span class="identifier">zero</span><span class="special">()</span></code>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.common_type_spe"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.common_type_spe" title="common_type Specialization"><code class="computeroutput"><span class="identifier">common_type</span></code> Specialization</a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="emphasis"><em>see bellow</em></span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
The period of the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> indicated by this specialization
|
||
of <code class="computeroutput"><span class="identifier">common_type</span></code> is the
|
||
greatest common divisor of <code class="computeroutput"><span class="identifier">Period1</span></code>
|
||
and <code class="computeroutput"><span class="identifier">Period2</span></code>. This can
|
||
be computed by forming a <code class="computeroutput"><span class="identifier">ratio</span></code>
|
||
of the greatest common divisor of <code class="computeroutput"><span class="identifier">Period1</span><span class="special">::</span><span class="identifier">num</span></code>
|
||
and <code class="computeroutput"><span class="identifier">Period2</span><span class="special">::</span><span class="identifier">num</span></code>, and the least common multiple
|
||
of <code class="computeroutput"><span class="identifier">Period1</span><span class="special">::</span><span class="identifier">den</span></code> and <code class="computeroutput"><span class="identifier">Period2</span><span class="special">::</span><span class="identifier">den</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Note:</strong></span> The typedef type is the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> with the largest tick
|
||
period possible where both <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> arguments will convert
|
||
to it without requiring a division operation. The representation of this
|
||
type is intended to be able to hold any value resulting from this conversion,
|
||
with the possible exception of round-off error when floating-point <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>s are involved (but
|
||
not truncation error).
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>">Class
|
||
Template <code class="computeroutput"><span class="identifier">duration</span><span class="special"><></span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
A <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> measures time between
|
||
two points in time (<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>). A <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> has a representation
|
||
which holds a count of ticks, and a tick period. The tick period is the
|
||
amount of time which occurs from one tick to another in units of a second.
|
||
It is expressed as a rational constant using <code class="computeroutput"><span class="identifier">ratio</span></code>.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">duration</span> <span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">Rep</span> <span class="identifier">rep</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">Period</span> <span class="identifier">period</span><span class="special">;</span>
|
||
<span class="keyword">private</span><span class="special">:</span>
|
||
<span class="identifier">rep</span> <span class="identifier">rep_</span><span class="special">;</span> <span class="comment">// exposition only</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">constexpr</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.duration_c_0" title="Constructor duration()"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">();</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">explicit</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.duration_c_1" title="Constructor duration(const Rep2&)"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">r</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.duration_c_2" title="Constructor duration(const duration&)"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
<span class="identifier">duration</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
|
||
|
||
<span class="keyword">constexpr</span> <span class="identifier">rep</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.count" title="Member Function count() const"><code class="computeroutput"><span class="identifier">count</span></code></a><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">constexpr</span> <span class="identifier">duration</span> <span class="identifier">__duration__op_plus</span><span class="special">();</span>
|
||
<span class="keyword">constexpr</span> <span class="identifier">duration</span> <span class="identifier">__duration__op_minus</span><span class="special">();</span>
|
||
<span class="identifier">duration</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_pre_inc" title="Member Function operator++()"><code class="computeroutput"><span class="keyword">operator</span><span class="special">++</span></code></a><span class="special">();</span>
|
||
<span class="identifier">duration</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_post_inc" title="Member Function operator++(int)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">++</span></code></a><span class="special">(</span><span class="keyword">int</span><span class="special">);</span>
|
||
<span class="identifier">duration</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_pre_dec" title="Member Function operator--()"><code class="computeroutput"><span class="keyword">operator</span><span class="special">--</span></code></a><span class="special">();</span>
|
||
<span class="identifier">duration</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_post_dec" title="Member Function operator--(int)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">--</span></code></a><span class="special">(</span><span class="keyword">int</span><span class="special">);</span>
|
||
|
||
<span class="identifier">duration</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_plus_eq" title="Member Function operator+=(const duration&)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">+=</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
<span class="identifier">duration</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_minus_eq" title="Member Function operator-=(const duration&)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">-=</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
<span class="identifier">duration</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_mult_eq" title="Member Function operator*=(const rep&)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">*=</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="identifier">duration</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_div_eq" title="Member Function operator/=(const rep&)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">/=</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="identifier">duration</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_mod_eq" title="Member Function operator%=(const duration&)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">%=</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="identifier">duration</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_mod_eq2" title="Member Function operator%=(const rep&)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">%=</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">duration</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.zero" title="Static Member Function zero()"><code class="computeroutput"><span class="identifier">zero</span></code></a><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">duration</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.min" title="Static Member Function min()"><code class="computeroutput"><span class="identifier">min</span></code></a><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">duration</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.max" title="Static Member Function max()"><code class="computeroutput"><span class="identifier">max</span></code></a><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
|
||
<span class="special">}}</span>
|
||
</pre>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">Rep</span></code> must be an arithmetic
|
||
type, or a class emulating an arithmetic type, compile diagnostic otherwise.
|
||
If <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> is instantiated with
|
||
the type of <code class="computeroutput"><span class="identifier">Rep</span></code> being
|
||
a <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, compile diagnostic
|
||
is issued.
|
||
</p>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">Period</span></code> must be an instantiation
|
||
of <code class="computeroutput"><span class="identifier">ratio</span></code>, compile diagnostic
|
||
otherwise.
|
||
</p>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">Period</span><span class="special">::</span><span class="identifier">num</span></code> must be positive, compile diagnostic
|
||
otherwise.
|
||
</p>
|
||
<p>
|
||
Examples:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">long</span><span class="special">,</span> <code class="computeroutput"><span class="identifier">ratio</span></code><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="special">></span></code> holds a count of minutes using
|
||
a long.
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">long</span> <span class="keyword">long</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span></code> holds a count of milliseconds
|
||
using a long long.
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">double</span><span class="special">,</span>
|
||
<code class="computeroutput"><span class="identifier">ratio</span></code><span class="special"><</span><span class="number">1</span><span class="special">,</span> <span class="number">30</span><span class="special">></span> <span class="special">></span></code> holds a count using a double
|
||
with a tick period of 1/30 second (a tick frequency of 30 Hz).
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
The following members of <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> do not throw an exception
|
||
unless the indicated operations on the representations throw an exception.
|
||
</p>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.duration_c_0"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.duration_c_0" title="Constructor duration()">Constructor
|
||
<code class="computeroutput"><span class="identifier">duration</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">constexpr</span> <span class="identifier">duration</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs an object of type
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> initialized from
|
||
<code class="computeroutput"><span class="identifier">duration_values</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">zero</span><span class="special">()</span></code>
|
||
in C++98 or <code class="computeroutput"><span class="identifier">BOOST_CHRONO_DURATION_DEFAULTS_TO_ZERO</span></code>
|
||
is defined, otherwise the duration is uninitialized.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.duration_c_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.duration_c_1" title="Constructor duration(const Rep2&)">Constructor
|
||
<code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">explicit</span> <span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">r</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Remarks:</strong></span> <code class="computeroutput"><span class="identifier">Rep2</span></code>
|
||
is implicitly convertible to <code class="computeroutput"><span class="identifier">rep</span></code>,
|
||
and
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span></code>
|
||
is <code class="computeroutput"><span class="keyword">true</span></code>, or
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="special">!</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span>
|
||
<span class="special">&&</span> <span class="special">!</span><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">value</span></code> is <code class="computeroutput"><span class="keyword">true</span></code>.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
If these constraints are not met, this constructor will not participate
|
||
in overload resolution. <span class="bold"><strong>Note:</strong></span> This
|
||
requirement prevents construction of an integral-based <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> with a floating-point
|
||
representation. Such a construction could easily lead to confusion
|
||
about the value of the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Example:</strong></span>
|
||
</p>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">d</span><span class="special">(</span><span class="number">3.5</span><span class="special">);</span> <span class="comment">// do not compile</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">d</span><span class="special">(</span><span class="number">3</span><span class="special">);</span> <span class="comment">// ok</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs an object of type
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Post Conditions:</strong></span> <code class="computeroutput"><span class="identifier">count</span><span class="special">()</span> <span class="special">==</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>(</span><span class="identifier">r</span><span class="special">)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.duration_c_2"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.duration_c_2" title="Constructor duration(const duration&)">Constructor
|
||
<code class="computeroutput"><span class="identifier">duration</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Remarks:</strong></span> <code class="computeroutput"><span class="identifier">treat_as_floating_point</span><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">value</span></code>,
|
||
or <code class="computeroutput"><span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">Period2</span><span class="special">,</span>
|
||
<span class="identifier">period</span><span class="special">>::</span><span class="identifier">type</span><span class="special">::</span><span class="identifier">den</span> <span class="special">==</span>
|
||
<span class="number">1</span></code>, else this constructor will
|
||
not participate in overload resolution. <span class="bold"><strong>note</strong></span>
|
||
This requirement prevents implicit truncation error when converting
|
||
between integral-based <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>s. Such a construction
|
||
could easily lead to confusion about the value of the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Example:</strong></span>
|
||
</p>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">ms</span><span class="special">(</span><span class="number">3</span><span class="special">);</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <span class="identifier">us</span> <span class="special">=</span> <span class="identifier">ms</span><span class="special">;</span> <span class="comment">// ok</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">ms2</span> <span class="special">=</span> <span class="identifier">us</span><span class="special">;</span> <span class="comment">// do not compile</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs an object of type
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, constructing <code class="computeroutput"><span class="identifier">rep_</span></code> from <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">>(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.count"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.count" title="Member Function count() const">Member
|
||
Function <code class="computeroutput"><span class="identifier">count</span><span class="special">()</span>
|
||
<span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">constexpr</span> <span class="identifier">rep</span> <span class="identifier">count</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_unary_plus"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_unary_plus" title="Member Function operator+() const">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+()</span>
|
||
<span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">constexpr</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_unary_minus"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_unary_minus" title="Member Function operator-() const">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-()</span>
|
||
<span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">constexpr</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="keyword">operator</span><span class="special">-()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(-</span><span class="identifier">rep_</span><span class="special">)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_pre_inc"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_pre_inc" title="Member Function operator++()">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">++();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="special">++</span><span class="identifier">rep_</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_post_inc"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_post_inc" title="Member Function operator++(int)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><span class="identifier">rep_</span><span class="special">++)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_pre_dec"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_pre_dec" title="Member Function operator--()">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">--()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">--();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="special">--</span><span class="identifier">rep_</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_post_dec"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_post_dec" title="Member Function operator--(int)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">--(</span><span class="keyword">int</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="keyword">operator</span><span class="special">--(</span><span class="keyword">int</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><span class="identifier">rep_</span><span class="special">--)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_plus_eq"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_plus_eq" title="Member Function operator+=(const duration&)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
|
||
<span class="special">+=</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_minus_eq"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_minus_eq" title="Member Function operator-=(const duration&)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
|
||
<span class="special">-=</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_mod_eq"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_mod_eq" title="Member Function operator%=(const duration&)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
|
||
<span class="special">%=</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">()</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_mult_eq"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_mult_eq" title="Member Function operator*=(const rep&)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
|
||
<span class="special">*=</span> <span class="identifier">rhs</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_div_eq"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_div_eq" title="Member Function operator/=(const rep&)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
|
||
<span class="special">/=</span> <span class="identifier">rhs</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.op_mod_eq2"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.op_mod_eq2" title="Member Function operator%=(const rep&)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">%=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rep_</span>
|
||
<span class="special">%=</span> <span class="identifier">rhs</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.zero"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.zero" title="Static Member Function zero()">Static
|
||
Member Function <code class="computeroutput"><span class="identifier">zero</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="identifier">zero</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values" title="Class Template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">zero</span><span class="special">())</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.min"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.min" title="Static Member Function min()">Static
|
||
Member Function <code class="computeroutput"><span class="identifier">min</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="identifier">min</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values" title="Class Template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">min</span><span class="special">()).</span></code>
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration.max"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration.max" title="Static Member Function max()">Static
|
||
Member Function <code class="computeroutput"><span class="identifier">max</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">constexpr</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> <span class="identifier">max</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special">(</span><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values" title="Class Template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a><span class="special"><</span><span class="identifier">rep</span><span class="special">>::</span><span class="identifier">max</span><span class="special">())</span></code>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.arith"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith" title="duration Non-Member Arithmetic"><code class="computeroutput"><span class="identifier">duration</span></code> Non-Member Arithmetic</a>
|
||
</h5></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.arith.duration__op_plus_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_plus_1" title="Non-Member Function operator+(duration,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
|
||
<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">CD</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">())</span></code>
|
||
where <code class="computeroutput"><span class="identifier">CD</span></code> is the type
|
||
of the return value.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.arith.duration__op_minus_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_minus_1" title="Non-Member Function operator-(duration,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
|
||
<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special">-</span> <span class="identifier">CD</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">())</span></code>
|
||
where <code class="computeroutput"><span class="identifier">CD</span></code> is the type
|
||
of the return value.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.arith.duration__op_mult_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_mult_1" title="Non-Member Function operator*(duration,Rep1)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">Rep1</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Requires:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
|
||
represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
|
||
of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>. This function will not participate
|
||
in overload resolution unless both <code class="computeroutput"><span class="identifier">Rep1</span></code>
|
||
and <code class="computeroutput"><span class="identifier">Rep2</span></code> are implicitly
|
||
convertible to <code class="computeroutput"><span class="identifier">CR</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">CD</span><span class="special">(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special">*</span> <span class="identifier">s</span><span class="special">)</span></code>
|
||
where <code class="computeroutput"><span class="identifier">CD</span></code> is the type
|
||
of the return value.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.arith.duration__op_mult_2"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_mult_2" title="Non-Member Function operator*(Rep1,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">*(</span><span class="identifier">Rep1</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">operator</span><span class="special">*(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Requires:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
|
||
represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
|
||
of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>. This function will not participate
|
||
in overload resolution unless both <code class="computeroutput"><span class="identifier">Rep1</span></code>
|
||
and <code class="computeroutput"><span class="identifier">Rep2</span></code> are implicitly
|
||
convertible to <code class="computeroutput"><span class="identifier">CR</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">d</span>
|
||
<span class="special">*</span> <span class="identifier">s</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.arith.duration__op_div_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_div_1" title="Non-Member Function operator/(duration,Rep2)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">Rep2</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Requires:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
|
||
represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
|
||
of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>. This function will not participate
|
||
in overload resolution unless both <code class="computeroutput"><span class="identifier">Rep1</span></code>
|
||
and <code class="computeroutput"><span class="identifier">Rep2</span></code> are implicitly
|
||
convertible to <code class="computeroutput"><span class="identifier">CR</span></code>,
|
||
and <code class="computeroutput"><span class="identifier">Rep2</span></code> is not an
|
||
instantiation of <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">CD</span><span class="special">(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special">/</span> <span class="identifier">s</span><span class="special">)</span></code>
|
||
where <code class="computeroutput"><span class="identifier">CD</span></code> is the type
|
||
of the return value.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.arith.duration__op_div_2"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_div_2" title="Non-Member Function operator/(duration,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span>
|
||
<span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Remarks:</strong></span> Let <code class="computeroutput"><span class="identifier">CD</span></code>
|
||
represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
|
||
of the two <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> arguments. <span class="bold"><strong>Returns:</strong></span> Returns <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special">/</span> <span class="identifier">CD</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.arith.duration__op_div_3"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_div_3" title="Non-Member Function operator/(Rep1,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">/(</span><span class="identifier">Rep1</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
Included only if BOOST_CHRONO_EXTENSIONS is defined.
|
||
</p>
|
||
<p>
|
||
This overloading could be used to get the frequency of an event counted
|
||
by <code class="computeroutput"><span class="identifier">Rep1</span></code>.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">double</span> <span class="keyword">operator</span><span class="special">/(</span><span class="keyword">const</span> <span class="identifier">Rep1</span><span class="special">&</span> <span class="identifier">s</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Remarks:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
|
||
represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
|
||
of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>. This function will not participate
|
||
in overload resolution unless both <code class="computeroutput"><span class="identifier">Rep1</span></code>
|
||
and <code class="computeroutput"><span class="identifier">Rep2</span></code> are implicitly
|
||
convertible to <code class="computeroutput"><span class="identifier">CR</span></code>,
|
||
and <code class="computeroutput"><span class="identifier">Rep1</span></code> is not an
|
||
instantiation of <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. Let <code class="computeroutput"><span class="identifier">CD</span></code> represent <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><CR,Period>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CR</span><span class="special">(</span><span class="identifier">s</span><span class="special">)/</span><span class="identifier">CD</span><span class="special">(</span><span class="identifier">d</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code> where <code class="computeroutput"><span class="identifier">CD</span></code>
|
||
is the type of the return value.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.arith.duration__op_mod_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_mod_1" title="Non-Member Function operator%(duration,Rep2)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">Rep2</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Rep2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">operator</span><span class="special">%(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Rep2</span><span class="special">&</span> <span class="identifier">s</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Remarks:</strong></span> Let <code class="computeroutput"><span class="identifier">CR</span></code>
|
||
represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
|
||
of <code class="computeroutput"><span class="identifier">Rep1</span></code> and <code class="computeroutput"><span class="identifier">Rep2</span></code>. This function will not participate
|
||
in overload resolution unless Rep2 must be implicitly convertible to
|
||
CR and Rep2 must not be an instantiation of <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> CD(CD(d).count() % s) where
|
||
<code class="computeroutput"><span class="identifier">CD</span></code> is the type of the
|
||
return value.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.arith.duration__op_mod_2"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.arith.duration__op_mod_2" title="Non-Member Function operator%(duration,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">%(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span>
|
||
<span class="keyword">operator</span><span class="special">%(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Remarks:</strong></span> This function will not participate
|
||
in overload resolution unless
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> CD(CD(lhs).count() % CD(rhs).count())
|
||
where <code class="computeroutput"><span class="identifier">CD</span></code> is the type
|
||
of the return value.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.cmp"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp" title="duration Non-Member Comparaisons"><code class="computeroutput"><span class="identifier">duration</span></code> Non-Member Comparaisons</a>
|
||
</h5></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.cmp.duration__op_eq_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp.duration__op_eq_1" title="Non-Member Function operator==(duration,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">==(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> Let <code class="computeroutput"><span class="identifier">CD</span></code>
|
||
represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
|
||
of the two <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> arguments.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> Returns <code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">CD</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.cmp.duration__op_neq_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp.duration__op_neq_1" title="Non-Member Function operator!=(duration,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special">==</span>
|
||
<span class="identifier">rhs</span><span class="special">)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.cmp.duration__op_lt_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp.duration__op_lt_1" title="Non-Member Function operator<(duration,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> Let <code class="computeroutput"><span class="identifier">CD</span></code>
|
||
represent the <code class="computeroutput"><span class="identifier">common_type</span></code>
|
||
of the two <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> arguments. Returns
|
||
<code class="computeroutput"><span class="identifier">CD</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span>
|
||
<span class="special"><</span> <span class="identifier">CD</span><span class="special">(</span><span class="identifier">rhs</span><span class="special">).</span><span class="identifier">count</span><span class="special">()</span></code>
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.cmp.duration__op_leq_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp.duration__op_leq_1" title="Non-Member Function operator<=(duration,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">rhs</span> <span class="special"><</span>
|
||
<span class="identifier">lhs</span><span class="special">)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.cmp.duration__op_gt_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp.duration__op_gt_1" title="Non-Member Function operator>(duration,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">></span> <span class="special">(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">rhs</span>
|
||
<span class="special"><</span> <span class="identifier">lhs</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.cmp.duration__op_geq_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.cmp.duration__op_geq_1" title="Non-Member Function operator>=(duration,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special"><</span>
|
||
<span class="identifier">rhs</span><span class="special">)</span></code>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration_cast"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_cast" title="Non-Member Function duration_cast(duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="identifier">duration_cast</span><span class="special">(</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">ToDuration</span></code></a><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">ToDuration</span></code></a> <span class="identifier">duration_cast</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Requires:</strong></span> This function will not participate
|
||
in overload resolution unless <code class="computeroutput"><span class="identifier">ToDuration</span></code>
|
||
is an instantiation of <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> Forms <code class="computeroutput"><span class="identifier">CF</span></code>
|
||
which is a <code class="computeroutput"><span class="identifier">ratio</span></code> resulting
|
||
from <code class="computeroutput"><span class="identifier">ratio_divide</span><span class="special"><</span><span class="identifier">Period</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">period</span><span class="special">>::</span><span class="identifier">type</span></code>.
|
||
Let <code class="computeroutput"><span class="identifier">CR</span></code> be the <code class="computeroutput"><span class="identifier">common_type</span></code> of <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span></code>,
|
||
<code class="computeroutput"><span class="identifier">Rep</span></code>, and <code class="computeroutput"><span class="identifier">intmax_t</span></code>.
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
If <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">num</span> <span class="special">==</span>
|
||
<span class="number">1</span></code> and <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">den</span>
|
||
<span class="special">==</span> <span class="number">1</span></code>,
|
||
then returns <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">typename</span>
|
||
<span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span><span class="special">>(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">()))</span>
|
||
</code>
|
||
</li>
|
||
<li class="listitem">
|
||
else if <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">num</span> <span class="special">!=</span>
|
||
<span class="number">1</span></code> and <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">den</span>
|
||
<span class="special">==</span> <span class="number">1</span></code>,
|
||
then returns <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">typename</span>
|
||
<span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span><span class="special">>(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">())</span>
|
||
<span class="special">*</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">CF</span><span class="special">::</span><span class="identifier">num</span><span class="special">)))</span></code>
|
||
</li>
|
||
<li class="listitem">
|
||
else if <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">num</span> <span class="special">==</span>
|
||
<span class="number">1</span></code> and <code class="computeroutput"><span class="identifier">CF</span><span class="special">::</span><span class="identifier">den</span>
|
||
<span class="special">!=</span> <span class="number">1</span></code>,
|
||
then returns <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">typename</span>
|
||
<span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span><span class="special">>(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">())</span>
|
||
<span class="special">/</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">CF</span><span class="special">::</span><span class="identifier">den</span><span class="special">)))</span></code>
|
||
</li>
|
||
<li class="listitem">
|
||
else returns <code class="computeroutput"><span class="identifier">ToDuration</span><span class="special">(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="keyword">typename</span>
|
||
<span class="identifier">ToDuration</span><span class="special">::</span><span class="identifier">rep</span><span class="special">>(</span><span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">())</span>
|
||
<span class="special">*</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">CF</span><span class="special">::</span><span class="identifier">num</span><span class="special">)</span> <span class="special">/</span> <span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">CR</span><span class="special">>(</span><span class="identifier">CF</span><span class="special">::</span><span class="identifier">den</span><span class="special">)))</span></code>
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Remarks:</strong></span> This function does not rely
|
||
on any implicit conversions. All conversions must be accomplished through
|
||
<code class="computeroutput"><span class="keyword">static_cast</span></code>. The implementation
|
||
avoids all multiplications or divisions when it is known at compile-time
|
||
that it can be avoided because one or more arguments are <code class="computeroutput"><span class="number">1</span></code>. All intermediate computations are carried
|
||
out in the widest possible representation and only converted to the destination
|
||
representation at the final step.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.duration_hpp.duration_typedefs"></a><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">duration</span></code> typedefs</a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="comment">// convenience typedefs</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">nano</span><span class="special">></span> <span class="identifier">nanoseconds</span><span class="special">;</span> <span class="comment">// at least 64 bits needed</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">micro</span><span class="special">></span> <span class="identifier">microseconds</span><span class="special">;</span> <span class="comment">// at least 55 bits needed</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">,</span> <span class="identifier">milli</span><span class="special">></span> <span class="identifier">milliseconds</span><span class="special">;</span> <span class="comment">// at least 45 bits needed</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least64_t</span><span class="special">></span> <span class="identifier">seconds</span><span class="special">;</span> <span class="comment">// at least 35 bits needed</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <code class="computeroutput"><span class="identifier">ratio</span></code><span class="special"><</span> <span class="number">60</span><span class="special">></span> <span class="special">></span> <span class="identifier">minutes</span><span class="special">;</span> <span class="comment">// at least 29 bits needed</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">int_least32_t</span><span class="special">,</span> <code class="computeroutput"><span class="identifier">ratio</span></code><span class="special"><</span><span class="number">3600</span><span class="special">></span> <span class="special">></span> <span class="identifier">hours</span><span class="special">;</span> <span class="comment">// at least 23 bits needed</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.cpp0x.clock"></a><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code>
|
||
Requirements</a>
|
||
</h4></div></div></div>
|
||
<p>
|
||
A clock represents a bundle consisting of a <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, a <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>, and a function <code class="computeroutput"><span class="identifier">now</span><span class="special">()</span></code>
|
||
to get the current <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>. A clock must meet
|
||
the requirements in the following Table.
|
||
</p>
|
||
<p>
|
||
In this table <code class="computeroutput"><span class="identifier">C1</span></code> and <code class="computeroutput"><span class="identifier">C2</span></code> denote <code class="computeroutput"><span class="identifier">Clock</span></code>
|
||
types. <code class="computeroutput"><span class="identifier">t1</span></code> and <code class="computeroutput"><span class="identifier">t2</span></code> are values returned from <code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>
|
||
where the call returning <code class="computeroutput"><span class="identifier">t1</span></code>
|
||
happens before the call returning <code class="computeroutput"><span class="identifier">t2</span></code>
|
||
and both of these calls occur before <code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">::</span><span class="identifier">max</span><span class="special">()</span></code>. (note This means C1 did not wrap around
|
||
between t1 and t2.).
|
||
</p>
|
||
<div class="table">
|
||
<a name="chrono.reference.cpp0x.clock.clock_requirements"></a><p class="title"><b>Table 7.1. Clock Requirements</b></p>
|
||
<div class="table-contents"><table class="table" summary="Clock Requirements">
|
||
<colgroup>
|
||
<col>
|
||
<col>
|
||
<col>
|
||
</colgroup>
|
||
<thead><tr>
|
||
<th>
|
||
<p>
|
||
expression
|
||
</p>
|
||
</th>
|
||
<th>
|
||
<p>
|
||
return type
|
||
</p>
|
||
</th>
|
||
<th>
|
||
<p>
|
||
operational semantics
|
||
</p>
|
||
</th>
|
||
</tr></thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">rep</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
An arithmetic type or class emulating an arithmetic type.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The representation type of the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> and <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">period</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">ratio</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The tick period of the clock in seconds.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">duration</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">C1</span><span class="special">::</span><span class="identifier">rep</span><span class="special">,</span>
|
||
<span class="identifier">C1</span><span class="special">::</span><span class="identifier">period</span><span class="special">></span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> type of the
|
||
<code class="computeroutput"><span class="identifier">clock</span></code>.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">time_point</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">C1</span><span class="special">></span>
|
||
<span class="keyword">or</span> <span class="identifier">chrono</span><span class="special">::</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">C2</span><span class="special">,</span> <span class="identifier">C1</span><span class="special">::</span><span class="identifier">duration</span><span class="special">></span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> type of the
|
||
<code class="computeroutput"><span class="identifier">clock</span></code>. Different
|
||
clocks are permitted to share a <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> definition
|
||
if it is valid to compare their time_points by comparing their
|
||
respective <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>s. <code class="computeroutput"><span class="identifier">C1</span></code> and <code class="computeroutput"><span class="identifier">C2</span></code>
|
||
must refer to the same epoch.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">is_steady</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="keyword">constexpr</span> <span class="keyword">bool</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="keyword">true</span></code> if <code class="computeroutput"><span class="identifier">t1</span> <span class="special"><=</span>
|
||
<span class="identifier">t2</span></code> is always <code class="computeroutput"><span class="keyword">true</span></code>, else <code class="computeroutput"><span class="keyword">false</span></code>.
|
||
<span class="bold"><strong>Note</strong></span>: A <code class="computeroutput"><span class="identifier">clock</span></code>
|
||
that can be adjusted backwards is not steady
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">time_point</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Returns a <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> representing
|
||
the current point in time.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<br class="table-break"><p>
|
||
Models of <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock" title="Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock" title="Class steady_clock"><code class="computeroutput"><span class="identifier">steady_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.high_resolution_clock" title="Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_user_cpu_clock" title="Class process_user_cpu_clock"><code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_system_cpu_clock" title="Class process_system_cpu_clock"><code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_cpu_clock" title="Class process_cpu_clock"><code class="computeroutput"><span class="identifier">process_cpu_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a>
|
||
</li>
|
||
</ul></div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.cpp0x.trivial_clock"></a><a class="link" href="reference.html#chrono.reference.cpp0x.trivial_clock" title="TrivialClock Requirements"><code class="computeroutput"><span class="identifier">TrivialClock</span></code> Requirements</a>
|
||
</h4></div></div></div>
|
||
<p>
|
||
A type <code class="computeroutput"><span class="identifier">TC</span></code> meets the <code class="computeroutput"><span class="identifier">TrivialClock</span></code> requirements if:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">TC</span></code> satisfies the <code class="computeroutput"><span class="identifier">Clock</span></code> requirements,
|
||
</li>
|
||
<li class="listitem">
|
||
the types <code class="computeroutput"><span class="identifier">TC</span><span class="special">::</span><span class="identifier">rep</span></code>, <code class="computeroutput"><span class="identifier">TC</span><span class="special">::</span><span class="identifier">duration</span></code>,
|
||
and <code class="computeroutput"><span class="identifier">TC</span><span class="special">::</span><span class="identifier">time_point</span></code> satisfy the requirements
|
||
of <code class="computeroutput"><span class="identifier">EqualityComparable</span></code>,
|
||
<code class="computeroutput"><span class="identifier">LessThanComparable</span></code>,
|
||
<code class="computeroutput"><span class="identifier">DefaultConstructible</span></code>,
|
||
<code class="computeroutput"><span class="identifier">CopyConstructible</span></code>,
|
||
<code class="computeroutput"><span class="identifier">CopyAssignable</span></code>, <code class="computeroutput"><span class="identifier">Destructible</span></code>, and the requirements
|
||
of numeric types.
|
||
</li>
|
||
</ul></div>
|
||
<div class="note"><table border="0" summary="Note">
|
||
<tr>
|
||
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../doc/src/images/note.png"></td>
|
||
<th align="left">Note</th>
|
||
</tr>
|
||
<tr><td align="left" valign="top"><p>
|
||
This means, in particular, that operations on these types will not throw
|
||
exceptions.
|
||
</p></td></tr>
|
||
</table></div>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
lvalues of the types <code class="computeroutput"><span class="identifier">TC</span><span class="special">::</span><span class="identifier">rep</span></code>,
|
||
<code class="computeroutput"><span class="identifier">TC</span><span class="special">::</span><span class="identifier">duration</span></code>, and <code class="computeroutput"><span class="identifier">TC</span><span class="special">::</span><span class="identifier">time_point</span></code>
|
||
are swappable,
|
||
</li>
|
||
<li class="listitem">
|
||
the function <code class="computeroutput"><span class="identifier">TC</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>
|
||
does not throw exceptions and it is thread-safe, and
|
||
</li>
|
||
<li class="listitem">
|
||
the type <code class="computeroutput"><span class="identifier">TC</span><span class="special">::</span><span class="identifier">time_point</span><span class="special">::</span><span class="identifier">clock</span></code> meets the <code class="computeroutput"><span class="identifier">TrivialClock</span></code>
|
||
requirements, recursively.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
Models of <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">TrivialClock</span></code></a>:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock" title="Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock" title="Class steady_clock"><code class="computeroutput"><span class="identifier">steady_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.high_resolution_clock" title="Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_user_cpu_clock" title="Class process_user_cpu_clock"><code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_system_cpu_clock" title="Class process_system_cpu_clock"><code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a>
|
||
</li>
|
||
</ul></div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.cpp0x.ecclock"></a><a class="link" href="reference.html#chrono.reference.cpp0x.ecclock" title="EcClock Requirements"><code class="computeroutput"><span class="identifier">EcClock</span></code>
|
||
Requirements</a>
|
||
</h4></div></div></div>
|
||
<p>
|
||
A type <code class="computeroutput"><span class="identifier">EcC</span></code> meets the <code class="computeroutput"><span class="identifier">EcClock</span></code> requirements if
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">TC</span></code> satisfies the <code class="computeroutput"><span class="identifier">TrivialClock</span> </code> requirements, and
|
||
</li>
|
||
<li class="listitem">
|
||
it adds <code class="computeroutput"><span class="identifier">now</span><span class="special">()</span></code>
|
||
interfaces allowing to recover internal error codes as described in
|
||
the following table.
|
||
</li>
|
||
<li class="listitem">
|
||
the added now() function is thread-safe.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
In this table <code class="computeroutput"><span class="identifier">C1</span></code> denotes
|
||
a <code class="computeroutput"><span class="identifier">EcClock</span></code> type and <code class="computeroutput"><span class="identifier">ec</span></code> is an instance of a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span></code>.
|
||
</p>
|
||
<div class="table">
|
||
<a name="chrono.reference.cpp0x.ecclock.clock_requirements"></a><p class="title"><b>Table 7.2. Clock Requirements</b></p>
|
||
<div class="table-contents"><table class="table" summary="Clock Requirements">
|
||
<colgroup>
|
||
<col>
|
||
<col>
|
||
<col>
|
||
</colgroup>
|
||
<thead><tr>
|
||
<th>
|
||
<p>
|
||
expression
|
||
</p>
|
||
</th>
|
||
<th>
|
||
<p>
|
||
return type
|
||
</p>
|
||
</th>
|
||
<th>
|
||
<p>
|
||
operational semantics
|
||
</p>
|
||
</th>
|
||
</tr></thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">now</span><span class="special">(</span><span class="identifier">ec</span><span class="special">)</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">time_point</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Returns a <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> representing
|
||
the current point in time. <code class="computeroutput"><span class="identifier">ec</span></code>
|
||
will stores the error-code in case something was wrong internally.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">now</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">throws</span><span class="special">())</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">C1</span><span class="special">::</span><span class="identifier">time_point</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Returns a <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> representing
|
||
the current point in time. Throws a <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">system_error</span></code>
|
||
exception in case something was wrong internally.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<br class="table-break"><p>
|
||
Models of <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock" title="Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock" title="Class steady_clock"><code class="computeroutput"><span class="identifier">steady_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.high_resolution_clock" title="Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_user_cpu_clock" title="Class process_user_cpu_clock"><code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_system_cpu_clock" title="Class process_system_cpu_clock"><code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_cpu_clock" title="Class process_cpu_clock"><code class="computeroutput"><span class="identifier">process_cpu_clock</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a>
|
||
</li>
|
||
</ul></div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp" title="Header <boost/chrono/time_point.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">time_point</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.time_point_hpp.common_type_spe2"><code class="computeroutput"><span class="identifier">common_type</span></code> specialization</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point">Class
|
||
template <code class="computeroutput"><span class="identifier">time_point</span><span class="special"><></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.time_point_hpp.arith"><code class="computeroutput"><span class="identifier">time_point</span></code> non-member arithmetic</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp"><code class="computeroutput"><span class="identifier">time_point</span></code> non-member comparisons</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point_cast">Non-Member
|
||
Function <code class="computeroutput"><span class="identifier">time_point_cast</span><span class="special">(</span><span class="identifier">time_point</span><span class="special">)</span></code></a></span></dt>
|
||
</dl></div>
|
||
<p>
|
||
This file contains <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> specific classes and
|
||
non-member functions.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">></span>
|
||
<span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">;</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.common_type_spe" title="common_type Specialization"><code class="computeroutput"><span class="identifier">common_type</span></code></a><span class="special"><</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>,</span>
|
||
<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">></span> <span class="special">>;</span>
|
||
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="comment">// time_point arithmetic</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_plus_1" title="Non-Member Function operator+(time_point,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">+</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_plus_2" title="Non-Member Function operator+(duration,time_point)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">+</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_minus_1" title="Non-Member Function operator-(time_point,duration)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">typename</span> <span class="identifier">common_type</span><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>::</span><span class="identifier">type</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_minus_2" title="Non-Member Function operator-(time_point,time_point)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="comment">// time_point comparisons</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_eq" title="Non-Member Function operator==(time_point,time_point)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">==</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_neq" title="Non-Member Function operator!=(time_point,time_point)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">!=</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_lt" title="Non-Member Function operator<(time_point,time_point)"><code class="computeroutput"><span class="keyword">operator</span><span class="special"><</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_leq" title="Non-Member Function operator<=(time_point,time_point)"><code class="computeroutput"><span class="keyword">operator</span><span class="special"><=</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_gt" title="Non-Member Function operator>(time_point,time_point)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">></span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="keyword">bool</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_geq" title="Non-Member Function operator>=(time_point,time_point)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">>=</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="comment">// time_point_cast</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">ToDuration</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">></span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point_cast" title="Non-Member Function time_point_cast(time_point)"><code class="computeroutput"><span class="identifier">time_point_cast</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.common_type_spe2"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.common_type_spe2" title="common_type specialization"><code class="computeroutput"><span class="identifier">common_type</span></code> specialization</a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">struct</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">>,</span> <span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span> <span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>::</span><span class="identifier">type</span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
The <code class="computeroutput"><span class="identifier">common_type</span></code> of two
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>s is a <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> with the same <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>
|
||
(both have the same <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>), and the <code class="computeroutput"><span class="identifier">common_type</span></code> of the two <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>s.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>">Class
|
||
template <code class="computeroutput"><span class="identifier">time_point</span><span class="special"><></span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
A <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> represents a point
|
||
in time with respect to a specific clock.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">time_point</span> <span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">Clock</span> <span class="identifier">clock</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">Duration</span> <span class="identifier">duration</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="keyword">typename</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
|
||
<span class="keyword">private</span><span class="special">:</span>
|
||
<span class="identifier">duration</span> <span class="identifier">d_</span><span class="special">;</span> <span class="comment">// exposition only</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">constexpr</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.time_point_c_1" title="Constructor time_point()"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">();</span>
|
||
|
||
<span class="keyword">constexpr</span> <span class="keyword">explicit</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.time_point_c_2" title="Constructor time_point(const duration&)"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
<span class="comment">// conversions</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.time_point_c_3" title="Copy Constructor time_point(const time_point&)"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">clock</span><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
|
||
|
||
<span class="comment">// observer</span>
|
||
<span class="keyword">constexpr</span> <span class="identifier">duration</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.time_since_epoch" title="Member Function time_since_epoch() const"><code class="computeroutput"><span class="identifier">time_since_epoch</span></code></a><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="comment">// arithmetic</span>
|
||
|
||
<span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_EXTENSIONS</span>
|
||
<span class="keyword">constexpr</span> <span class="identifier">time_point</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_unary_plus" title="Member Function operator+() const"><code class="computeroutput"><span class="keyword">operator</span><span class="special">+</span></code></a><span class="special">();</span>
|
||
<span class="keyword">constexpr</span> <span class="identifier">time_point</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_unary_minus" title="Member Function operator-() const"><code class="computeroutput"><span class="keyword">operator</span><span class="special">-</span></code></a><span class="special">();</span>
|
||
<span class="identifier">time_point</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_pre_inc" title="Member Function operator++()"><code class="computeroutput"><span class="keyword">operator</span><span class="special">++</span></code></a><span class="special">();</span>
|
||
<span class="identifier">time_point</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_post_inc" title="Member Function operator++(int)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">++</span></code></a><span class="special">(</span><span class="keyword">int</span><span class="special">);</span>
|
||
<span class="identifier">time_point</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_pre_dec" title="Member Function operator--()"><code class="computeroutput"><span class="keyword">operator</span><span class="special">--</span></code></a><span class="special">();</span>
|
||
<span class="identifier">time_point</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_post_dec" title="Member Function operator--(int)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">--</span></code></a><span class="special">(</span><span class="keyword">int</span><span class="special">);</span>
|
||
|
||
<span class="identifier">time_point</span><span class="special">&</span> <span class="identifier">__time_point__op_plus_eq_1</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
<span class="identifier">time_point</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_minus_eq_1" title="Member Function operator-=(const rep&)"><code class="computeroutput"><span class="keyword">operator</span><span class="special">-=</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
<span class="preprocessor">#endif</span>
|
||
|
||
<span class="identifier">time_point</span><span class="special">&</span> <span class="identifier">__time_point__op_plus_eq_2</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
<span class="identifier">time_point</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_minus_eq_2" title="Member Function operator-="><code class="computeroutput"><span class="keyword">operator</span><span class="special">-=</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
<span class="comment">// special values</span>
|
||
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">time_point</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.min" title="Static Member Function min"><code class="computeroutput"><span class="identifier">min</span></code></a><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">time_point</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.max" title="Static Member Function max"><code class="computeroutput"><span class="identifier">max</span></code></a><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
Clock must meet the <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a> requirements.
|
||
</p>
|
||
<p>
|
||
Duration must be an instantiation of <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>, compile diagnostic
|
||
otherwise.
|
||
</p>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.time_point_c_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.time_point_c_1" title="Constructor time_point()">Constructor
|
||
<code class="computeroutput"><span class="identifier">time_point</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">constexpr</span> <span class="identifier">time_point</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs an object of
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>, initializing
|
||
<code class="computeroutput"><span class="identifier">d_</span></code> with <code class="computeroutput"><span class="identifier">duration</span><span class="special">::</span><span class="identifier">zero</span><span class="special">()</span></code>.
|
||
This <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> represents the
|
||
epoch.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.time_point_c_2"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.time_point_c_2" title="Constructor time_point(const duration&)">Constructor
|
||
<code class="computeroutput"><span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">constexpr</span> <span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs an object of
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>, initializing
|
||
<code class="computeroutput"><span class="identifier">d_</span></code> with <code class="computeroutput"><span class="identifier">d</span></code>. This <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> represents the
|
||
epoch <code class="computeroutput"><span class="special">+</span> <span class="identifier">d</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.time_point_c_3"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.time_point_c_3" title="Copy Constructor time_point(const time_point&)">Copy
|
||
Constructor <code class="computeroutput"><span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="identifier">time_point</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">clock</span><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Requires:</strong></span> This function will not participate
|
||
in overload resolution unless <code class="computeroutput"><span class="identifier">Duration2</span></code>
|
||
is implicitly convertible to <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs an object of
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>, initializing
|
||
<code class="computeroutput"><span class="identifier">d_</span></code> with <code class="computeroutput"><span class="identifier">t</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.time_since_epoch"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.time_since_epoch" title="Member Function time_since_epoch() const">Member
|
||
Function <code class="computeroutput"><span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">constexpr</span> <span class="identifier">duration</span> <span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">d_</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.op_unary_plus"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_unary_plus" title="Member Function operator+() const">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+()</span>
|
||
<span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">constexpr</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> <span class="keyword">operator</span><span class="special">+()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.op_unary_minus"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_unary_minus" title="Member Function operator-() const">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-()</span>
|
||
<span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">constexpr</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> <span class="keyword">operator</span><span class="special">-()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">(-</span><span class="identifier">d_</span><span class="special">)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.op_pre_inc"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_pre_inc" title="Member Function operator++()">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">++();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="special">++</span><span class="identifier">d_</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.op_post_inc"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_post_inc" title="Member Function operator++(int)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> <span class="keyword">operator</span><span class="special">++(</span><span class="keyword">int</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">(</span><span class="identifier">d_</span><span class="special">++)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.op_pre_dec"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_pre_dec" title="Member Function operator--()">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">--()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">--();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="special">--</span><span class="identifier">d_</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.op_post_dec"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_post_dec" title="Member Function operator--(int)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">--(</span><span class="keyword">int</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> <span class="keyword">operator</span><span class="special">--(</span><span class="keyword">int</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">(</span><span class="identifier">d_</span><span class="special">--)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.op_plus_eq_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_plus_eq_1" title="Member Function operator+=(const rep&)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">r</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">d_</span>
|
||
<span class="special">+=</span> <span class="identifier">duration</span><span class="special">(</span><span class="identifier">r</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.op_minus_eq_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_minus_eq_1" title="Member Function operator-=(const rep&)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">rep</span><span class="special">&</span> <span class="identifier">r</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">d_</span>
|
||
<span class="special">-=</span> <span class="identifier">duration</span><span class="special">(</span><span class="identifier">r</span><span class="special">)</span></code>
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.op_plus_eq_2"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_plus_eq_2" title="Member Function operator+=">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+=</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="identifier">time_point</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">d_</span>
|
||
<span class="special">+=</span> <span class="identifier">d</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.op_minus_eq_2"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.op_minus_eq_2" title="Member Function operator-=">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-=</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="identifier">time_point</span><span class="special">&</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">d_</span>
|
||
<span class="special">-=</span> <span class="identifier">d</span></code>
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">*</span><span class="keyword">this</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.min"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.min" title="Static Member Function min">Static
|
||
Member Function <code class="computeroutput"><span class="identifier">min</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">time_point</span> <span class="identifier">min</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">time_point</span><span class="special">(</span><span class="identifier">duration</span><span class="special">::</span><span class="identifier">min</span><span class="special">())</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point.max"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point.max" title="Static Member Function max">Static
|
||
Member Function <code class="computeroutput"><span class="identifier">max</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="identifier">time_point</span> <span class="identifier">max</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">time_point</span><span class="special">(</span><span class="identifier">duration</span><span class="special">::</span><span class="identifier">max</span><span class="special">())</span></code>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.arith"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.arith" title="time_point non-member arithmetic"><code class="computeroutput"><span class="identifier">time_point</span></code> non-member arithmetic</a>
|
||
</h5></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_plus_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_plus_1" title="Non-Member Function operator+(time_point,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
|
||
<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">CT</span><span class="special">(</span><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">rhs</span><span class="special">)</span></code>
|
||
where <code class="computeroutput"><span class="identifier">CT</span></code> is the type
|
||
of the return value.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_plus_2"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_plus_2" title="Non-Member Function operator+(duration,time_point)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">+(</span><span class="identifier">duration</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period1</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
|
||
<span class="keyword">operator</span><span class="special">+(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep1</span><span class="special">,</span> <span class="identifier">Period1</span><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">rhs</span>
|
||
<span class="special">+</span> <span class="identifier">lhs</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_minus_1"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_minus_1" title="Non-Member Function operator-(time_point,duration)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">duration</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep2</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period2</span><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">></span> <span class="special">>::</span><span class="identifier">type</span><span class="special">></span>
|
||
<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">,</span> <span class="identifier">Period2</span><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">lhs</span>
|
||
<span class="special">+</span> <span class="special">(-</span><span class="identifier">rhs</span><span class="special">)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_minus_2"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.arith.time_point__op_minus_2" title="Non-Member Function operator-(time_point,time_point)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">-(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">typename</span> <code class="computeroutput"><span class="identifier">common_type</span></code><span class="special"><</span><span class="identifier">Duration1</span><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>::</span><span class="identifier">type</span>
|
||
<span class="keyword">operator</span><span class="special">-(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="special">-</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span></code>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.cmp"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp" title="time_point non-member comparisons"><code class="computeroutput"><span class="identifier">time_point</span></code> non-member comparisons</a>
|
||
</h5></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_eq"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_eq" title="Non-Member Function operator==(time_point,time_point)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">==(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">lhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span> <span class="special">==</span> <span class="identifier">rhs</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_neq"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_neq" title="Non-Member Function operator!=(time_point,time_point)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">!=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">!=(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special">==</span>
|
||
<span class="identifier">rhs</span><span class="special">)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_lt"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_lt" title="Non-Member Function operator<(time_point,time_point)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><</span> <span class="special">(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> lhs.time_since_epoch() <
|
||
rhs.time_since_epoch().
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_leq"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_leq" title="Non-Member Function operator<=(time_point,time_point)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><=(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">rhs</span> <span class="special"><</span>
|
||
<span class="identifier">lhs</span><span class="special">)</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_gt"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_gt" title="Non-Member Function operator>(time_point,time_point)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">rhs</span>
|
||
<span class="special"><</span> <span class="identifier">lhs</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_geq"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.cmp.time_point__op_geq" title="Non-Member Function operator>=(time_point,time_point)">Non-Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>=(</span><span class="identifier">time_point</span><span class="special">,</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">>=(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration1</span></code></a><span class="special">>&</span> <span class="identifier">lhs</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration2</span></code></a><span class="special">>&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="special">!(</span><span class="identifier">lhs</span> <span class="special"><</span>
|
||
<span class="identifier">rhs</span><span class="special">)</span></code>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.time_point_hpp.time_point_cast"></a><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point_cast" title="Non-Member Function time_point_cast(time_point)">Non-Member
|
||
Function <code class="computeroutput"><span class="identifier">time_point_cast</span><span class="special">(</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">ToDuration</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span>
|
||
<span class="keyword">constexpr</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">></span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point_cast" title="Non-Member Function time_point_cast(time_point)"><code class="computeroutput"><span class="identifier">time_point_cast</span></code></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">>&</span> <span class="identifier">t</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Requires:</strong></span> This function will not participate
|
||
in overload resolution unless <code class="computeroutput"><span class="identifier">ToDuration</span></code>
|
||
is an instantiation of <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="identifier">ToDuration</span><span class="special">>(</span><a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_cast" title="Non-Member Function duration_cast(duration)"><code class="computeroutput"><span class="identifier">duration_cast</span></code></a><span class="special"><</span><span class="identifier">ToDuration</span><span class="special">>(</span><span class="identifier">t</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">()))</span></code>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.cpp0x.system_clocks_hpp"></a><a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp" title="Header <boost/chrono/system_clocks.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">system_clocks</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock">Class
|
||
<code class="computeroutput"><span class="identifier">system_clock</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.BOOST_CHRONO_HAS_CLOCK_STEADY">Macro
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock">Class
|
||
<code class="computeroutput"><span class="identifier">steady_clock</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.high_resolution_clock">Class
|
||
<code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.clock_string_system_clock"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">></span></code>
|
||
Specialization</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.clock_string_steady_clock"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">steady_clock</span><span class="special">></span></code>
|
||
Specialization</a></span></dt>
|
||
</dl></div>
|
||
<p>
|
||
This file contains the standard clock classes. The types defined in this
|
||
section satisfy the <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">TrivialClock</span></code></a> requirements
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="comment">// Clocks</span>
|
||
<span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock" title="Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a><span class="special">;</span>
|
||
<span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock" title="Class steady_clock"><code class="computeroutput"><span class="identifier">steady_clock</span></code></a><span class="special">;</span>
|
||
<span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.high_resolution_clock" title="Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a><span class="special">;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">>;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">steady_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">>;</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.system_clocks_hpp.system_clock"></a><a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock" title="Class system_clock">Class
|
||
<code class="computeroutput"><span class="identifier">system_clock</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
The <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock" title="Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a> class provides
|
||
a means of obtaining the current wall-clock time from the system-wide
|
||
real-time clock. The current time can be obtained by calling <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
|
||
Instances of <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span></code>
|
||
can be converted to and from time_t with the <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">to_time_t</span><span class="special">()</span></code> and <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">from_time_t</span><span class="special">()</span></code> functions. If system clock is not steady,
|
||
a subsequent call to <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code> may return an earlier time than a previous
|
||
call (e.g. if the operating system clock is manually adjusted, or synchronized
|
||
with an external clock).
|
||
</p>
|
||
<p>
|
||
The current implementation of <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock" title="Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a> is related an epoch
|
||
(midnight UTC of January 1, 1970), but this is not in the contract. You
|
||
need to use the static function static
|
||
</p>
|
||
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">time_t</span> <span class="identifier">to_time_t</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special">&</span> <span class="identifier">t</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
which returns a <code class="computeroutput"><span class="identifier">time_t</span></code>
|
||
type that is based on midnight UTC of January 1, 1970.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">system_clock</span> <span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="emphasis"><em>see bellow</em></span> <span class="identifier">duration</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">system_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">is_steady</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span>
|
||
|
||
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">()</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span><span class="special">);</span>
|
||
|
||
<span class="comment">// Map to C API</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">time_t</span> <span class="identifier">to_time_t</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special">&</span> <span class="identifier">t</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">from_time_t</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">time_t</span> <span class="identifier">t</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock" title="Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a> satisfy the <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>
|
||
requirements:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">::</span><span class="identifier">min</span><span class="special">()</span>
|
||
<span class="special"><</span> <span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">duration</span><span class="special">::</span><span class="identifier">zero</span><span class="special">()</span></code> is <code class="computeroutput"><span class="keyword">true</span></code>.
|
||
</li>
|
||
<li class="listitem">
|
||
The nested <code class="computeroutput"><span class="identifier">duration</span></code>
|
||
typedef has a resolution that depends on the one provided by the
|
||
platform.
|
||
</li>
|
||
</ul></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.system_clocks_hpp.system_clock.to_time_t"></a><a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock.to_time_t" title="Static Member Function to_time_t(time_point)">Static
|
||
Member Function <code class="computeroutput"><span class="identifier">to_time_t</span><span class="special">(</span><span class="identifier">time_point</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="identifier">time_t</span> <span class="identifier">to_time_t</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">time_point</span><span class="special">&</span> <span class="identifier">t</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> A <code class="computeroutput"><span class="identifier">time_t</span></code>
|
||
such that the <code class="computeroutput"><span class="identifier">time_t</span></code>
|
||
and <code class="computeroutput"><span class="identifier">t</span></code> represent the
|
||
same point in time, truncated to the coarser of the precisions among
|
||
<code class="computeroutput"><span class="identifier">time_t</span></code> and <code class="computeroutput"><span class="identifier">time_point</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.cpp0x.system_clocks_hpp.system_clock.from_time_t"></a><a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock.from_time_t" title="Static Member Function from_time_t(time_t)">Static
|
||
Member Function <code class="computeroutput"><span class="identifier">from_time_t</span><span class="special">(</span><span class="identifier">time_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="identifier">time_point</span> <span class="identifier">from_time_t</span><span class="special">(</span><span class="identifier">time_t</span> <span class="identifier">t</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> A <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> such that the
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> and <code class="computeroutput"><span class="identifier">t</span></code> represent the same point in time,
|
||
truncated to the coarser of the precisions among <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> and <code class="computeroutput"><span class="identifier">time_t</span></code>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.system_clocks_hpp.BOOST_CHRONO_HAS_CLOCK_STEADY"></a><a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.BOOST_CHRONO_HAS_CLOCK_STEADY" title="Macro BOOST_CHRONO_HAS_CLOCK_STEADY">Macro
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
Defined if the platform support steady clocks.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.system_clocks_hpp.steady_clock"></a><a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock" title="Class steady_clock">Class
|
||
<code class="computeroutput"><span class="identifier">steady_clock</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock" title="Class steady_clock"><code class="computeroutput"><span class="identifier">steady_clock</span></code></a> satisfy the <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>
|
||
requirements.
|
||
</p>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock" title="Class steady_clock"><code class="computeroutput"><span class="identifier">steady_clock</span></code></a> class provides
|
||
access to the system-wide steady clock. The current time can be obtained
|
||
by calling <code class="computeroutput"><span class="identifier">steady_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>. There is no fixed relationship between
|
||
values returned by <code class="computeroutput"><span class="identifier">steady_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code> and wall-clock time.
|
||
</p>
|
||
<pre class="programlisting"><span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_HAS_CLOCK_STEADY</span>
|
||
<span class="keyword">class</span> <span class="identifier">steady_clock</span> <span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a> <span class="identifier">duration</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">steady_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">is_steady</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
|
||
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">()</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span><span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span><span class="special">);</span>
|
||
<span class="special">};</span>
|
||
<span class="preprocessor">#endif</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.system_clocks_hpp.high_resolution_clock"></a><a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.high_resolution_clock" title="Class high_resolution_clock">Class
|
||
<code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.high_resolution_clock" title="Class high_resolution_clock"><code class="computeroutput"><span class="identifier">high_resolution_clock</span></code></a> satisfy
|
||
the <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>
|
||
requirements.
|
||
</p>
|
||
<pre class="programlisting"><span class="preprocessor">#ifdef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.BOOST_CHRONO_HAS_CLOCK_STEADY" title="Macro BOOST_CHRONO_HAS_CLOCK_STEADY"><code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span></code></a>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock" title="Class steady_clock"><code class="computeroutput"><span class="identifier">steady_clock</span></code></a> <span class="identifier">high_resolution_clock</span><span class="special">;</span> <span class="comment">// as permitted by [time.clock.hires]</span>
|
||
<span class="preprocessor">#else</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock" title="Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a> <span class="identifier">high_resolution_clock</span><span class="special">;</span> <span class="comment">// as permitted by [time.clock.hires]</span>
|
||
<span class="preprocessor">#endif</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.system_clocks_hpp.clock_string_system_clock"></a><a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.clock_string_system_clock" title="clock_string<system_clock> Specialization"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">></span></code>
|
||
Specialization</a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">name</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">since</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">name</span><span class="special">()</span></code>
|
||
returns "system_clock".
|
||
</p>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">since</span><span class="special">()</span></code>
|
||
returns " since Jan 1, 1970"
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.system_clocks_hpp.clock_string_steady_clock"></a><a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.clock_string_steady_clock" title="clock_string<steady_clock> Specialization"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">steady_clock</span><span class="special">></span></code>
|
||
Specialization</a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="preprocessor">#ifdef</span> <span class="identifier">BOOST_CHRONO_HAS_CLOCK_STEADY</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">steady_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">name</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">since</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
<span class="preprocessor">#endif</span>
|
||
</pre>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">name</span><span class="special">()</span></code>
|
||
returns "steady_clock".
|
||
</p>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">since</span><span class="special">()</span></code>
|
||
returns " since boot"
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.cpp0x.clock_strings_hpp"></a><a class="link" href="reference.html#chrono.reference.cpp0x.clock_strings_hpp" title="Header <boost/chrono/clock_strings.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">clock_strings</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc"><dt><span class="section"><a href="reference.html#chrono.reference.cpp0x.clock_strings_hpp.clock_string">Template
|
||
Class <code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><></span></code></a></span></dt></dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special">;</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.cpp0x.clock_strings_hpp.clock_string"></a><a class="link" href="reference.html#chrono.reference.cpp0x.clock_strings_hpp.clock_string" title="Template Class clock_string<>">Template
|
||
Class <code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><></span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
This template must be specialized for specific clocks. The specialization
|
||
must define the following functions
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">name</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">since</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">name</span><span class="special">()</span></code>
|
||
return the clock name, which usually corresponds to the class name.
|
||
</p>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">since</span><span class="special">()</span></code>
|
||
return the textual format of the clock epoch.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.cpp0x.chrono_typeof_hpp"></a><a class="link" href="reference.html#chrono.reference.cpp0x.chrono_typeof_hpp" title="Header <boost/chrono/typeof/boost/chrono/chrono.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">typeof</span><span class="special">/</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<p>
|
||
Register <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><code class="computeroutput"><span class="special"><></span></code>
|
||
and <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><code class="computeroutput"><span class="special"><></span></code>
|
||
class templates to <span class="bold"><strong>Boost.Typeof</strong></span>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h3 class="title">
|
||
<a name="chrono.reference.io_v1"></a><a class="link" href="reference.html#chrono.reference.io_v1" title="Chrono I/O V1">Chrono I/O V1</a>
|
||
</h3></div></div></div>
|
||
<div class="toc"><dl class="toc"><dt><span class="section"><a href="reference.html#chrono.reference.io_v1.chrono_io_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt></dl></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io_v1.chrono_io_hpp"></a><a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp" title="Header <boost/chrono/chrono_io.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_punct</span><span class="special"><></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io_v1.chrono_io_hpp.manipulators">I/O
|
||
Manipulators</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io_v1.chrono_io_hpp.streams">I/O
|
||
Streams Operations</a></span></dt>
|
||
</dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">duration_punct</span><span class="special">;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="identifier">duration_short</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="identifier">duration_long</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span>
|
||
<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io_v1.chrono_io_hpp.duration_punct"></a><a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct" title="Template Class duration_punct<>">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_punct</span><span class="special"><></span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
The <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> unit names can be customized
|
||
through the facet: <a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct" title="Template Class duration_punct<>"><code class="computeroutput"><span class="identifier">duration_punct</span></code></a>. <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> unit names come in
|
||
two varieties: long and short. The default constructed <a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct" title="Template Class duration_punct<>"><code class="computeroutput"><span class="identifier">duration_punct</span></code></a> provides names
|
||
in the long format. These names are English descriptions. Other languages
|
||
are supported by constructing a <a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct" title="Template Class duration_punct<>"><code class="computeroutput"><span class="identifier">duration_punct</span></code></a> with the proper
|
||
spellings for "hours", "minutes" and "seconds",
|
||
and their abbreviations (for the short format).
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">duration_punct</span>
|
||
<span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">facet</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span>
|
||
<span class="keyword">enum</span> <span class="special">{</span><span class="identifier">use_long</span><span class="special">,</span> <span class="identifier">use_short</span><span class="special">};</span>
|
||
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">;</span>
|
||
|
||
<span class="keyword">explicit</span> <span class="identifier">duration_punct</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">use</span> <span class="special">=</span> <span class="identifier">use_long</span><span class="special">);</span>
|
||
|
||
<span class="identifier">duration_punct</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">use</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">&</span> <span class="identifier">long_seconds</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">&</span> <span class="identifier">long_minutes</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">&</span> <span class="identifier">long_hours</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">&</span> <span class="identifier">short_seconds</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">&</span> <span class="identifier">short_minutes</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">&</span> <span class="identifier">short_hours</span><span class="special">);</span>
|
||
|
||
<span class="identifier">duration_punct</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">use</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration_punct</span><span class="special">&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">string_type</span> <span class="identifier">short_name</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">string_type</span> <span class="identifier">long_name</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span> <span class="identifier">string_type</span> <span class="identifier">name</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">bool</span> <span class="identifier">is_short_name</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">bool</span> <span class="identifier">is_long_name</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io_v1.chrono_io_hpp.manipulators"></a><a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.manipulators" title="I/O Manipulators">I/O
|
||
Manipulators</a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
The short or long format can be easily chosen by streaming a <code class="computeroutput"><span class="identifier">duration_short</span></code> or <code class="computeroutput"><span class="identifier">duration_long</span></code>
|
||
manipulator respectively.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="identifier">duration_short</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Set the <a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct" title="Template Class duration_punct<>"><code class="computeroutput"><span class="identifier">duration_punct</span></code></a> facet to stream
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>s and <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>s as abbreviations.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the output stream
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="identifier">duration_long</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Set the <a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct" title="Template Class duration_punct<>"><code class="computeroutput"><span class="identifier">duration_punct</span></code></a> facet to stream
|
||
durations and time_points as long text.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the output stream
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io_v1.chrono_io_hpp.streams"></a><a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.streams" title="I/O Streams Operations">I/O
|
||
Streams Operations</a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
Any <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> can be streamed out
|
||
to a <code class="computeroutput"><span class="identifier">basic_ostream</span></code>. The
|
||
run-time value of the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> is formatted according
|
||
to the rules and current format settings for <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><code class="computeroutput"><span class="special">::</span><span class="identifier">rep</span></code>. This is followed by a single space
|
||
and then the compile-time unit name of the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>. This unit name is
|
||
built on the string returned from <code class="computeroutput"><span class="identifier">ratio_string</span><span class="special"><></span></code> and the data used to construct
|
||
the <a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct" title="Template Class duration_punct<>"><code class="computeroutput"><span class="identifier">duration_punct</span></code></a> which was inserted
|
||
into the stream's locale. If a <a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct" title="Template Class duration_punct<>"><code class="computeroutput"><span class="identifier">duration_punct</span></code></a> has not been
|
||
inserted into the stream's locale, a default constructed <a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct" title="Template Class duration_punct<>"><code class="computeroutput"><span class="identifier">duration_punct</span></code></a> will be added
|
||
to the stream's locale.
|
||
</p>
|
||
<p>
|
||
A <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> is formatted by outputting
|
||
its internal <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> followed by a string
|
||
that describes the <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><code class="computeroutput"><span class="special">::</span><span class="identifier">clock</span></code> epoch. This string will vary
|
||
for each distinct clock, and for each implementation of the supplied
|
||
clocks.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> outputs the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> as an abbreviated or
|
||
long text format depending on the state of the <a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct" title="Template Class duration_punct<>"><code class="computeroutput"><span class="identifier">duration_punct</span></code></a> facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the output stream
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> reads a <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> from the input stream.
|
||
If a format error is found, the input stream state will be set to <code class="computeroutput"><span class="identifier">failbit</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the input stream
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> outputs the <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> as an abbreviated
|
||
or long text format depending on the state of the <a class="link" href="reference.html#chrono.reference.io_v1.chrono_io_hpp.duration_punct" title="Template Class duration_punct<>"><code class="computeroutput"><span class="identifier">duration_punct</span></code></a> facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the output stream
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span>
|
||
<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> reads a <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> from the input stream.
|
||
If a format error is found, the input stream state will be set to <code class="computeroutput"><span class="identifier">failbit</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the input stream
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h3 class="title">
|
||
<a name="chrono.reference.io"></a><a class="link" href="reference.html#chrono.reference.io" title="Chrono I/O V2">Chrono I/O V2</a>
|
||
</h3></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.chrono_io_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.duration_style_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_style</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.timezone_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">timezone</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.ios_state_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">ios_base_state</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.duration_get_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_get</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.duration_put_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_put</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.duration_units_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_units</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.duration_io_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.time_point_get_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_get</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.time_point_put_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_put</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.time_point_units_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_units</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.time_point_io_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
</dl></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.chrono_io_hpp"></a><a class="link" href="reference.html#chrono.reference.io.chrono_io_hpp" title="Header <boost/chrono/chrono_io.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">chrono_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<p>
|
||
This file includes the i/o of the two major components, duration and time_point.
|
||
</p>
|
||
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_style</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">timezone</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">ios_base_state</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_get</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_put</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_units</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_get</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_put</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_units</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.duration_style_hpp"></a><a class="link" href="reference.html#chrono.reference.io.duration_style_hpp" title="Header <boost/chrono/io/duration_style.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_style</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc"><dt><span class="section"><a href="reference.html#chrono.reference.io.duration_style_hpp.duration_style">Scoped
|
||
enum <code class="computeroutput"><span class="identifier">duration_style</span></code></a></span></dt></dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="comment">// typedefs</span>
|
||
<span class="keyword">enum</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">duration_style</span></code></a> <span class="special">{</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">prefix</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">symbol</span></code></a>
|
||
<span class="special">};</span>
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.duration_style_hpp.duration_style"></a><a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style">Scoped
|
||
enum <code class="computeroutput"><span class="identifier">duration_style</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">enum</span> <span class="keyword">class</span> <span class="identifier">duration_style</span> <span class="special">{</span>
|
||
<span class="identifier">prefix</span><span class="special">,</span> <span class="identifier">symbol</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> unit names come in
|
||
two varieties: prefix and symbol.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.timezone_hpp"></a><a class="link" href="reference.html#chrono.reference.io.timezone_hpp" title="Header <boost/chrono/io/timezone.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">timezone</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc"><dt><span class="section"><a href="reference.html#chrono.reference.io.timezone_hpp.timezone">Scoped
|
||
enum <code class="computeroutput"><span class="identifier">timezone</span></code></a></span></dt></dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">timezone</span></code></a>
|
||
<span class="special">{</span>
|
||
<span class="keyword">enum</span> <span class="identifier">type</span> <span class="special">{</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">utc</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">local</span></code></a>
|
||
<span class="special">};</span>
|
||
<span class="special">};</span>
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.timezone_hpp.timezone"></a><a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone">Scoped
|
||
enum <code class="computeroutput"><span class="identifier">timezone</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">enum</span> <span class="keyword">class</span> <span class="identifier">timezone</span> <span class="special">{</span>
|
||
<span class="identifier">utc</span><span class="special">,</span> <span class="identifier">local</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp" title="Header <boost/chrono/io/ios_base_state.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">ios_base_state</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.ios_state_hpp.sag">Setter and
|
||
getters</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.ios_state_hpp.ioss">I/O State
|
||
Savers</a></span></dt>
|
||
</dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="comment">// setters and getters</span>
|
||
<span class="identifier">duration_style</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.get_duration_style" title="Non Member Function get_duration_style(std::ios_base &)"><code class="computeroutput"><span class="identifier">get_duration_style</span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span> <span class="special">&</span> <span class="identifier">ios</span><span class="special">);</span>
|
||
<span class="keyword">void</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_duration_style" title="Non Member Function set_duration_style(std::ios_base &,duration_style)"><code class="computeroutput"><span class="identifier">set_duration_style</span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">);</span>
|
||
|
||
<span class="identifier">timezone</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.get_timezone" title="Non Member Function get_timezone(std::ios_base&)"><code class="computeroutput"><span class="identifier">get_timezone</span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span> <span class="special">&</span> <span class="identifier">ios</span><span class="special">);</span>
|
||
<span class="keyword">void</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_timezone" title="Non Member Function set_timezone(std::ios_base&,duration_style)"><code class="computeroutput"><span class="identifier">set_timezone</span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">timezone</span> <span class="identifier">tz</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.get_time_fmt" title="Non Member Function get_time_fmt(std::ios_base &)"><code class="computeroutput"><span class="identifier">get_time_fmt</span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span> <span class="special">&</span> <span class="identifier">ios</span><span class="special">);</span>
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">void</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_time_fmt" title="Non Member Function set_time_fmt(std::ios_base&, std::basic_string<CharT> const&)"><code class="computeroutput"><span class="identifier">set_time_fmt</span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">fmt</span><span class="special">);</span>
|
||
|
||
<span class="comment">// i/o state savers</span>
|
||
<span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver" title="Template Class duration_style_io_saver"><code class="computeroutput"><span class="identifier">duration_style_io_saver</span></code></a><span class="special">;</span>
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span> <span class="special">=</span> <span class="keyword">char</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver" title="Template Class timezone_io_saver<>"><code class="computeroutput"><span class="identifier">timezone_io_saver</span></code></a><span class="special">;</span>
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span> <span class="special">=</span> <span class="keyword">char</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver" title="Template Class time_fmt_io_saver<>"><code class="computeroutput"><span class="identifier">time_fmt_io_saver</span></code></a><span class="special">;</span>
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.sag"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag" title="Setter and getters">Setter and
|
||
getters</a>
|
||
</h5></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.sag.get_duration_style"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.get_duration_style" title="Non Member Function get_duration_style(std::ios_base &)">Non
|
||
Member Function <code class="computeroutput"><span class="identifier">get_duration_style</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span>
|
||
<span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="identifier">duration_style</span> <span class="identifier">get_duration_style</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span> <span class="special">&</span> <span class="identifier">ios</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> The stream's <a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">duration_style</span></code></a> attribute associated
|
||
to <code class="computeroutput"><span class="identifier">ios</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.sag.set_duration_style"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_duration_style" title="Non Member Function set_duration_style(std::ios_base &,duration_style)">Non
|
||
Member Function <code class="computeroutput"><span class="identifier">set_duration_style</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span>
|
||
<span class="special">&,</span><span class="identifier">duration_style</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">set_duration_style</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Set the stream's <a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">duration_style</span></code></a> attribute associated
|
||
to <code class="computeroutput"><span class="identifier">ios</span></code> with the <code class="computeroutput"><span class="identifier">style</span></code> parameter.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.sag.get_timezone"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.get_timezone" title="Non Member Function get_timezone(std::ios_base&)">Non
|
||
Member Function <code class="computeroutput"><span class="identifier">get_timezone</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="identifier">timezone</span> <span class="identifier">get_timezone</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span> <span class="special">&</span> <span class="identifier">ios</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> The stream's <a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">timezone</span></code></a> attribute associated
|
||
to <code class="computeroutput"><span class="identifier">ios</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.sag.set_timezone"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_timezone" title="Non Member Function set_timezone(std::ios_base&,duration_style)">Non
|
||
Member Function <code class="computeroutput"><span class="identifier">set_timezone</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">duration_style</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">set_timezone</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">timezone</span> <span class="identifier">tz</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Set the stream's <a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">timezone</span></code></a> attribute associated
|
||
to <code class="computeroutput"><span class="identifier">ios</span></code> with the <code class="computeroutput"><span class="identifier">tz</span></code> parameter.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.sag.get_time_fmt"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.get_time_fmt" title="Non Member Function get_time_fmt(std::ios_base &)">Non
|
||
Member Function <code class="computeroutput"><span class="identifier">get_time_fmt</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span>
|
||
<span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">get_time_fmt</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span> <span class="special">&</span> <span class="identifier">ios</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> The stream's time format
|
||
attribute associated to <code class="computeroutput"><span class="identifier">ios</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.sag.set_time_fmt"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_time_fmt" title="Non Member Function set_time_fmt(std::ios_base&, std::basic_string<CharT> const&)">Non
|
||
Member Function <code class="computeroutput"><span class="identifier">set_time_fmt</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="keyword">const</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">void</span> <span class="identifier">set_time_fmt</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">fmt</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Set the stream's time format
|
||
attribute associated to <code class="computeroutput"><span class="identifier">ios</span></code>
|
||
with the <code class="computeroutput"><span class="identifier">fmt</span></code> parameter.
|
||
</p>
|
||
<p>
|
||
The format is composed of zero or more directives. Each directive is
|
||
composed of one of the following:
|
||
</p>
|
||
<pre class="programlisting"><span class="special">*</span> <span class="identifier">one</span> <span class="keyword">or</span> <span class="identifier">more</span> <span class="identifier">white</span><span class="special">-</span><span class="identifier">space</span> <span class="identifier">characters</span> <span class="special">(</span><span class="identifier">as</span> <span class="identifier">specified</span> <span class="identifier">by</span> <span class="identifier">isspace</span><span class="special">());</span>
|
||
<span class="special">*</span> <span class="identifier">an</span> <span class="identifier">ordinary</span> <span class="identifier">character</span> <span class="special">(</span><span class="identifier">neither</span> <span class="char">'%'</span> <span class="identifier">nor</span> <span class="identifier">a</span> <span class="identifier">white</span><span class="special">-</span><span class="identifier">space</span> <span class="identifier">character</span><span class="special">);</span>
|
||
<span class="special">*</span> <span class="keyword">or</span> <span class="identifier">a</span> <span class="identifier">conversion</span> <span class="identifier">specification</span><span class="special">.</span>
|
||
</pre>
|
||
<p>
|
||
Each conversion specification is composed of a '%' character followed
|
||
by a conversion character which specifies the replacement required.
|
||
The application shall ensure that there is white-space or other non-alphanumeric
|
||
characters between any two conversion specifications. The following
|
||
conversion specifications are supported:
|
||
</p>
|
||
<div class="table">
|
||
<a name="chrono.reference.io.ios_state_hpp.sag.set_time_fmt.format_tags"></a><p class="title"><b>Table 7.3. Format tags</b></p>
|
||
<div class="table-contents"><table class="table" summary="Format tags">
|
||
<colgroup>
|
||
<col>
|
||
<col>
|
||
<col>
|
||
</colgroup>
|
||
<thead><tr>
|
||
<th>
|
||
<p>
|
||
Format Specifier
|
||
</p>
|
||
</th>
|
||
<th>
|
||
<p>
|
||
Description
|
||
</p>
|
||
</th>
|
||
<th>
|
||
<p>
|
||
Example
|
||
</p>
|
||
</th>
|
||
</tr></thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%%</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Replaced by <code class="computeroutput"><span class="special">%</span></code>.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">a</span>
|
||
<span class="special">%</span><span class="identifier">A</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The day of the week, using the locale's weekday names; either
|
||
the abbreviated or full name may be specified.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
"Monday".
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">b</span>
|
||
<span class="special">%</span><span class="identifier">B</span>
|
||
<span class="special">%</span><span class="identifier">h</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The month, using the locale's month names; either the abbreviated
|
||
or full name may be specified.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
"February".
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">c</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Not supported.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">d</span>
|
||
<span class="special">%</span><span class="identifier">e</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The day of the month <code class="computeroutput"><span class="special">[</span><span class="number">01</span><span class="special">,</span><span class="number">31</span><span class="special">]</span></code>;
|
||
leading zeros are permitted but not required..
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">D</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The date as <code class="computeroutput"><span class="special">%</span><span class="identifier">m</span><span class="special">/%</span><span class="identifier">d</span><span class="special">/%</span><span class="identifier">y</span></code>.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">F</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The date as <code class="computeroutput"><span class="special">%</span><span class="identifier">Y</span><span class="special">/%</span><span class="identifier">m</span><span class="special">/%</span><span class="identifier">d</span></code>.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">H</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The hour (24-hour clock) <code class="computeroutput"><span class="special">[</span><span class="number">00</span><span class="special">,</span><span class="number">23</span><span class="special">]</span></code>;
|
||
leading zeros are permitted but not required.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">I</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The hour (12-hour clock) <code class="computeroutput"><span class="special">[</span><span class="number">01</span><span class="special">,</span><span class="number">12</span><span class="special">]</span></code>;
|
||
leading zeros are permitted but not required.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">j</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The day number of the year <code class="computeroutput"><span class="special">[</span><span class="number">001</span><span class="special">,</span><span class="number">366</span><span class="special">]</span></code>;
|
||
leading zeros are permitted but not required.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
"060" => Feb-29.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">m</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The month number <code class="computeroutput"><span class="special">[</span><span class="number">01</span><span class="special">,</span><span class="number">12</span><span class="special">]</span></code>;
|
||
leading zeros are permitted but not required..
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
"01" => January.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">M</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The minute <code class="computeroutput"><span class="special">[</span><span class="number">00</span><span class="special">,</span><span class="number">59</span><span class="special">]</span></code>;
|
||
leading zeros are permitted but not required.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">n</span>
|
||
<span class="special">%</span><span class="identifier">t</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Any white space..
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">p</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Not supported.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">r</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Not supported.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">R</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The time as <code class="computeroutput"><span class="special">%</span><span class="identifier">H</span><span class="special">:%</span><span class="identifier">M</span></code>.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">S</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The seconds <code class="computeroutput"><span class="special">[</span><span class="number">00</span><span class="special">,</span><span class="number">60</span><span class="special">]</span></code>;
|
||
leading zeros are permitted but not required.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">T</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The time as <code class="computeroutput"><span class="special">%</span><span class="identifier">H</span><span class="special">:%</span><span class="identifier">M</span><span class="special">:%</span><span class="identifier">S</span></code>.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">U</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Not supported.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">w</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The weekday as a decimal number <code class="computeroutput"><span class="special">[</span><span class="number">0</span><span class="special">,</span><span class="number">6</span><span class="special">]</span></code>,
|
||
with 0 representing Sunday; leading zeros are permitted but
|
||
not required..
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
"0" => Sunday.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">W</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Not supported.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">x</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The date, using the locale's date format..
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">X</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Not supported.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">y</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
Not supported.
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
"2005".
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>
|
||
<p>
|
||
<code class="computeroutput"><span class="special">%</span><span class="identifier">Y</span></code>
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
The year, including the century (for example, 1988).
|
||
</p>
|
||
</td>
|
||
<td>
|
||
<p>
|
||
.
|
||
</p>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table></div>
|
||
</div>
|
||
<br class="table-break">
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss" title="I/O State Savers">I/O State
|
||
Savers</a>
|
||
</h5></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver" title="Template Class duration_style_io_saver">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_style_io_saver</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="comment">// i/o state savers</span>
|
||
|
||
<span class="keyword">struct</span> <span class="identifier">duration_style_io_saver</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span> <span class="identifier">state_type</span><span class="special">;</span> <span class="comment">// the state type is ios_base</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">duration_style</span></code></a> <span class="identifier">aspect_type</span><span class="special">;</span> <span class="comment">// the aspect type is the __duration_style</span>
|
||
|
||
<span class="keyword">explicit</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.c1" title="Constructor duration_style_io_saver(state_type&)"><code class="computeroutput"><span class="identifier">duration_style_io_saver</span></code></a><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">);</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.c2" title="Constructor duration_style_io_saver(state_type&, aspect_type)"><code class="computeroutput"><span class="identifier">duration_style_io_saver</span></code></a><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">aspect_type</span> <span class="identifier">new_value</span><span class="special">);</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.d" title="Destructor ~duration_style_io_saver()"><code class="computeroutput"><span class="special">~</span><span class="identifier">duration_style_io_saver</span></code></a><span class="special">();</span>
|
||
<span class="keyword">void</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.restore" title="Member Function restore()"><code class="computeroutput"><span class="identifier">restore</span></code></a><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
The <code class="computeroutput"><span class="identifier">state_type</span></code> is a
|
||
version of the IOStreams base class <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span></code>.
|
||
</p>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.c1"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.c1" title="Constructor duration_style_io_saver(state_type&)">Constructor
|
||
<code class="computeroutput"><span class="identifier">duration_style_io_saver</span><span class="special">(</span><span class="identifier">state_type</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
This constructor takes a stream object and saves a reference to the
|
||
stream and the current value of a particular stream attribute.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">duration_style_io_saver</span><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs a <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver" title="Template Class duration_style_io_saver"><code class="computeroutput"><span class="identifier">duration_style_io_saver</span></code></a>
|
||
by storing <code class="computeroutput"><span class="identifier">s</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.c2"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.c2" title="Constructor duration_style_io_saver(state_type&, aspect_type)">Constructor
|
||
<code class="computeroutput"><span class="identifier">duration_style_io_saver</span><span class="special">(</span><span class="identifier">state_type</span><span class="special">&,</span> <span class="identifier">aspect_type</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
This constructor works like the previous one, and in addition uses
|
||
its second argument to change the stream's attribute to the new
|
||
<code class="computeroutput"><span class="identifier">aspect_type</span></code> value
|
||
given.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">duration_style_io_saver</span><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">aspect_type</span> <span class="identifier">new_value</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs a <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver" title="Template Class duration_style_io_saver"><code class="computeroutput"><span class="identifier">duration_style_io_saver</span></code></a>
|
||
by storing <code class="computeroutput"><span class="identifier">s</span></code>. Sets
|
||
the <code class="computeroutput"><span class="identifier">state_type</span></code> <code class="computeroutput"><span class="identifier">aspect_type</span></code> with the value <code class="computeroutput"><span class="identifier">new_value</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.d"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.d" title="Destructor ~duration_style_io_saver()">Destructor
|
||
<code class="computeroutput"><span class="special">~</span><span class="identifier">duration_style_io_saver</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
The destructor restores the stream's attribute to the saved value.
|
||
</p>
|
||
<pre class="programlisting"><span class="special">~</span><span class="identifier">duration_style_io_saver</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> As if <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.restore" title="Member Function restore()"><code class="computeroutput"><span class="identifier">restore</span></code></a>().
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.restore"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.duration_style_io_saver.restore" title="Member Function restore()">Member
|
||
Function <code class="computeroutput"><span class="identifier">restore</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
The restoration can be activated early (and often) with the restore
|
||
member function.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">restore</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Restores the stream's
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">duration_style</span></code></a> attribute
|
||
to the saved value.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver" title="Template Class timezone_io_saver<>">Template
|
||
Class <code class="computeroutput"><span class="identifier">timezone_io_saver</span><span class="special"><></span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span> <span class="special">=</span> <span class="keyword">char</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver" title="Template Class timezone_io_saver<>"><code class="computeroutput"><span class="identifier">timezone_io_saver</span></code></a>
|
||
<span class="special">{</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ios</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">></span> <span class="identifier">state_type</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">timezone</span></code></a> <span class="identifier">aspect_type</span><span class="special">;</span>
|
||
|
||
<span class="keyword">explicit</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.c1" title="Constructor timezone_io_saver(state_type&)"><code class="computeroutput"><span class="identifier">timezone_io_saver</span></code></a><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">);</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.c2" title="Constructor timezone_io_saver(state_type&, aspect_type)"><code class="computeroutput"><span class="identifier">timezone_io_saver</span></code></a><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">aspect_type</span> <span class="identifier">new_value</span><span class="special">);</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.d" title="Destructor ~timezone_io_saver()"><code class="computeroutput"><span class="special">~</span><span class="identifier">timezone_io_saver</span></code></a><span class="special">();</span>
|
||
<span class="keyword">void</span> <span class="identifier">timezone_io_saver__restore</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
The <code class="computeroutput"><span class="identifier">state_type</span></code> is a
|
||
version of the IOStreams base class template <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ios</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">></span></code>, where <code class="computeroutput"><span class="identifier">CharT</span></code>
|
||
is a character type and <code class="computeroutput"><span class="identifier">Traits</span></code>
|
||
is a character traits class. The user would usually place an actual
|
||
input, output, or combined stream object for the state-type parameter,
|
||
and not a base class object.
|
||
</p>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.c1"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.c1" title="Constructor timezone_io_saver(state_type&)">Constructor
|
||
<code class="computeroutput"><span class="identifier">timezone_io_saver</span><span class="special">(</span><span class="identifier">state_type</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
This constructor takes a stream object and saves a reference to the
|
||
stream and the current value of a particular stream attribute.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">timezone_io_saver</span><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs a <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver" title="Template Class timezone_io_saver<>"><code class="computeroutput"><span class="identifier">timezone_io_saver</span></code></a> by storing
|
||
<code class="computeroutput"><span class="identifier">s</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.c2"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.c2" title="Constructor timezone_io_saver(state_type&, aspect_type)">Constructor
|
||
<code class="computeroutput"><span class="identifier">timezone_io_saver</span><span class="special">(</span><span class="identifier">state_type</span><span class="special">&,</span>
|
||
<span class="identifier">aspect_type</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
This constructor works like the previous one, and uses its second
|
||
argument to change the stream's attribute to the new aspect_type
|
||
value given.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">timezone_io_saver</span><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">aspect_type</span> <span class="identifier">new_value</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs a <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver" title="Template Class timezone_io_saver<>"><code class="computeroutput"><span class="identifier">timezone_io_saver</span></code></a> by storing
|
||
<code class="computeroutput"><span class="identifier">s</span></code>. Sets the <code class="computeroutput"><span class="identifier">state_type</span></code> <code class="computeroutput"><span class="identifier">aspect_type</span></code>
|
||
with the value <code class="computeroutput"><span class="identifier">new_value</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.d"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.d" title="Destructor ~timezone_io_saver()">Destructor
|
||
<code class="computeroutput"><span class="special">~</span><span class="identifier">timezone_io_saver</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
The destructor restores the stream's attribute to the saved value.
|
||
</p>
|
||
<pre class="programlisting"><span class="special">~</span><span class="identifier">timezone_io_saver</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> As if <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.restore" title="Member Function restore()"><code class="computeroutput"><span class="identifier">restore</span></code></a>().
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.restore"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.restore" title="Member Function restore()">Member
|
||
Function <code class="computeroutput"><span class="identifier">restore</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
The restoration can be activated early (and often) with the restore
|
||
member function.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">restore</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Restores the stream's
|
||
<a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">timezone</span></code></a> attribute to the
|
||
saved value.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver" title="Template Class time_fmt_io_saver<>">Template
|
||
Class <code class="computeroutput"><span class="identifier">time_fmt_io_saver</span><span class="special"><></span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span> <span class="special">=</span> <span class="keyword">char</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver" title="Template Class time_fmt_io_saver<>"><code class="computeroutput"><span class="identifier">time_fmt_io_saver</span></code></a>
|
||
<span class="special">{</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ios</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">></span> <span class="identifier">state_type</span><span class="special">;</span>
|
||
|
||
<span class="keyword">explicit</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.c1" title="Constructor time_fmt_io_saver(state_type&)"><code class="computeroutput"><span class="identifier">time_fmt_io_saver</span></code></a><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">);</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.c2" title="Constructor time_fmt_io_saver(state_type&, aspect_type)"><code class="computeroutput"><span class="identifier">time_fmt_io_saver</span></code></a><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">new_value</span><span class="special">);</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.d" title="Destructor ~time_fmt_io_saver()"><code class="computeroutput"><span class="special">~</span><span class="identifier">time_fmt_io_saver</span></code></a><span class="special">();</span>
|
||
<span class="keyword">void</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.restore" title="Member Function restore()"><code class="computeroutput"><span class="identifier">restore</span></code></a><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
The <code class="computeroutput"><span class="identifier">state_type</span></code> is a
|
||
version of the IOStreams base class template <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ios</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">></span></code>, where <code class="computeroutput"><span class="identifier">CharT</span></code>
|
||
is a character type and <code class="computeroutput"><span class="identifier">Traits</span></code>
|
||
is a character traits class. The user would usually place an actual
|
||
input, output, or combined stream object for the state-type parameter,
|
||
and not a base class object.
|
||
</p>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.c1"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.c1" title="Constructor time_fmt_io_saver(state_type&)">Constructor
|
||
<code class="computeroutput"><span class="identifier">time_fmt_io_saver</span><span class="special">(</span><span class="identifier">state_type</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
This constructor takes a stream object and saves a reference to the
|
||
stream and the current value of a particular stream attribute.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">time_fmt_io_saver</span><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs a <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver" title="Template Class time_fmt_io_saver<>"><code class="computeroutput"><span class="identifier">time_fmt_io_saver</span></code></a> by storing
|
||
<code class="computeroutput"><span class="identifier">s</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.c2"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.c2" title="Constructor time_fmt_io_saver(state_type&, aspect_type)">Constructor
|
||
<code class="computeroutput"><span class="identifier">time_fmt_io_saver</span><span class="special">(</span><span class="identifier">state_type</span><span class="special">&,</span>
|
||
<span class="identifier">aspect_type</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
This constructor works like the previous one, and uses its second
|
||
argument to change the stream's attribute to the new aspect_type
|
||
value given.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">time_fmt_io_saver</span><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">aspect_type</span> <span class="identifier">new_value</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs a <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver" title="Template Class time_fmt_io_saver<>"><code class="computeroutput"><span class="identifier">time_fmt_io_saver</span></code></a> by storing
|
||
<code class="computeroutput"><span class="identifier">s</span></code>. Sets the <code class="computeroutput"><span class="identifier">state_type</span></code> <code class="computeroutput"><span class="identifier">aspect_type</span></code>
|
||
with the value <code class="computeroutput"><span class="identifier">new_value</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.d"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.d" title="Destructor ~time_fmt_io_saver()">Destructor
|
||
<code class="computeroutput"><span class="special">~</span><span class="identifier">time_fmt_io_saver</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
The destructor restores the stream's attribute to the saved value.
|
||
</p>
|
||
<pre class="programlisting"><span class="special">~</span><span class="identifier">time_fmt_io_saver</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> As if <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.restore" title="Member Function restore()"><code class="computeroutput"><span class="identifier">restore</span></code></a>().
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.restore"></a><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver.restore" title="Member Function restore()">Member
|
||
Function <code class="computeroutput"><span class="identifier">restore</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
The restoration can be activated early (and often) with the restore
|
||
member function.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">restore</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Restores the stream's time
|
||
format attribute to the saved value.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.duration_get_hpp"></a><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp" title="Header <boost/chrono/io/duration_get.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_get</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc"><dt><span class="section"><a href="reference.html#chrono.reference.io.duration_get_hpp.duration_get">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_get</span></code></a></span></dt></dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">InputIterator</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">istreambuf_iterator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get" title="Template Class duration_get"><code class="computeroutput"><span class="identifier">duration_get</span></code></a><span class="special">;</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.duration_get_hpp.duration_get"></a><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get" title="Template Class duration_get">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_get</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">InputIterator</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">istreambuf_iterator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">duration_get</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">facet</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span> <span class="comment">// Type of character the facet is instantiated on</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span> <span class="comment">// Type of character string passed to member functions.</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">InputIterator</span> <span class="identifier">iter_type</span><span class="special">;</span> <span class="comment">// Type of iterator used to scan the character buffer.</span>
|
||
|
||
<span class="keyword">explicit</span> <a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.c" title="Constructor duration_get(size_t)"><code class="computeroutput"><span class="identifier">duration_get</span></code></a><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.get" title="Template Member Function get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,duration<Rep,Period>&,const char_type*, const char_type*) const"><code class="computeroutput"><span class="identifier">get</span></code></a><span class="special">(</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">end</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">char_type</span><span class="special">*</span> <span class="identifier">pattern</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">char_type</span><span class="special">*</span> <span class="identifier">pat_end</span>
|
||
<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.get2" title="Template Member Function get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,duration<Rep,Period>&) const"><code class="computeroutput"><span class="identifier">get</span></code></a><span class="special">(</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">end</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span>
|
||
<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.get_value" title="Template Member Function get_value(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,Rep&) const"><code class="computeroutput"><span class="identifier">get_value</span></code></a><span class="special">(</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">end</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">Rep</span><span class="special">&</span> <span class="identifier">r</span>
|
||
<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="identifier">iter_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.get_unit" title="Member Function get_unit(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,rt_ratio&) const"><code class="computeroutput"><span class="identifier">get_unit</span></code></a><span class="special">(</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">e</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">is</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">detail</span><span class="special">::</span><span class="identifier">rt_ratio</span> <span class="special">&</span><span class="identifier">rt</span>
|
||
<span class="special">)</span> <span class="keyword">const</span>
|
||
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">;</span> <span class="comment">// Unique identifier for this type of facet.</span>
|
||
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.d" title="Destructor ~duration_get()"><code class="computeroutput"><span class="special">~</span><span class="identifier">duration_get</span></code></a><span class="special">()</span>
|
||
<span class="special">{</span>
|
||
<span class="special">}</span>
|
||
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
The <a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get" title="Template Class duration_get"><code class="computeroutput"><span class="identifier">duration_get</span></code></a> facet extracts
|
||
duration from a character string and stores the resulting value in a
|
||
class duration d argument. The facet parses the string using a specific
|
||
format as a guide. If the string does not fit the format, then the facet
|
||
will indicate an error by setting the err argument to iosbase::failbit.
|
||
In other words, user confirmation is required for reliable parsing of
|
||
user-entered durations, but machine-generated formats can be parsed reliably.
|
||
This allows parsers to be aggressive about interpreting user variations
|
||
on standard formats.
|
||
</p>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_get_hpp.duration_get.c"></a><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.c" title="Constructor duration_get(size_t)">Constructor
|
||
<code class="computeroutput"><span class="identifier">duration_get</span><span class="special">(</span><span class="identifier">size_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">duration_get</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
Constructs a <a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get" title="Template Class duration_get"><code class="computeroutput"><span class="identifier">duration_get</span></code></a> facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>refs:</strong></span> references
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs a <a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get" title="Template Class duration_get"><code class="computeroutput"><span class="identifier">duration_get</span></code></a> facet. If the
|
||
<code class="computeroutput"><span class="identifier">refs</span></code> argument is <code class="computeroutput"><span class="number">0</span></code> then destruction of the object is delegated
|
||
to the locale, or locales, containing it. This allows the user to ignore
|
||
lifetime management issues. On the other had, if <code class="computeroutput"><span class="identifier">refs</span></code>
|
||
is <code class="computeroutput"><span class="number">1</span></code> then the object must
|
||
be explicitly deleted; <code class="computeroutput"><span class="identifier">locale</span></code>
|
||
will not do so. In this case, the object can be maintained across the
|
||
lifetime of multiple locales.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_get_hpp.duration_get.d"></a><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.d" title="Destructor ~duration_get()">Destructor
|
||
<code class="computeroutput"><span class="special">~</span><span class="identifier">duration_get</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="special">~</span><span class="identifier">duration_get</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
Destructs a <a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get" title="Template Class duration_get"><code class="computeroutput"><span class="identifier">duration_get</span></code></a> facet.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_get_hpp.duration_get.get"></a><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.get" title="Template Member Function get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,duration<Rep,Period>&,const char_type*, const char_type*) const">Template
|
||
Member Function <code class="computeroutput"><span class="identifier">get</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&,</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span><span class="identifier">Period</span><span class="special">>&,</span><span class="keyword">const</span> <span class="identifier">char_type</span><span class="special">*,</span> <span class="keyword">const</span> <span class="identifier">char_type</span><span class="special">*)</span>
|
||
<span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">iter_type</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="special">&</span><span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span><span class="identifier">pattern</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span><span class="identifier">pat_end</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
Extracts a duration from the range <code class="computeroutput"><span class="special">[</span><span class="identifier">s</span><span class="special">,</span><span class="identifier">end</span><span class="special">)</span></code>
|
||
following the pattern <code class="computeroutput"><span class="special">[</span><span class="identifier">pattern</span><span class="special">,</span><span class="identifier">pat_end</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> start input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>end:</strong></span> end input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>err:</strong></span> the ios_base state
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>d:</strong></span> the duration
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pattern:</strong></span> begin of the formatting
|
||
pattern
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pat_end:</strong></span> end of the formatting
|
||
pattern
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Requires:</strong></span> <code class="computeroutput"><span class="special">[</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">end</span><span class="special">)</span> <span class="keyword">and</span> <span class="special">[</span><span class="identifier">pattern</span><span class="special">,</span>
|
||
<span class="identifier">pat_end</span><span class="special">)</span></code>
|
||
shall be valid ranges.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> The function starts by evaluating
|
||
<code class="computeroutput"><span class="identifier">err</span> <span class="special">=</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">goodbit</span></code>.
|
||
</p>
|
||
<p>
|
||
Then it computes an intermediate representation based on <code class="computeroutput"><span class="identifier">Rep</span></code> according to the following rules:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
If <code class="computeroutput"><span class="identifier">Rep</span></code> is a floating
|
||
point type, the intermediate representation is <code class="computeroutput"><span class="keyword">long</span>
|
||
<span class="keyword">double</span></code>.
|
||
</li>
|
||
<li class="listitem">
|
||
Else if <code class="computeroutput"><span class="identifier">Rep</span></code> is
|
||
a signed integral type, the intermediate representation is <code class="computeroutput"><span class="keyword">long</span> <span class="keyword">long</span></code>.
|
||
</li>
|
||
<li class="listitem">
|
||
Else if <code class="computeroutput"><span class="identifier">Rep</span></code> is
|
||
an unsigned integral type, the intermediate representation is unsigned
|
||
long long.
|
||
</li>
|
||
<li class="listitem">
|
||
Else intermediate representation is <code class="computeroutput"><span class="identifier">Rep</span></code>.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
Next the following local variable <code class="computeroutput"><span class="identifier">r</span></code>
|
||
of type intermediate representation and <code class="computeroutput"><span class="identifier">rt</span></code>
|
||
of type <code class="computeroutput"><span class="identifier">rt_ratio</span></code> are
|
||
default constructed.
|
||
</p>
|
||
<p>
|
||
It then enters a loop, reading zero or more characters from <code class="computeroutput"><span class="identifier">s</span></code> at each iteration. Unless otherwise
|
||
specified below, the loop terminates when the first of the following
|
||
conditions holds:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
The expression <code class="computeroutput"><span class="identifier">pattern</span>
|
||
<span class="special">==</span> <span class="identifier">pat_end</span></code>
|
||
evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||
</li>
|
||
<li class="listitem">
|
||
The expression <code class="computeroutput"><span class="identifier">err</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">goodbit</span></code>
|
||
evaluates to false.
|
||
</li>
|
||
<li class="listitem">
|
||
The expression <code class="computeroutput"><span class="identifier">s</span> <span class="special">==</span> <span class="identifier">end</span></code>
|
||
evaluates to <code class="computeroutput"><span class="keyword">true</span></code>,
|
||
in which case the function evaluates <code class="computeroutput"><span class="identifier">err</span>
|
||
<span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">eofbit</span>
|
||
<span class="special">|</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>.
|
||
</li>
|
||
<li class="listitem">
|
||
The next element of pattern is equal to <code class="computeroutput"><span class="char">'%'</span></code>,
|
||
followed by a conversion specifier character, format. If the number
|
||
of elements in the range <code class="computeroutput"><span class="special">[</span><span class="identifier">pattern</span><span class="special">,</span><span class="identifier">pat_end</span><span class="special">)</span></code>
|
||
is not sufficient to unambiguously determine whether the conversion
|
||
specification is complete and valid, the function evaluates <code class="computeroutput"><span class="identifier">err</span> <span class="special">=</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>. Otherwise, the function
|
||
evaluates <code class="computeroutput"><span class="identifier">s</span> <span class="special">=</span>
|
||
<span class="identifier">get_value</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span>
|
||
<span class="identifier">end</span><span class="special">,</span>
|
||
<span class="identifier">ios</span><span class="special">,</span>
|
||
<span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">r</span><span class="special">)</span></code>
|
||
when the conversion specification is 'v' and <code class="computeroutput"><span class="identifier">s</span>
|
||
<span class="special">=</span> <span class="identifier">get_value</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">err</span><span class="special">,</span> <span class="identifier">rt</span><span class="special">)</span></code> when the conversion specification
|
||
is 'u'. If <code class="computeroutput"><span class="identifier">err</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">goodbit</span></code>
|
||
holds after the evaluation of the expression, the function increments
|
||
pattern to point just past the end of the conversion specification
|
||
and continues looping.
|
||
</li>
|
||
<li class="listitem">
|
||
The expression <code class="computeroutput"><span class="identifier">isspace</span><span class="special">(*</span><span class="identifier">pattern</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">.</span><span class="identifier">getloc</span><span class="special">())</span></code> evaluates to <code class="computeroutput"><span class="keyword">true</span></code>,
|
||
in which case the function first increments pattern until <code class="computeroutput"><span class="identifier">pattern</span> <span class="special">==</span>
|
||
<span class="identifier">pat_end</span> <span class="special">||</span>
|
||
<span class="special">!</span><span class="identifier">isspace</span><span class="special">(*</span><span class="identifier">pattern</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">.</span><span class="identifier">getloc</span><span class="special">())</span></code> evaluates to <code class="computeroutput"><span class="keyword">true</span></code>,
|
||
then advances <code class="computeroutput"><span class="identifier">s</span></code>
|
||
until <code class="computeroutput"><span class="identifier">s</span> <span class="special">==</span>
|
||
<span class="identifier">end</span> <span class="special">||</span>
|
||
<span class="special">!</span><span class="identifier">isspace</span><span class="special">(*</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">.</span><span class="identifier">getloc</span><span class="special">())</span></code> is <code class="computeroutput"><span class="keyword">true</span></code>,
|
||
and finally resumes looping.
|
||
</li>
|
||
<li class="listitem">
|
||
The next character read from <code class="computeroutput"><span class="identifier">s</span></code>
|
||
matches the element pointed to by pattern in a case-insensitive
|
||
comparison, in which case the function evaluates <code class="computeroutput"><span class="special">++</span><span class="identifier">pattern</span><span class="special">,</span> <span class="special">++</span><span class="identifier">s</span></code> and continues looping. Otherwise,
|
||
the function evaluates <code class="computeroutput"><span class="identifier">err</span>
|
||
<span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
If a duration representation value and a unit specifier have successfully
|
||
been parsed, compute <code class="computeroutput"><span class="special">(</span><span class="identifier">rt</span><span class="special">.</span><span class="identifier">num</span><span class="special">/</span><span class="identifier">rt</span><span class="special">.</span><span class="identifier">den</span><span class="special">)/(</span><span class="identifier">Period</span><span class="special">::</span><span class="identifier">num</span><span class="special">/</span><span class="identifier">Period</span><span class="special">::</span><span class="identifier">den</span><span class="special">)</span></code>
|
||
reduced to lowest terms. If this ratio can not be stored without overflow,
|
||
evaluates <code class="computeroutput"><span class="identifier">err</span> <span class="special">=</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>. Otherwise store the result
|
||
of this division in <code class="computeroutput"><span class="identifier">num</span></code>
|
||
and <code class="computeroutput"><span class="identifier">den</span></code>.
|
||
</p>
|
||
<p>
|
||
If the division did not result in overflow, then compute <code class="computeroutput"><span class="identifier">r</span> <span class="special">*</span> <span class="identifier">num</span> <span class="special">/</span> <span class="identifier">den</span></code> in such a way as to avoid intermediate
|
||
overflow. If <code class="computeroutput"><span class="identifier">r</span></code> has
|
||
integral type and this computation would not be exact, evaluates <code class="computeroutput"><span class="identifier">err</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>. If the result of the computation
|
||
would overflow <code class="computeroutput"><span class="identifier">Rep</span></code>,
|
||
evaluates <code class="computeroutput"><span class="identifier">err</span> <span class="special">=</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>. Otherwise the result of
|
||
<code class="computeroutput"><span class="identifier">r</span> <span class="special">*</span>
|
||
<span class="identifier">num</span> <span class="special">/</span>
|
||
<span class="identifier">den</span></code> is used to construct
|
||
a <code class="computeroutput"><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span></code>
|
||
which is assigned to <code class="computeroutput"><span class="identifier">d</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">s</span></code>,
|
||
an iterator pointing just beyond the last character that can be determined
|
||
to be part of a valid duration.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_get_hpp.duration_get.get2"></a><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.get2" title="Template Member Function get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,duration<Rep,Period>&) const">Template
|
||
Member Function <code class="computeroutput"><span class="identifier">get</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&,</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span><span class="identifier">Period</span><span class="special">>&)</span>
|
||
<span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">get</span><span class="special">(</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">end</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span>
|
||
<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
Extracts a duration from the range <code class="computeroutput"><span class="special">[</span><span class="identifier">s</span><span class="special">,</span><span class="identifier">end</span><span class="special">)</span></code>
|
||
following the default pattern.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> start input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>end:</strong></span> end input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>err:</strong></span> the ios_base state
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>d:</strong></span> the duration
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Stores the duration pattern
|
||
from the __duration_unit facet associated to 'ios<code class="computeroutput"> <span class="identifier">in</span>
|
||
<span class="identifier">let</span> <span class="identifier">say</span>
|
||
</code>str`. Last as if
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">return</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">err</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">d</span><span class="special">,</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">data</span><span class="special">(),</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">data</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">size</span><span class="special">());</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">s</span></code>,
|
||
an iterator pointing just beyond the last character that can be determined
|
||
to be part of a valid duration.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_get_hpp.duration_get.get_value"></a><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.get_value" title="Template Member Function get_value(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,Rep&) const">Template
|
||
Member Function <code class="computeroutput"><span class="identifier">get_value</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&,</span><span class="identifier">Rep</span><span class="special">&)</span> <span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">get_value</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">iter_type</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span> <span class="identifier">Rep</span><span class="special">&</span> <span class="identifier">r</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
Extracts a duration representation from the range <code class="computeroutput"><span class="special">[</span><span class="identifier">s</span><span class="special">,</span><span class="identifier">end</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> start input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>end:</strong></span> end input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>err:</strong></span> the ios_base state
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>r:</strong></span> a reference to the duration
|
||
representation
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> As if
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">use_facet</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">num_get</span><span class="special"><</span><span class="identifier">char_type</span><span class="special">,</span> <span class="identifier">iter_type</span><span class="special">>>(</span><span class="identifier">ios</span><span class="special">.</span><span class="identifier">getloc</span><span class="special">()).</span><span class="identifier">get</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">err</span><span class="special">,</span> <span class="identifier">r</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">s</span></code>,
|
||
an iterator pointing just beyond the last character that can be determined
|
||
to be part of a valid <code class="computeroutput"><span class="identifier">Rep</span></code>
|
||
value.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_get_hpp.duration_get.get_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.get_unit" title="Member Function get_unit(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,rt_ratio&) const">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_unit</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&,</span><span class="identifier">rt_ratio</span><span class="special">&)</span>
|
||
<span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="identifier">iter_type</span> <span class="identifier">get_unit</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">iter_type</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span> <span class="identifier">detail</span><span class="special">::</span><span class="identifier">rt_ratio</span> <span class="special">&</span><span class="identifier">rt</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
Extracts a duration unit from the range <code class="computeroutput"><span class="special">[</span><span class="identifier">s</span><span class="special">,</span><span class="identifier">end</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> start input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>end:</strong></span> end input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>err:</strong></span> the ios_base state
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>rt:</strong></span> a reference to the duration
|
||
run-time ratio.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
If the first character is <code class="computeroutput"><span class="char">'['</span></code>,
|
||
an attempt is made to consume a pattern of the form <code class="computeroutput"><span class="string">"[N/D]"</span></code> where <code class="computeroutput"><span class="identifier">N</span></code> and <code class="computeroutput"><span class="identifier">D</span></code>
|
||
have type <code class="computeroutput"><span class="keyword">unsigned</span> <span class="keyword">long</span> <span class="keyword">long</span></code>.
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
|
||
<li class="listitem">
|
||
If successful, rt records the values of <code class="computeroutput"><span class="identifier">N</span></code>
|
||
and <code class="computeroutput"><span class="identifier">D</span></code>, otherwise
|
||
evaluates <code class="computeroutput"><span class="identifier">err</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>
|
||
and return <code class="computeroutput"><span class="identifier">i</span></code>.
|
||
</li>
|
||
<li class="listitem">
|
||
Return the parse the longest string possible matching one
|
||
of the durations units that can follow the pattern <code class="computeroutput"><span class="string">"[N/D]"</span></code>, as if
|
||
</li>
|
||
</ul></div>
|
||
</li></ul></div>
|
||
<pre class="programlisting"><span class="keyword">return</span> <span class="identifier">do_get_n_d_prefix_unit</span><span class="special">(</span><span class="identifier">facet</span><span class="special">,</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">err</span><span class="special">);</span>
|
||
</pre>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
Otherwise the next character is not <code class="computeroutput"><span class="char">'['</span></code>.
|
||
Return the parse the longest string possible matching one of the
|
||
durations units, as if
|
||
</li></ul></div>
|
||
<pre class="programlisting"><span class="keyword">return</span> <span class="identifier">do_get_prefix_unit</span><span class="special">(</span><span class="identifier">facet</span><span class="special">,</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">err</span><span class="special">,</span> <span class="identifier">rt</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">i</span></code>,
|
||
an iterator pointing just beyond the last character that can be determined
|
||
to be part of a valid duration unit.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_get_hpp.duration_get.do_get_n_d_prefix_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.do_get_n_d_prefix_unit" title="Protected Member Function do_get_n_d_prefix_unit(duration_units<CharT> const&,iter_type,iter_type,std::ios_base&,std::ios_base::iostate&) const">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_n_d_prefix_unit</span><span class="special">(</span><span class="identifier">duration_units</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="keyword">const</span><span class="special">&,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&)</span> <span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">iter_type</span> <span class="identifier">do_get_n_d_prefix_unit</span><span class="special">(</span>
|
||
<span class="identifier">duration_units</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="keyword">const</span> <span class="special">&</span><span class="identifier">facet</span><span class="special">,</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">e</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span>
|
||
<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
Extracts the run-time ratio associated to the duration when it is given
|
||
in [N/D] form.
|
||
</p>
|
||
<p>
|
||
This is an extension point of this facet so that we can take in account
|
||
other periods that can have a useful translation in other contexts,
|
||
as e.g. days and weeks.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> start input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>end:</strong></span> end input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>err:</strong></span> the ios_base state
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>rt:</strong></span> a reference to the duration
|
||
run-time ratio.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Scan <code class="computeroutput"><span class="identifier">s</span></code>
|
||
for the longest of all the plural forms associated with the duration
|
||
units. If successful, sets the matched ratio in <code class="computeroutput"><span class="identifier">rt</span></code>.
|
||
Otherwise evaluates <code class="computeroutput"><span class="identifier">err</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">s</span></code>,
|
||
an iterator pointing just beyond the last character that can be determined
|
||
to be part of a valid name.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_get_hpp.duration_get.do_get_prefix_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.do_get_prefix_unit" title="Protected Member Function do_get_prefix_unit(duration_units<CharT> const&,iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,detail::rt_ratio&) const">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_prefix_unit</span><span class="special">(</span><span class="identifier">duration_units</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="keyword">const</span><span class="special">&,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&,</span><span class="identifier">detail</span><span class="special">::</span><span class="identifier">rt_ratio</span><span class="special">&)</span> <span class="keyword">const</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">iter_type</span> <span class="identifier">do_get_prefix_unit</span><span class="special">(</span>
|
||
<span class="identifier">duration_units</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="keyword">const</span> <span class="special">&</span><span class="identifier">facet</span><span class="special">,</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">e</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">detail</span><span class="special">::</span><span class="identifier">rt_ratio</span> <span class="special">&</span><span class="identifier">rt</span>
|
||
<span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
Extracts the run-time ratio associated to the duration when it is given
|
||
in prefix form.
|
||
</p>
|
||
<p>
|
||
This is an extension point of this facet so that we can take in account
|
||
other periods that can have a useful translation in other contexts,
|
||
as e.g. days and weeks.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> start input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>end:</strong></span> end input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>err:</strong></span> the ios_base state
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>rt:</strong></span> a reference to the duration
|
||
run-time ratio.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Scan <code class="computeroutput"><span class="identifier">s</span></code>
|
||
for the longest of all the plural forms associated with the duration
|
||
units. If successful, sets the matched ratio in <code class="computeroutput"><span class="identifier">rt</span></code>.
|
||
Otherwise evaluates <code class="computeroutput"><span class="identifier">err</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">s</span></code>,
|
||
an iterator pointing just beyond the last character that can be determined
|
||
to be part of a valid name.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.duration_put_hpp"></a><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp" title="Header <boost/chrono/io/duration_put.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_put</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc"><dt><span class="section"><a href="reference.html#chrono.reference.io.duration_put_hpp.duration_put">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_put</span></code></a></span></dt></dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">OutputIterator</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostreambuf_iterator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put" title="Template Class duration_put"><code class="computeroutput"><span class="identifier">duration_put</span></code></a><span class="special">;</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.duration_put_hpp.duration_put"></a><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put" title="Template Class duration_put">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_put</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">OutputIterator</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostreambuf_iterator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">duration_put</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">facet</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span> <span class="comment">// Type of character the facet is instantiated on.</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span> <span class="comment">// Type of character string passed to member functions.</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">OutputIterator</span> <span class="identifier">iter_type</span><span class="special">;</span> <span class="comment">// Type of iterator used to write in the character buffer.</span>
|
||
|
||
<span class="keyword">explicit</span> <a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.c" title="Constructor duration_put(size_t)"><code class="computeroutput"><span class="identifier">duration_put</span></code></a><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.put" title="Member Function put(iter_type,std::ios_base&,char_type,duration<Rep,Period> const&, const CharT*,const CharT*)"><code class="computeroutput"><span class="identifier">put</span></code></a><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*</span> <span class="identifier">pattern</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*</span> <span class="identifier">pat_end</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.put2" title="Member Function put(iter_type,std::ios_base&,char_type fill, duration<Rep, Period> const&)"><code class="computeroutput"><span class="identifier">put</span></code></a><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.put_value" title="Member Function put_value(iter_type, std::ios_base&, char_type, duration<Rep,Period> const&)"><code class="computeroutput"><span class="identifier">put_value</span></code></a><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.put_unit" title="Member Function put_unit(iter_type,std::ios_base&,char_type,duration<Rep, Period> const&)"><code class="computeroutput"><span class="identifier">put_unit</span></code></a><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">;</span> <span class="comment">// Unique identifier for this type of facet.</span>
|
||
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.d" title="Destructor ~duration_put()"><code class="computeroutput"><span class="special">~</span><span class="identifier">duration_put</span></code></a><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_put_hpp.duration_put.c"></a><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.c" title="Constructor duration_put(size_t)">Constructor
|
||
<code class="computeroutput"><span class="identifier">duration_put</span><span class="special">(</span><span class="identifier">size_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">duration_put</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
Constructs a <a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put" title="Template Class duration_put"><code class="computeroutput"><span class="identifier">duration_put</span></code></a> facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>refs:</strong></span> references
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs a <a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put" title="Template Class duration_put"><code class="computeroutput"><span class="identifier">duration_put</span></code></a> facet. If the
|
||
<code class="computeroutput"><span class="identifier">refs</span></code> argument is <code class="computeroutput"><span class="number">0</span></code> then destruction of the object is delegated
|
||
to the locale, or locales, containing it. This allows the user to ignore
|
||
lifetime management issues. On the other had, if <code class="computeroutput"><span class="identifier">refs</span></code>
|
||
is <code class="computeroutput"><span class="number">1</span></code> then the object must
|
||
be explicitly deleted; <code class="computeroutput"><span class="identifier">locale</span></code>
|
||
will not do so. In this case, the object can be maintained across the
|
||
lifetime of multiple locales.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_put_hpp.duration_put.d"></a><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.d" title="Destructor ~duration_put()">Destructor
|
||
<code class="computeroutput"><span class="special">~</span><span class="identifier">duration_put</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="special">~</span><span class="identifier">duration_put</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
Destructs a <a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put" title="Template Class duration_put"><code class="computeroutput"><span class="identifier">duration_put</span></code></a> facet.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_put_hpp.duration_put.put"></a><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.put" title="Member Function put(iter_type,std::ios_base&,char_type,duration<Rep,Period> const&, const CharT*,const CharT*)">Member
|
||
Function <code class="computeroutput"><span class="identifier">put</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">char_type</span><span class="special">,</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span><span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">const</span><span class="special">&,</span>
|
||
<span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*,</span><span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*</span> <span class="identifier">pattern</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*</span> <span class="identifier">pat_end</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> an output stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>d:</strong></span> the duration
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pattern:</strong></span> begin of the formatting
|
||
pattern
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pat_end:</strong></span> end of the formatting
|
||
pattern
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Steps through the sequence
|
||
from <code class="computeroutput"><span class="identifier">pattern</span></code> to <code class="computeroutput"><span class="identifier">pat_end</span></code>, identifying characters that
|
||
are part of a pattern sequence. Each character that is not part of
|
||
a pattern sequence is written to <code class="computeroutput"><span class="identifier">s</span></code>
|
||
immediately, and each pattern sequence, as it is identified, results
|
||
in a call to <code class="computeroutput"><span class="identifier">put_value</span></code>
|
||
or <code class="computeroutput"><span class="identifier">put_unit</span></code>; thus,
|
||
pattern elements and other characters are interleaved in the output
|
||
in the order in which they appear in the pattern. Pattern sequences
|
||
are identified by converting each character <code class="computeroutput"><span class="identifier">c</span></code>
|
||
to a <code class="computeroutput"><span class="keyword">char</span></code> value as if
|
||
by <code class="computeroutput"><span class="identifier">ct</span><span class="special">.</span><span class="identifier">narrow</span><span class="special">(</span><span class="identifier">c</span><span class="special">,</span><span class="number">0</span><span class="special">)</span></code>, where
|
||
<code class="computeroutput"><span class="identifier">ct</span></code> is a reference to
|
||
<code class="computeroutput"><span class="identifier">ctype</span><span class="special"><</span><span class="identifier">charT</span><span class="special">></span></code>
|
||
obtained from <code class="computeroutput"><span class="identifier">ios</span><span class="special">.</span><span class="identifier">getloc</span><span class="special">()</span></code>.
|
||
The first character of each sequence is equal to <code class="computeroutput"><span class="char">'%'</span></code>,
|
||
followed by a pattern specifier character specifier, which can be
|
||
<code class="computeroutput"><span class="char">'v'</span></code> for the duration value
|
||
or <code class="computeroutput"><span class="char">'u'</span></code> for the duration unit.
|
||
. For each valid pattern sequence identified, calls <code class="computeroutput"><span class="identifier">put_value</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">d</span><span class="special">)</span></code> or <code class="computeroutput"><span class="identifier">put_unit</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">d</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> An iterator pointing immediately
|
||
after the last character produced.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_put_hpp.duration_put.put2"></a><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.put2" title="Member Function put(iter_type,std::ios_base&,char_type fill, duration<Rep, Period> const&)">Member
|
||
Function <code class="computeroutput"><span class="identifier">put</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> an output stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>d:</strong></span> the duration
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
Retrieves Stores the duration pattern from the __duration_unit facet
|
||
in let say <code class="computeroutput"><span class="identifier">str</span></code>. Last
|
||
as if
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">return</span> <span class="identifier">put</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">d</span><span class="special">,</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">data</span><span class="special">(),</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">data</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">size</span><span class="special">());</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> An iterator pointing immediately
|
||
after the last character produced.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_put_hpp.duration_put.put_value"></a><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.put_value" title="Member Function put_value(iter_type, std::ios_base&, char_type, duration<Rep,Period> const&)">Member
|
||
Function <code class="computeroutput"><span class="identifier">put_value</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span>
|
||
<span class="identifier">char_type</span><span class="special">,</span>
|
||
<span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span><span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">const</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put_value</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> an output stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>d:</strong></span> the duration
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> As if std::use_facet<std::num_put<CharT,
|
||
iter_type> >(ios.getloc()).put(s, ios, ' ', static_cast<long
|
||
int> (d.count())).
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> An iterator pointing immediately
|
||
after the last character produced.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_put_hpp.duration_put.put_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.put_unit" title="Member Function put_unit(iter_type,std::ios_base&,char_type,duration<Rep, Period> const&)">Member
|
||
Function <code class="computeroutput"><span class="identifier">put_unit</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">char_type</span><span class="special">,</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">const</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put_unit</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> an output stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>fill:</strong></span> the fill character
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>d:</strong></span> the duration
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Let <code class="computeroutput"><span class="identifier">facet</span></code>
|
||
be the <code class="computeroutput"><span class="identifier">duration_units</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code> facet associated to <code class="computeroutput"><span class="identifier">ios</span></code>. If the associated unit is named,
|
||
as if
|
||
</p>
|
||
<pre class="programlisting"><span class="identifier">string_type</span> <span class="identifier">str</span> <span class="special">=</span> <span class="identifier">facet</span><span class="special">.</span><span class="identifier">get_unit</span><span class="special">(</span><span class="identifier">get_duration_style</span><span class="special">(</span><span class="identifier">ios</span><span class="special">),</span> <span class="identifier">d</span><span class="special">);</span>
|
||
<span class="identifier">s</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">copy</span><span class="special">(</span><span class="identifier">str</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">s</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
Otherwise, format the unit as <code class="computeroutput"><span class="string">"[Period::num/Period::den]"</span></code>
|
||
followed by the unit associated to [N/D] obtained using <code class="computeroutput"><span class="identifier">facet</span><span class="special">.</span><span class="identifier">get_n_d_unit</span><span class="special">(</span><span class="identifier">get_duration_style</span><span class="special">(</span><span class="identifier">ios</span><span class="special">),</span> <span class="identifier">d</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> s, iterator pointing immediately
|
||
after the last character produced.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp" title="Header <boost/chrono/io/duration_units.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_units</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.duration_units_hpp.rt_ratio">Class
|
||
<code class="computeroutput"><span class="identifier">rt_ratio</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.duration_units_hpp.duration_units">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_units</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_units_default</span></code></a></span></dt>
|
||
</dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
<span class="keyword">class</span> <span class="identifier">rt_ratio</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span> <span class="special">=</span> <span class="keyword">char</span><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">duration_units</span><span class="special">;</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.rt_ratio"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.rt_ratio" title="Class rt_ratio">Class
|
||
<code class="computeroutput"><span class="identifier">rt_ratio</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">rt_ratio</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">rt_ratio</span><span class="special">(</span><span class="identifier">Period</span> <span class="keyword">const</span><span class="special">&)</span> <span class="special">:</span>
|
||
<span class="identifier">num</span><span class="special">(</span><span class="identifier">Period</span><span class="special">::</span><span class="identifier">type</span><span class="special">::</span><span class="identifier">num</span><span class="special">),</span> <span class="identifier">den</span><span class="special">(</span><span class="identifier">Period</span><span class="special">::</span><span class="identifier">type</span><span class="special">::</span><span class="identifier">den</span><span class="special">)</span>
|
||
<span class="special">{</span>
|
||
<span class="special">}</span>
|
||
|
||
<span class="identifier">rt_ratio</span><span class="special">(</span><span class="identifier">intmax_t</span> <span class="identifier">n</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">d</span> <span class="special">=</span> <span class="number">1</span><span class="special">)</span> <span class="special">:</span>
|
||
<span class="identifier">num</span><span class="special">(</span><span class="identifier">n</span><span class="special">),</span> <span class="identifier">den</span><span class="special">(</span><span class="identifier">d</span><span class="special">)</span>
|
||
<span class="special">{</span>
|
||
<span class="special">}</span>
|
||
|
||
<span class="identifier">intmax_t</span> <span class="identifier">num</span><span class="special">;</span>
|
||
<span class="identifier">intmax_t</span> <span class="identifier">den</span><span class="special">;</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units" title="Template Class duration_units">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_units</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span> <span class="special">=</span> <span class="keyword">char</span><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">duration_units</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">facet</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span> <span class="comment">// Type of character the facet is instantiated on.</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span> <span class="comment">// Type of character string passed to member functions.</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">;</span> <span class="comment">// Unique identifier for this type of facet.</span>
|
||
|
||
<span class="keyword">explicit</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.c" title="Constructor duration_units()"><code class="computeroutput"><span class="identifier">duration_units</span></code></a><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
<span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_n_d_valid_units_start" title="Member Function get_n_d_valid_units_start()"><code class="computeroutput"><span class="identifier">get_n_d_valid_units_start</span></code></a><span class="special">()</span> <span class="keyword">const</span> <span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_n_d_valid_units_end" title="Member Function get_n_d_valid_units_end()"><code class="computeroutput"><span class="identifier">get_n_d_valid_units_end</span></code></a><span class="special">()</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_valid_units_start" title="Member Function get_valid_units_start()"><code class="computeroutput"><span class="identifier">get_valid_units_start</span></code></a><span class="special">()</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_valid_units_end" title="Member Function get_valid_units_end()"><code class="computeroutput"><span class="identifier">get_valid_units_end</span></code></a><span class="special">()</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="keyword">bool</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.match_n_d_valid_unit" title="Member Function match_n_d_valid_unit(const string_type*)"><code class="computeroutput"><span class="identifier">match_n_d_valid_unit</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">k</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="keyword">bool</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.match_valid_unit" title="Member Function match_valid_unit(const string_type*,rt_ratio&)"><code class="computeroutput"><span class="identifier">match_valid_unit</span></code></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">k</span><span class="special">,</span> <span class="identifier">rt_ratio</span><span class="special">&</span> <span class="identifier">rt</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_pattern" title="Member Function get_pattern()"><code class="computeroutput"><span class="identifier">get_pattern</span></code></a><span class="special">()</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">string_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_unit" title="Template Member Function get_unit(duration_style,duration<Rep,Period> const&)"><code class="computeroutput"><span class="identifier">get_unit</span></code></a><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">string_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_n_d_unit" title="Template Member Function get_n_d_unit(duration_style,duration<Rep,Period> const&)"><code class="computeroutput"><span class="identifier">get_n_d_unit</span></code></a><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">bool</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.is_named_unit" title="Template Member Function is_named_unit()"><code class="computeroutput"><span class="identifier">is_named_unit</span></code></a><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">protected</span><span class="special">:</span>
|
||
<span class="keyword">virtual</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.d" title="Destructor ~duration_units()"><code class="computeroutput"><span class="special">~</span><span class="identifier">duration_units</span></code></a><span class="special">();</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.do_get_n_d_unit" title="Protected Member Function do_get_n_d_unit(duration_style,rt_ratio,intmax_t)"><code class="computeroutput"><span class="identifier">do_get_n_d_unit</span></code></a><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">rt_ratio</span> <span class="identifier">rt</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">v</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.do_get_unit" title="Protected Member Function do_get_unit(duration_style,rt_ratio,intmax_t)"><code class="computeroutput"><span class="identifier">do_get_unit</span></code></a><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span><span class="identifier">rt_ratio</span> <span class="identifier">rt</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">v</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="keyword">bool</span> <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.do_is_named_unit" title="Protected Member Function do_is_named_unit(rt_ratio)"><code class="computeroutput"><span class="identifier">do_is_named_unit</span></code></a><span class="special">(</span><span class="identifier">rt_ratio</span> <span class="identifier">rt</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units" title="Template Class duration_units"><code class="computeroutput"><span class="identifier">duration_units</span></code></a> facet gives useful
|
||
information about the duration units, as the number of plural forms,
|
||
the plural form associated to a duration, the text associated to a plural
|
||
form and a duration's period,
|
||
</p>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.c"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.c" title="Constructor duration_units()">Constructor
|
||
<code class="computeroutput"><span class="identifier">duration_units</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">duration_units</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
Construct a <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units" title="Template Class duration_units"><code class="computeroutput"><span class="identifier">duration_units</span></code></a> facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>refs:</strong></span> references
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Construct a <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units" title="Template Class duration_units"><code class="computeroutput"><span class="identifier">duration_units</span></code></a> facet. If the
|
||
<code class="computeroutput"><span class="identifier">refs</span></code> argument is <code class="computeroutput"><span class="number">0</span></code> then destruction of the object is delegated
|
||
to the locale, or locales, containing it. This allows the user to ignore
|
||
lifetime management issues. On the other had, if <code class="computeroutput"><span class="identifier">refs</span></code>
|
||
is <code class="computeroutput"><span class="number">1</span></code> then the object must
|
||
be explicitly deleted; the locale will not do so. In this case, the
|
||
object can be maintained across the lifetime of multiple locales.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.d"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.d" title="Destructor ~duration_units()">Destructor
|
||
<code class="computeroutput"><span class="special">~</span><span class="identifier">duration_units</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">duration_units</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Destroys the facet.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.get_n_d_valid_units_start"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_n_d_valid_units_start" title="Member Function get_n_d_valid_units_start()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_n_d_valid_units_start</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_n_d_valid_units_start</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> pointer to the start of valid
|
||
[N/D] units.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.get_n_d_valid_units_end"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_n_d_valid_units_end" title="Member Function get_n_d_valid_units_end()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_n_d_valid_units_end</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_n_d_valid_units_end</span><span class="special">()</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> pointer to the end of valid
|
||
[N/D] units.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.get_valid_units_start"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_valid_units_start" title="Member Function get_valid_units_start()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_valid_units_start</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_valid_units_start</span><span class="special">()</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> pointer to the start of valid
|
||
units, symbol or prefix with its different plural forms.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.get_valid_units_end"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_valid_units_end" title="Member Function get_valid_units_end()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_valid_units_end</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_valid_units_end</span><span class="special">()</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> pointer to the end of valid
|
||
units.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.match_n_d_valid_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.match_n_d_valid_unit" title="Member Function match_n_d_valid_unit(const string_type*)">Member
|
||
Function <code class="computeroutput"><span class="identifier">match_n_d_valid_unit</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">bool</span> <span class="identifier">match_n_d_valid_unit</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">k</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>k:</strong></span> the found pointer to the [N/D]
|
||
unit.
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="keyword">true</span></code>
|
||
if <code class="computeroutput"><span class="identifier">k</span></code> matches a valid
|
||
unit.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.match_valid_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.match_valid_unit" title="Member Function match_valid_unit(const string_type*,rt_ratio&)">Member
|
||
Function <code class="computeroutput"><span class="identifier">match_valid_unit</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*,</span><span class="identifier">rt_ratio</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">bool</span> <span class="identifier">match_valid_unit</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">k</span><span class="special">,</span> <span class="identifier">rt_ratio</span><span class="special">&</span> <span class="identifier">rt</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>k:</strong></span> the found pointer to the unit.
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rt</span></code>
|
||
is set to the valid Period when the <code class="computeroutput"><span class="identifier">k</span></code>
|
||
matches a valid unit. <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="keyword">true</span></code> if <code class="computeroutput"><span class="identifier">k</span></code>
|
||
matches a valid unit.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.get_pattern"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_pattern" title="Member Function get_pattern()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_pattern</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">get_pattern</span><span class="special">()</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the pattern to be used by
|
||
default.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.get_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_unit" title="Template Member Function get_unit(duration_style,duration<Rep,Period> const&)">Template
|
||
Member Function <code class="computeroutput"><span class="identifier">get_unit</span><span class="special">(</span><span class="identifier">duration_style</span><span class="special">,</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span><span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">string_type</span> <span class="identifier">get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">get_unit</span><span class="special">(</span><span class="identifier">style</span><span class="special">,</span> <span class="identifier">d</span><span class="special">.</span><span class="identifier">count</span><span class="special">(),</span> <span class="identifier">rt_ratio</span><span class="special">(</span><span class="identifier">Period</span><span class="special">()))</span></code>, the unit associated to this duration.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.get_n_d_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.get_n_d_unit" title="Template Member Function get_n_d_unit(duration_style,duration<Rep,Period> const&)">Template
|
||
Member Function <code class="computeroutput"><span class="identifier">get_n_d_unit</span><span class="special">(</span><span class="identifier">duration_style</span><span class="special">,</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span><span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">string_type</span> <span class="identifier">get_n_d_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> get_n_d_unit(style, d.count(),
|
||
rt_ratio(Period())), i.e. the [N/D] suffix unit associated to this
|
||
duration.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.is_named_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.is_named_unit" title="Template Member Function is_named_unit()">Template
|
||
Member Function <code class="computeroutput"><span class="identifier">is_named_unit</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="keyword">bool</span> <span class="identifier">is_named_unit</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">do_is_named_unit</span><span class="special">(</span><span class="identifier">rt_ratio</span><span class="special">(</span><span class="identifier">Period</span><span class="special">()))</span></code>, true if the unit associated to
|
||
the given Period is named, false otherwise.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.do_get_n_d_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.do_get_n_d_unit" title="Protected Member Function do_get_n_d_unit(duration_style,rt_ratio,intmax_t)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_n_d_unit</span><span class="special">(</span><span class="identifier">duration_style</span><span class="special">,</span><span class="identifier">rt_ratio</span><span class="special">,</span><span class="identifier">intmax_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_n_d_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">rt_ratio</span> <span class="identifier">rt</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">v</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the [N/D] suffix unit associated
|
||
to this duration.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.do_get_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.do_get_unit" title="Protected Member Function do_get_unit(duration_style,rt_ratio,intmax_t)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span><span class="special">,</span><span class="identifier">rt_ratio</span><span class="special">,</span><span class="identifier">intmax_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span><span class="identifier">rt_ratio</span> <span class="identifier">rt</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">v</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the unit associated to this
|
||
duration.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units.do_is_named_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units.do_is_named_unit" title="Protected Member Function do_is_named_unit(rt_ratio)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_is_named_unit</span><span class="special">(</span><span class="identifier">rt_ratio</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">bool</span> <span class="identifier">do_is_named_unit</span><span class="special">(</span><span class="identifier">rt_ratio</span> <span class="identifier">rt</span><span class="special">)</span> <span class="keyword">const</span> <span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> true if the unit associated
|
||
to the given Period is named, false otherwise.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default" title="Template Class duration_units_default">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_units_default</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span> <span class="special">=</span> <span class="keyword">char</span><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">duration_units_default</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">duration_units</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">protected</span><span class="special">:</span>
|
||
<span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pfs_</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span> <span class="comment">// The default English facet has two plural forms.</span>
|
||
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span>
|
||
|
||
<span class="keyword">explicit</span> <span class="identifier">duration_units_default</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
<span class="special">~</span><span class="identifier">duration_units_default</span><span class="special">();</span>
|
||
|
||
<span class="keyword">bool</span> <span class="identifier">match_n_d_valid_unit</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">k</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">bool</span> <span class="identifier">match_valid_unit</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">k</span><span class="special">,</span> <span class="identifier">rt_ratio</span><span class="special">&</span> <span class="identifier">rt</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_n_d_valid_units_start</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_n_d_valid_units_end</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
|
||
<span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_valid_units_start</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_valid_units_end</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="identifier">string_type</span> <span class="identifier">get_pattern</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">protected</span><span class="special">:</span>
|
||
<span class="keyword">bool</span> <span class="identifier">do_is_named_unit</span><span class="special">(</span><span class="identifier">rt_ratio</span> <span class="identifier">rt</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="identifier">string_type</span> <span class="identifier">do_get_n_d_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">rt_ratio</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">v</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">rt_ratio</span> <span class="identifier">rt</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">v</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">do_get_plural_forms</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">do_get_plural_form</span><span class="special">(</span><span class="identifier">int_least64_t</span> <span class="identifier">value</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">3600</span><span class="special">></span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">atto</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">femto</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">pico</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">nano</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">micro</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">milli</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">centi</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">deci</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">deca</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">hecto</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">kilo</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">mega</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">giga</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">tera</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">peta</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">exa</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">atto</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">femto</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">pico</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">nano</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">micro</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">milli</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">centi</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">deci</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">deca</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">hecto</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">kilo</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">mega</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">giga</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">tera</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">peta</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">exa</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
This class is used to define the strings for the default English. This
|
||
facet names the units associated to the following periods:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">atto</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">femto</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">pico</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">nano</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">micro</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">milli</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">centi</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">deci</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
ratio<1>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">deca</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">hecto</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">kilo</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">mega</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">giga</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">tera</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">peta</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">exa</span></code>,
|
||
</li>
|
||
<li class="listitem">
|
||
ratio<60> and
|
||
</li>
|
||
<li class="listitem">
|
||
ratio<3600>.
|
||
</li>
|
||
</ul></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.c"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.c" title="Constructor duration_units_default()">Constructor
|
||
<code class="computeroutput"><span class="identifier">duration_units_default</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">duration_units_default</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
Construct a duration_units_default facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>refs:</strong></span> references
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Construct a duration_units_default
|
||
facet. If the <code class="computeroutput"><span class="identifier">refs</span></code>
|
||
argument is <code class="computeroutput"><span class="number">0</span></code> then destruction
|
||
of the object is delegated to the locale, or locales, containing it.
|
||
This allows the user to ignore lifetime management issues. On the other
|
||
had, if <code class="computeroutput"><span class="identifier">refs</span></code> is <code class="computeroutput"><span class="number">1</span></code> then the object must be explicitly
|
||
deleted; the locale will not do so. In this case, the object can be
|
||
maintained across the lifetime of multiple locales.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.d"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.d" title="Destructor ~duration_units_default()">Destructor
|
||
<code class="computeroutput"><span class="special">~</span><span class="identifier">duration_units_default</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">duration_units_default</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Destroys the facet.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.get_n_d_valid_units_start"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.get_n_d_valid_units_start" title="Member Function get_n_d_valid_units_start()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_n_d_valid_units_start</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_n_d_valid_units_start</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> pointer to the start of valid
|
||
[N/D] units.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.get_n_d_valid_units_end"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.get_n_d_valid_units_end" title="Member Function get_n_d_valid_units_end()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_n_d_valid_units_end</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_n_d_valid_units_end</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> pointer to the end of valid
|
||
[N/D] units.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.get_valid_units_start"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.get_valid_units_start" title="Member Function get_valid_units_start()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_valid_units_start</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_valid_units_start</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> pointer to the start of valid
|
||
units, symbol or prefix with its different plural forms.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.get_valid_units_end"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.get_valid_units_end" title="Member Function get_valid_units_end()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_valid_units_end</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">get_valid_units_end</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> pointer to the end of valid
|
||
units.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.match_n_d_valid_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.match_n_d_valid_unit" title="Member Function match_n_d_valid_unit(const string_type*)">Member
|
||
Function <code class="computeroutput"><span class="identifier">match_n_d_valid_unit</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">bool</span> <span class="identifier">match_n_d_valid_unit</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">k</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>k:</strong></span> the found pointer to the [N/D]
|
||
unit.
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="keyword">true</span></code>
|
||
if <code class="computeroutput"><span class="identifier">k</span></code> matches a valid
|
||
unit.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.match_valid_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.match_valid_unit" title="Member Function match_valid_unit(const string_type*,rt_ratio&)">Member
|
||
Function <code class="computeroutput"><span class="identifier">match_valid_unit</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*,</span><span class="identifier">rt_ratio</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">bool</span> <span class="identifier">match_valid_unit</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">string_type</span><span class="special">*</span> <span class="identifier">k</span><span class="special">,</span> <span class="identifier">rt_ratio</span><span class="special">&</span> <span class="identifier">rt</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>k:</strong></span> the found pointer to the unit.
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> <code class="computeroutput"><span class="identifier">rt</span></code>
|
||
is set to the valid Period when the <code class="computeroutput"><span class="identifier">k</span></code>
|
||
matches a valid unit. <span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="keyword">true</span></code> if <code class="computeroutput"><span class="identifier">k</span></code>
|
||
matches a valid unit.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.get_pattern"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.get_pattern" title="Member Function get_pattern()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_pattern</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">get_pattern</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the pattern to be used by
|
||
default.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.do_get_n_d_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.do_get_n_d_unit" title="Protected Member Function do_get_n_d_unit(duration_style,rt_ratio,intmax_t)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_n_d_unit</span><span class="special">(</span><span class="identifier">duration_style</span><span class="special">,</span><span class="identifier">rt_ratio</span><span class="special">,</span><span class="identifier">intmax_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_n_d_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">rt_ratio</span> <span class="identifier">rt</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">v</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the [N/D] suffix unit associated
|
||
to this duration.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.do_get_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.do_get_unit" title="Protected Member Function do_get_unit(duration_style,rt_ratio,intmax_t)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span><span class="special">,</span><span class="identifier">rt_ratio</span><span class="special">,</span><span class="identifier">intmax_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span><span class="identifier">rt_ratio</span> <span class="identifier">rt</span><span class="special">,</span> <span class="identifier">intmax_t</span> <span class="identifier">v</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the unit associated to this
|
||
duration.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.do_is_named_unit"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.do_is_named_unit" title="Protected Member Function do_is_named_unit(rt_ratio)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_is_named_unit</span><span class="special">(</span><span class="identifier">rt_ratio</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="keyword">bool</span> <span class="identifier">do_is_named_unit</span><span class="special">(</span><span class="identifier">rt_ratio</span> <span class="identifier">rt</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> true if the unit associated
|
||
to the given Period is named, false otherwise.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.do_get_plural_forms"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.do_get_plural_forms" title="Protected Member Function do_get_plural_forms()">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_plural_forms</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">do_get_plural_forms</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the number of associated
|
||
plural forms this facet manages.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.do_get_plural_form"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.do_get_plural_form" title="Protected Member Function do_get_plural_form(int_least64_t)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_plural_form</span><span class="special">(</span><span class="identifier">int_least64_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">do_get_plural_form</span><span class="special">(</span><span class="identifier">int_least64_t</span> <span class="identifier">value</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
Gets the associated plural form.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>value:</strong></span> the duration representation
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the plural form associated
|
||
to the <code class="computeroutput"><span class="identifier">value</span></code> parameter.
|
||
In English there are 2 plural forms
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
0 singular (-1 or 1)
|
||
</li>
|
||
<li class="listitem">
|
||
1 plural for all others
|
||
</li>
|
||
</ul></div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.do_get_unit_seconds"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.do_get_unit_seconds" title="Protected Member Function do_get_unit(duration_style,ratio<1>,std::size_t)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span><span class="special">,</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">>,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">1</span><span class="special">></span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>style:</strong></span> the duration style.
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>period:</strong></span> the period associated
|
||
to the duration hours.
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pf:</strong></span> the requested plural form.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> if style is symbol returns
|
||
"s", otherwise if pf is 0 return "second", if pf
|
||
is 1 "seconds"
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.do_get_unit_minutes"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.do_get_unit_minutes" title="Protected Member Function do_get_unit(duration_style style,ratio<60>,std::size_t)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span>
|
||
<span class="identifier">style</span><span class="special">,</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">60</span><span class="special">>,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">60</span><span class="special">></span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>style:</strong></span> the duration style.
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>period:</strong></span> the period associated
|
||
to the duration hours.
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pf:</strong></span> the requested plural form.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> if style is symbol returns
|
||
"min", otherwise if pf is 0 return "minute", if
|
||
pf is 1 "minutes"
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.do_get_unit_hours"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.do_get_unit_hours" title="Protected Member Function do_get_unit(duration_style,ratio<3600>,std::size_t)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span><span class="special">,</span><span class="identifier">ratio</span><span class="special"><</span><span class="number">3600</span><span class="special">>,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">ratio</span><span class="special"><</span><span class="number">3600</span><span class="special">></span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>style:</strong></span> the duration style.
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>period:</strong></span> the period associated
|
||
to the duration hours.
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pf:</strong></span> the requested plural form.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> if style is symbol returns
|
||
"h", otherwise if pf is 0 return "hour", if pf
|
||
is 1 "hours"
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.do_get_unit_xxx"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.do_get_unit_xxx" title="Protected Member Function do_get_unit(duration_style,Period,std::size_t)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span><span class="special">,</span><span class="identifier">Period</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">atto</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">femto</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">pico</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">nano</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">micro</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">milli</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">centi</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">deci</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">deca</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">hecto</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">kilo</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">mega</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">giga</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">tera</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">peta</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_unit</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">exa</span> <span class="identifier">u</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">pf</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>style:</strong></span> the duration style.
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>u:</strong></span> the period tag atto.
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pf:</strong></span> the requested plural form.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the concatenation of the
|
||
prefix associated to period <code class="computeroutput"><span class="identifier">u</span></code>
|
||
+ the one associated to seconds.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_units_hpp.duration_units_default.do_get_ratio_prefix_xxx"></a><a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units_default.do_get_ratio_prefix_xxx" title="Protected Member Function do_get_ratio_prefix(duration_style, Period)">Protected
|
||
Member Function <code class="computeroutput"><span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">atto</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">femto</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">pico</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">nano</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">micro</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">milli</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">centi</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">deci</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">deca</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">hecto</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">kilo</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">mega</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">giga</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">tera</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">peta</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_ratio_prefix</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">style</span><span class="special">,</span> <span class="identifier">exa</span> <span class="identifier">u</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>style:</strong></span> the duration style.
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>u:</strong></span> the period tag atto.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> depending on the value of
|
||
<code class="computeroutput"><span class="identifier">style</span></code> return the ratio_string
|
||
symbol or prefix.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp" title="Header <boost/chrono/io/duration_io.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">duration_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.duration_io_hpp.manipulators">I/O
|
||
Manipulators</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.duration_io_hpp.streams">I/O
|
||
Streams Operations</a></span></dt>
|
||
</dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="comment">// manipulators</span>
|
||
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.symbol_format" title="Non Member Function symbol_format(ios_base&)"><code class="computeroutput"><span class="identifier">symbol_format</span></code></a><span class="special">(</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">);</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.name_format" title="Non Member Function name_format(ios_base&)"><code class="computeroutput"><span class="identifier">name_format</span></code></a><span class="special">(</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">);</span>
|
||
<span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt" title="Template Class duration_fmt"><code class="computeroutput"><span class="identifier">duration_fmt</span></code></a><span class="special">;</span>
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_out" title="Member Function operator <<(basic_ostream<>&, duration_fmt)"><code class="computeroutput"><span class="keyword">operator</span> <span class="special"><<</span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span> <span class="identifier">duration_fmt</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_in" title="Member Function operator >>(basic_istream<>&, duration_fmt)"><code class="computeroutput"><span class="keyword">operator</span> <span class="special">>></span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">duration_fmt</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
|
||
<span class="comment">// duration I/O</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.streams.duration__op_out" title="Member Function operator <<(basic_ostream<>&, const duration<>& d)"><code class="computeroutput"><span class="keyword">operator</span> <span class="special"><<</span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.streams.duration__op_in" title="Member Function operator <<(basic_istream<>&, const duration<>& d)"><code class="computeroutput"><span class="keyword">operator</span> <span class="special">>></span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp.manipulators"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators" title="I/O Manipulators">I/O
|
||
Manipulators</a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
There is a parameterized manipulator that takes the duration_style as
|
||
parameter. The symbol or name format can be easily chosen by streaming
|
||
a <code class="computeroutput"><span class="identifier">symbol_format</span></code> or <code class="computeroutput"><span class="identifier">name_format</span></code> manipulators respectively.
|
||
</p>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp.manipulators.duration_fmt"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt" title="Template Class duration_fmt">Template
|
||
Class <code class="computeroutput"><span class="identifier">duration_fmt</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">duration_fmt</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
|
||
<span class="keyword">explicit</span> <a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.c1" title="Constructor duration_fmt(duration_style)"><code class="computeroutput"><span class="identifier">duration_fmt</span></code></a><span class="special">(</span><a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">duration_style</span></code></a> <span class="identifier">style</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
|
||
<span class="preprocessor">#ifndef</span> <span class="identifier">BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS</span>
|
||
<span class="keyword">explicit</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_duration_style" title="Member Function operator duration_style()"><code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">duration_style</span></code></a><span class="special">()</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="preprocessor">#endif</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">duration_style</span></code></a> <a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_duration_style" title="Member Function operator duration_style()"><code class="computeroutput"><span class="identifier">get_duration_style</span></code></a><span class="special">()</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="special">};</span>
|
||
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_out" title="Member Function operator <<(basic_ostream<>&, duration_fmt)"><code class="computeroutput"><span class="keyword">operator</span> <span class="special"><<</span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span> <span class="identifier">duration_fmt</span> <span class="identifier">d</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_in" title="Member Function operator >>(basic_istream<>&, duration_fmt)"><code class="computeroutput"><span class="keyword">operator</span> <span class="special">>></span></code></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">duration_fmt</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.c1"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.c1" title="Constructor duration_fmt(duration_style)">Constructor
|
||
<code class="computeroutput"><span class="identifier">duration_fmt</span><span class="special">(</span><span class="identifier">duration_style</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">duration_fmt</span><span class="special">(</span><span class="identifier">duration_style</span> <span class="identifier">f</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs a <a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt" title="Template Class duration_fmt"><code class="computeroutput"><span class="identifier">duration_fmt</span></code></a> by storing
|
||
<code class="computeroutput"><span class="identifier">f</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Post Conditions:</strong></span> <code class="computeroutput"><span class="keyword">static_cast</span><span class="special"><</span><span class="identifier">duration_style</span><span class="special">>(*</span><span class="keyword">this</span><span class="special">)</span> <span class="special">==</span> <span class="identifier">f</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_duration_style"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_duration_style" title="Member Function operator duration_style()">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span> <span class="identifier">duration_style</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="keyword">operator</span> <span class="identifier">duration_style</span><span class="special">()</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="identifier">duration_style</span> <span class="identifier">get_duration_style</span><span class="special">()</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span>: The stored <a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt" title="Template Class duration_fmt"><code class="computeroutput"><span class="identifier">duration_fmt</span></code></a> <code class="computeroutput"><span class="identifier">f</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_out"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_out" title="Member Function operator <<(basic_ostream<>&, duration_fmt)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span> <span class="special"><<(</span><span class="identifier">basic_ostream</span><span class="special"><>&,</span>
|
||
<span class="identifier">duration_fmt</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">></span>
|
||
<span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">duration_fmt</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span>: <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_duration_style" title="Non Member Function set_duration_style(std::ios_base &,duration_style)"><code class="computeroutput"><span class="identifier">set_duration_style</span></code></a><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="keyword">static_cast</span><span class="special"><</span><a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">duration_style</span></code></a><span class="special">>(</span><span class="identifier">d</span><span class="special">))))</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span>: <code class="computeroutput"><span class="identifier">s</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_in"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.duration_fmt.op_in" title="Member Function operator >>(basic_istream<>&, duration_fmt)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span> <span class="special">>>(</span><span class="identifier">basic_istream</span><span class="special"><>&,</span>
|
||
<span class="identifier">duration_fmt</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">></span>
|
||
<span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">duration_fmt</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span>: <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_duration_style" title="Non Member Function set_duration_style(std::ios_base &,duration_style)"><code class="computeroutput"><span class="identifier">set_duration_style</span></code></a><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="keyword">static_cast</span><span class="special"><</span><a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">duration_style</span></code></a><span class="special">>(</span><span class="identifier">d</span><span class="special">))))</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span>: <code class="computeroutput"><span class="identifier">s</span></code>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp.manipulators.symbol_format"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.symbol_format" title="Non Member Function symbol_format(ios_base&)">Non
|
||
Member Function <code class="computeroutput"><span class="identifier">symbol_format</span><span class="special">(</span><span class="identifier">ios_base</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.symbol_format" title="Non Member Function symbol_format(ios_base&)"><code class="computeroutput"><span class="identifier">symbol_format</span></code></a><span class="special">(</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span>: <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_duration_style" title="Non Member Function set_duration_style(std::ios_base &,duration_style)"><code class="computeroutput"><span class="identifier">set_duration_style</span></code></a><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">duration_style</span></code></a><span class="special">::</span><span class="identifier">symbol</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">ios</span></code>
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp.manipulators.name_format"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.name_format" title="Non Member Function name_format(ios_base&)">Non
|
||
Member Function <code class="computeroutput"><span class="identifier">name_format</span><span class="special">(</span><span class="identifier">ios_base</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.manipulators.name_format" title="Non Member Function name_format(ios_base&)"><code class="computeroutput"><span class="identifier">name_format</span></code></a><span class="special">(</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span>: <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_duration_style" title="Non Member Function set_duration_style(std::ios_base &,duration_style)"><code class="computeroutput"><span class="identifier">set_duration_style</span></code></a><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.io.duration_style_hpp.duration_style" title="Scoped enum duration_style"><code class="computeroutput"><span class="identifier">duration_style</span></code></a><span class="special">::</span><span class="identifier">prefix</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">ios</span></code>
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp.streams"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.streams" title="I/O Streams Operations">I/O
|
||
Streams Operations</a>
|
||
</h5></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp.streams.duration__op_out"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.streams.duration__op_out" title="Member Function operator <<(basic_ostream<>&, const duration<>& d)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span> <span class="special"><<(</span><span class="identifier">basic_ostream</span><span class="special"><>&,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><>&</span> <span class="identifier">d</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<p>
|
||
Any <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> can be streamed out
|
||
to a <code class="computeroutput"><span class="identifier">basic_ostream</span></code>.
|
||
The run-time value of the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a> is formatted according
|
||
to the rules and current format settings for <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><code class="computeroutput"><span class="special">::</span><span class="identifier">rep</span></code> and the <a class="link" href="reference.html#chrono.reference.io.duration_units_hpp.duration_units" title="Template Class duration_units"><code class="computeroutput"><span class="identifier">duration_units</span></code></a> facet.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Behaves as a formatted output
|
||
function. After constructing a sentry object, if the sentry converts
|
||
to true, calls to <code class="computeroutput"><span class="identifier">facet</span><span class="special">.</span><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put.put" title="Member Function put(iter_type,std::ios_base&,char_type,duration<Rep,Period> const&, const CharT*,const CharT*)"><code class="computeroutput"><span class="identifier">put</span></code></a><span class="special">(</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">os</span><span class="special">.</span><span class="identifier">fill</span><span class="special">(),</span><span class="identifier">d</span><span class="special">)</span></code>
|
||
where <code class="computeroutput"><span class="identifier">facet</span></code> is the
|
||
<code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put" title="Template Class duration_put"><code class="computeroutput"><span class="identifier">duration_put</span></code></a><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code>
|
||
facet associated to <code class="computeroutput"><span class="identifier">os</span></code>
|
||
or a new created instance of the default <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put" title="Template Class duration_put"><code class="computeroutput"><span class="identifier">duration_put</span></code></a><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code>
|
||
facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">os</span></code>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.duration_io_hpp.streams.duration__op_in"></a><a class="link" href="reference.html#chrono.reference.io.duration_io_hpp.streams.duration__op_in" title="Member Function operator <<(basic_istream<>&, const duration<>& d)">Member
|
||
Function <code class="computeroutput"><span class="keyword">operator</span> <span class="special"><<(</span><span class="identifier">basic_istream</span><span class="special"><>&,</span>
|
||
<span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><>&</span> <span class="identifier">d</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Behaves as a formatted input
|
||
function. After constructing a <code class="computeroutput"><span class="identifier">sentry</span></code>
|
||
object, if the <code class="computeroutput"><span class="identifier">sentry</span></code>
|
||
converts to <code class="computeroutput"><span class="keyword">true</span></code>, calls
|
||
to <code class="computeroutput"><span class="identifier">facet</span><span class="special">.</span><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get.get" title="Template Member Function get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,duration<Rep,Period>&,const char_type*, const char_type*) const"><code class="computeroutput"><span class="identifier">get</span></code></a><span class="special">(</span><span class="identifier">is</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">istreambuf_iterator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span>
|
||
<span class="identifier">Traits</span><span class="special">>(),</span>
|
||
<span class="identifier">is</span><span class="special">,</span>
|
||
<span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">d</span><span class="special">)</span></code>
|
||
where <code class="computeroutput"><span class="identifier">facet</span></code> is the
|
||
<code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get" title="Template Class duration_get"><code class="computeroutput"><span class="identifier">duration_get</span></code></a><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code>
|
||
facet associated to <code class="computeroutput"><span class="identifier">is</span></code>
|
||
or a new created instance of the default <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.duration_get_hpp.duration_get" title="Template Class duration_get"><code class="computeroutput"><span class="identifier">duration_get</span></code></a><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code>
|
||
facet.
|
||
</p>
|
||
<p>
|
||
If any step fails, calls <code class="computeroutput"><span class="identifier">os</span><span class="special">.</span><span class="identifier">setstate</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span>
|
||
<span class="special">|</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">badbit</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">is</span></code>
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.time_point_get_hpp"></a><a class="link" href="reference.html#chrono.reference.io.time_point_get_hpp" title="Header <boost/chrono/io/time_point_get.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_get</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc"><dt><span class="section"><a href="reference.html#chrono.reference.io.time_point_get_hpp.time_point_get">Template
|
||
Class <code class="computeroutput"><span class="identifier">time_point_get</span></code></a></span></dt></dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">InputIterator</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">istreambuf_iterator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">time_point_get</span><span class="special">;</span>
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.time_point_get_hpp.time_point_get"></a><a class="link" href="reference.html#chrono.reference.io.time_point_get_hpp.time_point_get" title="Template Class time_point_get">Template
|
||
Class <code class="computeroutput"><span class="identifier">time_point_get</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">InputIterator</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">istreambuf_iterator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">time_point_get</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">facet</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span> <span class="comment">// Type of character the facet is instantiated on.</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">InputIterator</span> <span class="identifier">iter_type</span><span class="special">;</span> <span class="comment">// Type of iterator used to scan the character buffer.</span>
|
||
|
||
<span class="keyword">explicit</span> <span class="identifier">__time_point_get_c</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">__time_point_get_get</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">iter_type</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="special">&</span><span class="identifier">tp</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span><span class="identifier">pattern</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span><span class="identifier">pat_end</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">__time_point_get_get2</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">iter_type</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="special">&</span><span class="identifier">tp</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">__time_point_get_get_duration</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">iter_type</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">__time_point_get_get_epoch</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">iter_type</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">is</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">;</span> <span class="comment">// Unique identifier for this type of facet.</span>
|
||
|
||
<span class="identifier">__time_point_get_d</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">time_point_get</span></code> is used
|
||
to parse a character sequence, extracting the duration and the epoch
|
||
into a class <code class="computeroutput"><span class="identifier">time_point</span></code>.
|
||
</p>
|
||
<p>
|
||
The pattern can contain the format specifiers <code class="computeroutput"><span class="special">%</span><span class="identifier">d</span></code> and <code class="computeroutput"><span class="special">%</span><span class="identifier">e</span></code> in any order.
|
||
</p>
|
||
<p>
|
||
User confirmation is required for reliable parsing of user-entered durations,
|
||
but machine-generated formats can be parsed reliably. This allows parsers
|
||
to be aggressive about interpreting user variations on standard formats.
|
||
</p>
|
||
<p>
|
||
If the end iterator is reached during parsing the member function sets
|
||
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">eofbit</span></code> in <code class="computeroutput"><span class="identifier">err</span></code>.
|
||
</p>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_get_hpp.time_point_get.c"></a><a class="link" href="reference.html#chrono.reference.io.time_point_get_hpp.time_point_get.c" title="Constructor time_point_get(size_t)">Constructor
|
||
<code class="computeroutput"><span class="identifier">time_point_get</span><span class="special">(</span><span class="identifier">size_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">time_point_get</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
Constructs a __time_point_get facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>refs:</strong></span> references
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Constructs a <a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put" title="Template Class duration_put"><code class="computeroutput"><span class="identifier">duration_put</span></code></a> facet. If the
|
||
<code class="computeroutput"><span class="identifier">refs</span></code> argument is <code class="computeroutput"><span class="number">0</span></code> then destruction of the object is delegated
|
||
to the locale, or locales, containing it. This allows the user to ignore
|
||
lifetime management issues. On the other had, if <code class="computeroutput"><span class="identifier">refs</span></code>
|
||
is <code class="computeroutput"><span class="number">1</span></code> then the object must
|
||
be explicitly deleted; <code class="computeroutput"><span class="identifier">locale</span></code>
|
||
will not do so. In this case, the object can be maintained across the
|
||
lifetime of multiple locales.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_get_hpp.time_point_get.d"></a><a class="link" href="reference.html#chrono.reference.io.time_point_get_hpp.time_point_get.d" title="Destructor ~time_point_get()">Destructor
|
||
<code class="computeroutput"><span class="special">~</span><span class="identifier">time_point_get</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="special">~</span><span class="identifier">time_point_get</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Destroy the facet.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_get_hpp.time_point_get.get"></a><a class="link" href="reference.html#chrono.reference.io.time_point_get_hpp.time_point_get.get" title="Template Member Function get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,time_point<Clock, Duration>&,const CharT*,const CharT*)">Template
|
||
Member Function <code class="computeroutput"><span class="identifier">get</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&,</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">>&,</span><span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*,</span><span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">iter_type</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="special">&</span><span class="identifier">tp</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span><span class="identifier">pattern</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span><span class="identifier">pat_end</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> start input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>end:</strong></span> end input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a <code class="computeroutput"><span class="identifier">ios_base</span></code>
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>err:</strong></span> the <code class="computeroutput"><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span></code>
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>tp:</strong></span> the <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pattern:</strong></span> begin of the formatting
|
||
pattern
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pat_end:</strong></span> end of the formatting
|
||
pattern
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Requires:</strong></span> <code class="computeroutput"><span class="special">[</span><span class="identifier">pattern</span><span class="special">,</span><span class="identifier">pat_end</span><span class="special">)</span></code>
|
||
must be a valid range.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span>: The function starts by evaluating
|
||
<code class="computeroutput"><span class="identifier">err</span> <span class="special">=</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">goodbit</span></code>. It then enters a loop, reading
|
||
zero or more characters from <code class="computeroutput"><span class="identifier">s</span></code>
|
||
at each iteration. Unless otherwise specified below, the loop terminates
|
||
when the first of the following conditions holds:
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
The expression <code class="computeroutput"><span class="identifier">pattern</span>
|
||
<span class="special">==</span> <span class="identifier">pat_end</span></code>
|
||
evaluates to <code class="computeroutput"><span class="keyword">true</span></code>.
|
||
</li>
|
||
<li class="listitem">
|
||
The expression <code class="computeroutput"><span class="identifier">err</span> <span class="special">==</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">goodbit</span></code>
|
||
evaluates to <code class="computeroutput"><span class="keyword">false</span></code>.
|
||
</li>
|
||
<li class="listitem">
|
||
The expression <code class="computeroutput"><span class="identifier">s</span> <span class="special">==</span> <span class="identifier">end</span></code>
|
||
evaluates to <code class="computeroutput"><span class="keyword">true</span></code>,
|
||
in which case the function evaluates <code class="computeroutput"><span class="identifier">err</span>
|
||
<span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">eofbit</span>
|
||
<span class="special">|</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>.
|
||
</li>
|
||
<li class="listitem">
|
||
The next element of pattern is equal to <code class="computeroutput"><span class="char">'%'</span></code>,
|
||
followed by a conversion specifier character, the functions <code class="computeroutput"><span class="identifier">get_duration</span></code> or <code class="computeroutput"><span class="identifier">get_epoch</span></code> are called depending
|
||
on whether the format is <code class="computeroutput"><span class="char">'d'</span></code>
|
||
or <code class="computeroutput"><span class="char">'e'</span></code>. If the number
|
||
of elements in the range <code class="computeroutput"><span class="special">[</span><span class="identifier">pattern</span><span class="special">,</span><span class="identifier">pat_end</span><span class="special">)</span></code>
|
||
is not sufficient to unambiguously determine whether the conversion
|
||
specification is complete and valid, the function evaluates <code class="computeroutput"><span class="identifier">err</span> <span class="special">|=</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>. Otherwise, the function
|
||
evaluates <code class="computeroutput"><span class="identifier">s</span> <span class="special">=</span>
|
||
<span class="identifier">do_get</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span>
|
||
<span class="identifier">end</span><span class="special">,</span>
|
||
<span class="identifier">ios</span><span class="special">,</span>
|
||
<span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">d</span><span class="special">)</span></code>.
|
||
If <code class="computeroutput"><span class="identifier">err</span> <span class="special">==</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">goodbit</span></code> holds after the evaluation
|
||
of the expression, the function increments pattern to point just
|
||
past the end of the conversion specification and continues looping.
|
||
</li>
|
||
<li class="listitem">
|
||
The expression <code class="computeroutput"><span class="identifier">isspace</span><span class="special">(*</span><span class="identifier">pattern</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">.</span><span class="identifier">getloc</span><span class="special">())</span></code> evaluates to <code class="computeroutput"><span class="keyword">true</span></code>,
|
||
in which case the function first increments <code class="computeroutput"><span class="identifier">pattern</span></code>
|
||
until <code class="computeroutput"><span class="identifier">pattern</span> <span class="special">==</span> <span class="identifier">pat_end</span>
|
||
<span class="special">||</span> <span class="special">!</span><span class="identifier">isspace</span><span class="special">(*</span><span class="identifier">pattern</span><span class="special">,</span>
|
||
<span class="identifier">ios</span><span class="special">.</span><span class="identifier">getloc</span><span class="special">())</span></code>
|
||
evaluates to <code class="computeroutput"><span class="keyword">true</span></code>,
|
||
then advances <code class="computeroutput"><span class="identifier">s</span></code>
|
||
until <code class="computeroutput"><span class="identifier">s</span> <span class="special">==</span>
|
||
<span class="identifier">end</span> <span class="special">||</span>
|
||
<span class="special">!</span><span class="identifier">isspace</span><span class="special">(*</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">.</span><span class="identifier">getloc</span><span class="special">())</span></code> is <code class="computeroutput"><span class="keyword">true</span></code>,
|
||
and finally resumes looping.
|
||
</li>
|
||
<li class="listitem">
|
||
The next character read from <code class="computeroutput"><span class="identifier">s</span></code>
|
||
matches the element pointed to by pattern in a case-insensitive
|
||
comparison, in which case the function evaluates <code class="computeroutput"><span class="special">++</span><span class="identifier">pattern</span></code>,
|
||
<code class="computeroutput"><span class="special">++</span><span class="identifier">s</span></code>
|
||
and continues looping. Otherwise, the function evaluates <code class="computeroutput"><span class="identifier">err</span> <span class="special">=</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code>.
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> An iterator pointing just
|
||
beyond the last character that can be determined to be part of a valid
|
||
time_point.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_get_hpp.time_point_get.get2"></a><a class="link" href="reference.html#chrono.reference.io.time_point_get_hpp.time_point_get.get2" title="Template Member Function get(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,time_point<Clock,Duration>&)">Template
|
||
Member Function <code class="computeroutput"><span class="identifier">get</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&,</span><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span><span class="identifier">Duration</span><span class="special">>&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">iter_type</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="special">&</span><span class="identifier">tp</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>s:</strong></span> start input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>end:</strong></span> end input stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a <code class="computeroutput"><span class="identifier">ios_base</span></code>
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>err:</strong></span> the <code class="computeroutput"><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span></code>
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>tp:</strong></span> the <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Stores the duration pattern
|
||
from the <code class="computeroutput"><span class="identifier">duration_unit</span></code>
|
||
facet in let say <code class="computeroutput"><span class="identifier">str</span></code>.
|
||
Last as if
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">return</span> <span class="identifier">get</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">err</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">d</span><span class="special">,</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">data</span><span class="special">(),</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">data</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">size</span><span class="special">());</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> An iterator pointing just
|
||
beyond the last character that can be determined to be part of a valid
|
||
name.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_get_hpp.time_point_get.get_duration"></a><a class="link" href="reference.html#chrono.reference.io.time_point_get_hpp.time_point_get.get_duration" title="Template Member Function get_duration(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&,duration<Rep,Period>&)">Template
|
||
Member Function <code class="computeroutput"><span class="identifier">get_duration</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&,</span><span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span><span class="identifier">Period</span><span class="special">>&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">get_duration</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">iter_type</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> As if
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">return</span> <span class="identifier">facet</span><span class="special">.</span><span class="identifier">get</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">err</span><span class="special">,</span> <span class="identifier">d</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
where <code class="computeroutput"><span class="identifier">facet</span></code> is either
|
||
the <code class="computeroutput"><span class="identifier">duration_get</span></code> facet
|
||
associated to the <code class="computeroutput"><span class="identifier">ios</span></code>
|
||
or an instance of the default <code class="computeroutput"><span class="identifier">duration_get</span></code>
|
||
facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> An iterator pointing just
|
||
beyond the last character that can be determined to be part of a valid
|
||
duration.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_get_hpp.time_point_get.get_epoch"></a><a class="link" href="reference.html#chrono.reference.io.time_point_get_hpp.time_point_get.get_epoch" title="Template Member Function get_epoch(iter_type,iter_type,std::ios_base&,std::ios_base::iostate&)">Template
|
||
Member Function <code class="computeroutput"><span class="identifier">get_epoch</span><span class="special">(</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">iter_type</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">get_epoch</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">iter_type</span> <span class="identifier">end</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">iostate</span><span class="special">&</span> <span class="identifier">err</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Let <code class="computeroutput"><span class="identifier">facet</span></code>
|
||
be the <a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units" title="Template Class time_point_units"><code class="computeroutput"><span class="identifier">time_point_units</span></code></a> facet associated
|
||
to <code class="computeroutput"><span class="identifier">ios</span></code> or a new instance
|
||
of the default __time_point_units_default facet. Let <code class="computeroutput"><span class="identifier">epoch</span></code> be the epoch string associated
|
||
to the <code class="computeroutput"><span class="identifier">Clock</span></code> using
|
||
this facet. Scans <code class="computeroutput"><span class="identifier">s</span></code>
|
||
to match <code class="computeroutput"><span class="identifier">epoch</span></code> or
|
||
<code class="computeroutput"><span class="identifier">end</span></code> is reached.
|
||
</p>
|
||
<p>
|
||
If not match before the <code class="computeroutput"><span class="identifier">end</span></code>
|
||
is reached <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code> is set in <code class="computeroutput"><span class="identifier">err</span></code>.
|
||
If <code class="computeroutput"><span class="identifier">end</span></code> is reached
|
||
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span></code> is set in <code class="computeroutput"><span class="identifier">err</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> An iterator pointing just
|
||
beyond the last character that can be determined to be part of a epoch.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.time_point_put_hpp"></a><a class="link" href="reference.html#chrono.reference.io.time_point_put_hpp" title="Header <boost/chrono/io/time_point_put.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_put</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc"><dt><span class="section"><a href="reference.html#chrono.reference.io.time_point_put_hpp.time_point_put">Template
|
||
Class <code class="computeroutput"><span class="identifier">time_point_put</span></code></a></span></dt></dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">OutputIterator</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostreambuf_iterator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">time_point_put</span><span class="special">;</span>
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.time_point_put_hpp.time_point_put"></a><a class="link" href="reference.html#chrono.reference.io.time_point_put_hpp.time_point_put" title="Template Class time_point_put">Template
|
||
Class <code class="computeroutput"><span class="identifier">time_point_put</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
The __time_point_put facet provides facilities for formatted output of
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> values. The member
|
||
function of __time_point_put take a <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a> and format it into
|
||
character string representation.
|
||
</p>
|
||
<p>
|
||
tparam ChatT a character type tparam OutputIterator a model of <code class="computeroutput"><span class="identifier">OutputIterator</span></code>
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">OutputIterator</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostreambuf_iterator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">time_point_put</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">facet</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span> <span class="comment">// Type of character the facet is instantiated on.</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span> <span class="comment">// Type of character string passed to member functions.</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">OutputIterator</span> <span class="identifier">iter_type</span><span class="special">;</span> <span class="comment">// Type of iterator used to write in the character buffer.</span>
|
||
|
||
<span class="keyword">explicit</span> <span class="identifier">time_point_put</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
<span class="special">~</span><span class="identifier">time_point_put</span><span class="special">();</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">tp</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*</span> <span class="identifier">pattern</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*</span> <span class="identifier">pat_end</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">tp</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put_duration</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put_epoch</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">os</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">;</span> <span class="comment">// Unique identifier for this type of facet.</span>
|
||
|
||
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_put_hpp.time_point_put.c"></a><a class="link" href="reference.html#chrono.reference.io.time_point_put_hpp.time_point_put.c" title="Constructor time_point_get(size_t)">Constructor
|
||
<code class="computeroutput"><span class="identifier">time_point_get</span><span class="special">(</span><span class="identifier">size_t</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">time_point_put</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
Construct a time_point_put facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Construct a time_point_put
|
||
facet. If the <code class="computeroutput"><span class="identifier">refs</span></code>
|
||
argument is <code class="computeroutput"><span class="number">0</span></code> then destruction
|
||
of the object is delegated to the locale, or locales, containing it.
|
||
This allows the user to ignore lifetime management issues. On the other
|
||
had, if <code class="computeroutput"><span class="identifier">refs</span></code> is <code class="computeroutput"><span class="number">1</span></code> then the object must be explicitly
|
||
deleted; the locale will not do so. In this case, the object can be
|
||
maintained across the lifetime of multiple locales.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>refs:</strong></span> references
|
||
</li></ul></div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_put_hpp.time_point_put.put1"></a><a class="link" href="reference.html#chrono.reference.io.time_point_put_hpp.time_point_put.put1" title="Member Function put()">Member
|
||
Function <code class="computeroutput"><span class="identifier">put</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">tp</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*</span> <span class="identifier">pattern</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*</span> <span class="identifier">pat_end</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>i:</strong></span> an output stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>fill:</strong></span> the character used as filler
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>tp:</strong></span> the <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pattern:</strong></span> begin of the formatting
|
||
pattern
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pat_end:</strong></span> end of the formatting
|
||
pattern
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Steps through the sequence
|
||
from <code class="computeroutput"><span class="identifier">pattern</span></code> to <code class="computeroutput"><span class="identifier">pat_end</span></code>, identifying characters that
|
||
are part of a pattern sequence. Each character that is not part of
|
||
a pattern sequence is written to <code class="computeroutput"><span class="identifier">s</span></code>
|
||
immediately, and each pattern sequence, as it is identified, results
|
||
in a call to __put_duration or __put_epoch; thus, pattern elements
|
||
and other characters are interleaved in the output in the order in
|
||
which they appear in the pattern. Pattern sequences are identified
|
||
by converting each character <code class="computeroutput"><span class="identifier">c</span></code>
|
||
to a <code class="computeroutput"><span class="keyword">char</span></code> value as if
|
||
by <code class="computeroutput"><span class="identifier">ct</span><span class="special">.</span><span class="identifier">narrow</span><span class="special">(</span><span class="identifier">c</span><span class="special">,</span><span class="number">0</span><span class="special">)</span></code>, where
|
||
<code class="computeroutput"><span class="identifier">ct</span></code> is a reference to
|
||
<code class="computeroutput"><span class="identifier">ctype</span><span class="special"><</span><span class="identifier">charT</span><span class="special">></span></code>
|
||
obtained from <code class="computeroutput"><span class="identifier">ios</span><span class="special">.</span><span class="identifier">getloc</span><span class="special">()</span></code>.
|
||
The first character of each sequence is equal to <code class="computeroutput"><span class="char">'%'</span></code>,
|
||
followed by a pattern specifier character spec, which can be <code class="computeroutput"><span class="char">'d'</span></code> for the duration value or <code class="computeroutput"><span class="char">'e'</span></code> for the epoch. For each valid pattern
|
||
sequence identified, calls <code class="computeroutput"><span class="identifier">put_duration</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">tp</span><span class="special">.</span><span class="identifier">time_since_epoch</span><span class="special">())</span></code> or <code class="computeroutput"><span class="identifier">put_epoch</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> An iterator pointing immediately
|
||
after the last character produced.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_put_hpp.time_point_put.put2"></a><a class="link" href="reference.html#chrono.reference.io.time_point_put_hpp.time_point_put.put2" title="Member Function put()">Member
|
||
Function <code class="computeroutput"><span class="identifier">put</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Duration</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">Duration</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">tp</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>i:</strong></span> an output stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>fill:</strong></span> the character used as filler
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>tp:</strong></span> the <a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a>
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>tern:</strong></span> begin of the formatting
|
||
pattern
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>pat_end:</strong></span> end of the formatting
|
||
pattern
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Stores the time_point pattern
|
||
from the __time_point_unit facet in let say <code class="computeroutput"><span class="identifier">str</span></code>.
|
||
Last as if
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">return</span> <span class="identifier">put</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">tp</span><span class="special">,</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">data</span><span class="special">(),</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">data</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">size</span><span class="special">());</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> An iterator pointing immediately
|
||
after the last character produced.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_put_hpp.time_point_put.put_duration"></a><a class="link" href="reference.html#chrono.reference.io.time_point_put_hpp.time_point_put.put_duration" title="Member Function put_duration()">Member
|
||
Function <code class="computeroutput"><span class="identifier">put_duration</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put_duration</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">char_type</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">d</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>i:</strong></span> an output stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>fill:</strong></span> the character used as filler
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>d:</strong></span> the <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a>
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> As if <code class="computeroutput"><span class="identifier">facet</span><span class="special">.</span><span class="identifier">put</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">ios</span><span class="special">,</span> <span class="identifier">fill</span><span class="special">,</span> <span class="identifier">d</span><span class="special">)</span></code> where facet is the <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put" title="Template Class duration_put"><code class="computeroutput"><span class="identifier">duration_put</span></code></a><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code>
|
||
facet associated to the <code class="computeroutput"><span class="identifier">ios</span></code>
|
||
or a new instance of <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.duration_put_hpp.duration_put" title="Template Class duration_put"><code class="computeroutput"><span class="identifier">duration_put</span></code></a><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> An iterator pointing immediately
|
||
after the last character produced.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_put_hpp.time_point_put.put_epoch"></a><a class="link" href="reference.html#chrono.reference.io.time_point_put_hpp.time_point_put.put_epoch" title="Member Function put_epoch()">Member
|
||
Function <code class="computeroutput"><span class="identifier">put_epoch</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">></span>
|
||
<span class="identifier">iter_type</span> <span class="identifier">put_epoch</span><span class="special">(</span><span class="identifier">iter_type</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">&</span> <span class="identifier">os</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<span class="bold"><strong>i:</strong></span> an output stream iterator
|
||
</li>
|
||
<li class="listitem">
|
||
<span class="bold"><strong>ios:</strong></span> a reference to a ios_base
|
||
</li>
|
||
</ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> As if
|
||
</p>
|
||
<pre class="programlisting"><span class="identifier">string_type</span> <span class="identifier">str</span> <span class="special">=</span> <span class="identifier">facet</span><span class="special">.</span><span class="keyword">template</span> <span class="identifier">get_epoch</span><span class="special"><</span><span class="identifier">Clock</span><span class="special">>();</span>
|
||
<span class="identifier">s</span><span class="special">=</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">copy</span><span class="special">(</span><span class="identifier">str</span><span class="special">.</span><span class="identifier">begin</span><span class="special">(),</span> <span class="identifier">str</span><span class="special">.</span><span class="identifier">end</span><span class="special">(),</span> <span class="identifier">s</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
where facet is the <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units" title="Template Class time_point_units"><code class="computeroutput"><span class="identifier">time_point_units</span></code></a><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code>
|
||
facet associated to the <code class="computeroutput"><span class="identifier">ios</span></code>
|
||
or a new instance of <code class="computeroutput"><span class="identifier">__time_point_units_default</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> s, iterator pointing immediately
|
||
after the last character produced.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp" title="Header <boost/chrono/io/time_point_units.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_units</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.time_point_units_hpp.get_epoch_custom">Template
|
||
Function <code class="computeroutput"><span class="identifier">get_epoch_custom</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units">Template
|
||
Class <code class="computeroutput"><span class="identifier">time_point_units</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units_default">Template
|
||
Class <code class="computeroutput"><span class="identifier">time_point_units_default</span></code></a></span></dt>
|
||
</dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">TPUFacet</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">get_epoch_custom</span><span class="special">(</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">TPUFacet</span><span class="special">&</span> <span class="identifier">f</span><span class="special">);</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">time_point_units</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">time_point_units_default</span><span class="special">,</span>
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.get_epoch_custom"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.get_epoch_custom" title="Template Function get_epoch_custom">Template
|
||
Function <code class="computeroutput"><span class="identifier">get_epoch_custom</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">TPUFacet</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">get_epoch_custom</span><span class="special">(</span><span class="identifier">Clock</span><span class="special">,</span> <span class="identifier">TPUFacet</span><span class="special">&</span> <span class="identifier">f</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
Customization point to the epoch associated to the clock <code class="computeroutput"><span class="identifier">Clock</span></code> The default calls <code class="computeroutput"><span class="identifier">f</span><span class="special">.</span><span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">Clock</span><span class="special">())</span></code>.
|
||
</p>
|
||
<p>
|
||
The user can overload this function.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> Forwards the call to the facet
|
||
as if
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">return</span> <span class="identifier">f</span><span class="special">.</span><span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">Clock</span><span class="special">());</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units" title="Template Class time_point_units">Template
|
||
Class <code class="computeroutput"><span class="identifier">time_point_units</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units" title="Template Class time_point_units"><code class="computeroutput"><span class="identifier">time_point_units</span></code></a> facet gives
|
||
useful information about the time_point pattern, the text associated
|
||
to a time_point's epoch,
|
||
</p>
|
||
<pre class="programlisting"> <span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">time_point_units</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">facet</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span> <span class="comment">// Type of character the facet is instantiated on.</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">char_type</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span> <span class="comment">// Type of character string used by member functions.</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">::</span><span class="identifier">id</span> <span class="identifier">id</span><span class="special">;</span> <span class="comment">// Unique identifier for this type of facet.</span>
|
||
|
||
<span class="keyword">explicit</span> <span class="identifier">time_point_units</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">get_pattern</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">></span>
|
||
<span class="identifier">string_type</span> <span class="identifier">get_epoch</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">protected</span><span class="special">:</span>
|
||
<span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">time_point_units</span><span class="special">();</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">system_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">steady_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
|
||
<span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_PROCESS_CLOCKS</span><span class="special">)</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_real_cpu_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_user_cpu_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_system_cpu_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_cpu_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="preprocessor">#endif</span>
|
||
<span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_THREAD_CLOCK</span><span class="special">)</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">thread_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="preprocessor">#endif</span>
|
||
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units.c"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units.c" title="Constructor time_point_units()">Constructor
|
||
<code class="computeroutput"><span class="identifier">time_point_units</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">explicit</span> <span class="identifier">time_point_units</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
Construct a <a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units" title="Template Class time_point_units"><code class="computeroutput"><span class="identifier">time_point_units</span></code></a> facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>refs:</strong></span> references
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Construct a <a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units" title="Template Class time_point_units"><code class="computeroutput"><span class="identifier">time_point_units</span></code></a> facet. If
|
||
the <code class="computeroutput"><span class="identifier">refs</span></code> argument is
|
||
<code class="computeroutput"><span class="number">0</span></code> then destruction of the
|
||
object is delegated to the locale, or locales, containing it. This
|
||
allows the user to ignore lifetime management issues. On the other
|
||
had, if <code class="computeroutput"><span class="identifier">refsv</span> <span class="identifier">is</span>
|
||
</code>1` then the object must be explicitly deleted; the locale will
|
||
not do so. In this case, the object can be maintained across the lifetime
|
||
of multiple locales.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units.get_pattern"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units.get_pattern" title="Member Function get_pattern()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_pattern</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">get_pattern</span><span class="special">()</span> <span class="keyword">const</span> <span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the pattern to be used by
|
||
default.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units.get_epoch"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units.get_epoch" title="Member Function get_epoch()">Member
|
||
Function <code class="computeroutput"><span class="identifier">get_epoch</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Clock</span><span class="special">></span>
|
||
<span class="identifier">string_type</span> <span class="identifier">get_epoch</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> the epoch associated to the
|
||
clock <code class="computeroutput"><span class="identifier">Clock</span></code> as if
|
||
<code class="computeroutput"><span class="keyword">return</span> <span class="identifier">get_epoch_custom</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">>(</span><span class="identifier">Clock</span><span class="special">(),</span> <span class="special">*</span><span class="keyword">this</span><span class="special">);</span> </code>
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units.d"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units.d" title="Destructor time_point_units()">Destructor
|
||
<code class="computeroutput"><span class="identifier">time_point_units</span><span class="special">()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="special">~</span><span class="identifier">time_point_units</span><span class="special">();</span>
|
||
</pre>
|
||
<p>
|
||
Destroy the facet.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_system_clock"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_system_clock" title="Member Function do_get_epoch(system_clock)">Member
|
||
Function <code class="computeroutput"><span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">system_clock</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">system_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>c:</strong></span> a dummy instance of <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock" title="Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a>.
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> The epoch string associated
|
||
to the <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.system_clock" title="Class system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_steady_clock"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_steady_clock" title="Member Function do_get_epoch(steady_clock)">Member
|
||
Function <code class="computeroutput"><span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">steady_clock</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">steady_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>c:</strong></span> a dummy instance of <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock" title="Class steady_clock"><code class="computeroutput"><span class="identifier">steady_clock</span></code></a>.
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> The epoch string associated
|
||
to the <a class="link" href="reference.html#chrono.reference.cpp0x.system_clocks_hpp.steady_clock" title="Class steady_clock"><code class="computeroutput"><span class="identifier">steady_clock</span></code></a>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_process_real_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_process_real_cpu_clock" title="Member Function do_get_epoch(process_real_cpu_clock)">Member
|
||
Function <code class="computeroutput"><span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_real_cpu_clock</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_PROCESS_CLOCKS</span><span class="special">)</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_real_cpu_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="preprocessor">#endif</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>c:</strong></span> a dummy instance of <a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a>.
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> The epoch string associated
|
||
to the <a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a>.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_process_user_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_process_user_cpu_clock" title="Member Function do_get_epoch(process_user_cpu_clock)">Member
|
||
Function <code class="computeroutput"><span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_user_cpu_clock</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_PROCESS_CLOCKS</span><span class="special">)</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_user_cpu_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="preprocessor">#endif</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>c:</strong></span> a dummy instance of <a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a>.
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> The epoch string associated
|
||
to the process_user_cpu_clock.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_process_system_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_process_system_cpu_clock" title="Member Function do_get_epoch(process_system_cpu_clock)">Member
|
||
Function <code class="computeroutput"><span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_system_cpu_clock</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_PROCESS_CLOCKS</span><span class="special">)</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_system_cpu_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="preprocessor">#endif</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>c:</strong></span> a dummy instance of <a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_system_cpu_clock" title="Class process_system_cpu_clock"><code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a>.
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> The epoch string associated
|
||
to the process_user_cpu_clock.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_process_process_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_process_process_cpu_clock" title="Member Function do_get_epoch(process_cpu_clock)">Member
|
||
Function <code class="computeroutput"><span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_cpu_clock</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_PROCESS_CLOCKS</span><span class="special">)</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_cpu_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="preprocessor">#endif</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>c:</strong></span> a dummy instance of <a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_cpu_clock" title="Class process_cpu_clock"><code class="computeroutput"><span class="identifier">process_cpu_clock</span></code></a>.
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> The epoch string associated
|
||
to the process_cpu_clock.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_process_thread_clock"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units.do_get_epoch_process_thread_clock" title="Member Function do_get_epoch(thread_clock)">Member
|
||
Function <code class="computeroutput"><span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">thread_clock</span><span class="special">)</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_THREAD_CLOCK</span><span class="special">)</span>
|
||
<span class="keyword">virtual</span> <span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">thread_clock</span><span class="special">)</span> <span class="keyword">const</span><span class="special">=</span><span class="number">0</span><span class="special">;</span>
|
||
<span class="preprocessor">#endif</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Parameters:</strong></span>
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
|
||
<span class="bold"><strong>c:</strong></span> a dummy instance of <a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a>.
|
||
</li></ul></div>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> The epoch string associated
|
||
to the <a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.time_point_units_hpp.time_point_units_default"></a><a class="link" href="reference.html#chrono.reference.io.time_point_units_hpp.time_point_units_default" title="Template Class time_point_units_default">Template
|
||
Class <code class="computeroutput"><span class="identifier">time_point_units_default</span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"> <span class="comment">// This class is used to define the strings for the default English</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span><span class="special">=</span><span class="keyword">char</span><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">time_point_units_default</span><span class="special">:</span> <span class="keyword">public</span> <span class="identifier">time_point_units</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">CharT</span> <span class="identifier">char_type</span><span class="special">;</span> <span class="comment">// Type of character the facet is instantiated on.</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">char_type</span><span class="special">></span> <span class="identifier">string_type</span><span class="special">;</span> <span class="comment">// Type of character string used by member functions.</span>
|
||
|
||
<span class="keyword">explicit</span> <span class="identifier">time_point_units_default</span><span class="special">(</span><span class="identifier">size_t</span> <span class="identifier">refs</span> <span class="special">=</span> <span class="number">0</span><span class="special">);</span>
|
||
<span class="special">~</span><span class="identifier">time_point_units_default</span><span class="special">();</span>
|
||
|
||
<span class="comment">/**
|
||
* __returns the default pattern "%d%e".
|
||
*/</span>
|
||
<span class="identifier">string_type</span> <span class="identifier">get_pattern</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">protected</span><span class="special">:</span>
|
||
<span class="comment">/**
|
||
* [param c a dummy instance of __system_clock.
|
||
* __returns The epoch string returned by `clock_string<system_clock,CharT>::since()`.
|
||
*/</span>
|
||
<span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">system_clock</span> <span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="comment">/**
|
||
* [param c a dummy instance of __steady_clock.
|
||
* __returns The epoch string returned by `clock_string<steady_clock,CharT>::since()`.
|
||
*/</span>
|
||
<span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">steady_clock</span> <span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_PROCESS_CLOCKS</span><span class="special">)</span>
|
||
<span class="comment">/**
|
||
* [param c a dummy instance of __process_real_cpu_clock.
|
||
* __returns The epoch string returned by `clock_string<process_real_cpu_clock,CharT>::since()`.
|
||
*/</span>
|
||
<span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_real_cpu_clock</span> <span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="comment">/**
|
||
* [param c a dummy instance of __process_user_cpu_clock.
|
||
* __returns The epoch string returned by `clock_string<process_user_cpu_clock,CharT>::since()`.
|
||
*/</span>
|
||
<span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_user_cpu_clock</span> <span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="comment">/**
|
||
* [param c a dummy instance of __process_system_cpu_clock.
|
||
* __returns The epoch string returned by `clock_string<process_system_cpu_clock,CharT>::since()`.
|
||
*/</span>
|
||
<span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_system_cpu_clock</span> <span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="comment">/**
|
||
* [param c a dummy instance of __process_cpu_clock.
|
||
* __returns The epoch string returned by `clock_string<process_cpu_clock,CharT>::since()`.
|
||
*/</span>
|
||
<span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">process_cpu_clock</span> <span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="preprocessor">#endif</span>
|
||
<span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_THREAD_CLOCK</span><span class="special">)</span>
|
||
<span class="comment">/**
|
||
* [param c a dummy instance of __thread_clock.
|
||
* __returns The epoch string returned by `clock_string<thread_clock,CharT>::since()`.
|
||
*/</span>
|
||
<span class="identifier">string_type</span> <span class="identifier">do_get_epoch</span><span class="special">(</span><span class="identifier">thread_clock</span> <span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="preprocessor">#endif</span>
|
||
|
||
<span class="special">};</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.io.time_point_io_hpp"></a><a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp" title="Header <boost/chrono/io/time_point_io.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">io</span><span class="special">/</span><span class="identifier">time_point_io</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.time_point_io_hpp.manip">I/O
|
||
Manipulators</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.io.time_point_io_hpp.streams">I/O
|
||
Streams Operations</a></span></dt>
|
||
</dl></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
|
||
<span class="comment">// manipulators</span>
|
||
|
||
<span class="identifier">unspecified</span> <a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp.manip.time_fmt1" title="Non Member Function time_fmt(timezone)"><code class="computeroutput"><span class="identifier">time_fmt</span></code></a><span class="special">(</span><span class="identifier">timezone</span> <span class="identifier">tz</span><span class="special">);</span>
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="identifier">unspecified</span> <a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp.manip.time_fmt2" title="Non Member Function time_fmt(timezone, string)"><code class="computeroutput"><span class="identifier">time_fmt</span></code></a><span class="special">(</span><span class="identifier">timezone</span> <span class="identifier">tz</span><span class="special">,</span> <span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">f</span><span class="special">);</span>
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="identifier">unspecified</span> <a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp.manip.time_fmt2" title="Non Member Function time_fmt(timezone, string)"><code class="computeroutput"><span class="identifier">time_fmt</span></code></a><span class="special">(</span><span class="identifier">timezone</span> <span class="identifier">tz</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*</span> <span class="identifier">f</span><span class="special">);</span>
|
||
|
||
<span class="comment">// i/o state savers</span>
|
||
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span> <span class="special">=</span> <span class="keyword">char</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver" title="Template Class timezone_io_saver<>"><code class="computeroutput"><span class="identifier">timezone_io_saver</span></code></a>
|
||
<span class="special">{</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ios</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">></span> <span class="identifier">state_type</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">timezone</span> <span class="identifier">aspect_type</span><span class="special">;</span>
|
||
|
||
<span class="keyword">explicit</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.c1" title="Constructor timezone_io_saver(state_type&)"><code class="computeroutput"><span class="identifier">timezone_io_saver</span></code></a><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">);</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.c2" title="Constructor timezone_io_saver(state_type&, aspect_type)"><code class="computeroutput"><span class="identifier">timezone_io_saver</span></code></a><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">aspect_type</span> <span class="identifier">new_value</span><span class="special">);</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.timezone_io_saver.d" title="Destructor ~timezone_io_saver()"><code class="computeroutput"><span class="special">~</span><span class="identifier">timezone_io_saver</span></code></a><span class="special">();</span>
|
||
<span class="keyword">void</span> <span class="identifier">timezone_io_saver__restore</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> <span class="identifier">CharT</span> <span class="special">=</span> <span class="keyword">char</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Traits</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="special">></span>
|
||
<span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.ioss.time_fmt_io_saver" title="Template Class time_fmt_io_saver<>"><code class="computeroutput"><span class="identifier">time_fmt_io_saver</span></code></a>
|
||
<span class="special">{</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ios</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">></span> <span class="identifier">state_type</span><span class="special">;</span>
|
||
|
||
<span class="keyword">explicit</span> <span class="identifier">time_fmt_io_saver</span><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">);</span>
|
||
<span class="identifier">time_fmt_io_saver</span><span class="special">(</span><span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">new_value</span><span class="special">);</span>
|
||
<span class="special">~</span> <span class="identifier">time_fmt_io_saver</span><span class="special">();</span>
|
||
<span class="keyword">void</span> <span class="identifier">restore</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
|
||
<span class="comment">// system_clock I/O</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span>
|
||
<span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span>
|
||
<span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span>
|
||
<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
|
||
<span class="comment">// Other Clocks I/O</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span>
|
||
<span class="identifier">time_point</span><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
|
||
<span class="special">}</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.time_point_io_hpp.manip"></a><a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp.manip" title="I/O Manipulators">I/O
|
||
Manipulators</a>
|
||
</h5></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_io_hpp.manip.time_fmt1"></a>Non Member Function <code class="computeroutput"><span class="identifier">time_fmt</span><span class="special">(</span><a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">timezone</span></code></a><span class="special">)</span></code>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="identifier">unspecified</span> <span class="identifier">time_fmt</span><span class="special">(</span><a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">timezone</span></code></a> <span class="identifier">tz</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span>: An unspecified object that
|
||
when streamed to a <code class="computeroutput"><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">></span></code> or <code class="computeroutput"><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">></span></code> <code class="computeroutput"><span class="identifier">s</span></code>
|
||
will have the effects of:
|
||
</p>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_timezone" title="Non Member Function set_timezone(std::ios_base&,duration_style)"><code class="computeroutput"><span class="identifier">set_timezone</span></code></a><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">tz</span><span class="special">);</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_io_hpp.manip.time_fmt2"></a>Non Member Function <code class="computeroutput"><span class="identifier">time_fmt</span><span class="special">(</span><a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">timezone</span></code></a><span class="special">,</span>
|
||
<span class="identifier">string</span><span class="special">)</span></code>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="identifier">unspecified</span> <span class="identifier">time_fmt</span><span class="special">(</span><span class="identifier">timezone</span> <span class="identifier">tz</span><span class="special">,</span> <span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">f</span><span class="special">);</span>
|
||
<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="identifier">unspecified</span> <span class="identifier">time_fmt</span><span class="special">(</span><span class="identifier">timezone</span> <span class="identifier">tz</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*</span> <span class="identifier">f</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span>: An unspecified object that
|
||
when streamed to a <code class="computeroutput"><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">></span></code> or <code class="computeroutput"><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">></span></code> <code class="computeroutput"><span class="identifier">s</span></code>
|
||
will have the effects of:
|
||
</p>
|
||
<pre class="programlisting"><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_timezone" title="Non Member Function set_timezone(std::ios_base&,duration_style)"><code class="computeroutput"><span class="identifier">set_timezone</span></code></a><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">tz</span><span class="special">);</span>
|
||
<a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.set_time_fmt" title="Non Member Function set_time_fmt(std::ios_base&, std::basic_string<CharT> const&)"><code class="computeroutput"><span class="identifier">set_time_fmt</span></code></a><span class="special"><</span><span class="identifier">CharT</span><span class="special">>(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">f</span><span class="special">);</span>
|
||
</pre>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.io.time_point_io_hpp.streams"></a><a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp.streams" title="I/O Streams Operations">I/O
|
||
Streams Operations</a>
|
||
</h5></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_io_hpp.streams.system_clock"></a><a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp.streams.system_clock" title="system_clock"><code class="computeroutput"><span class="identifier">system_clock</span></code></a>
|
||
</h6></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_io_hpp.streams.system_clock.op_out"></a><a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp.streams.system_clock.op_out" title="Non Member Function operator<<()">Non
|
||
Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Behaves as a formatted
|
||
output function. After constructing a <code class="computeroutput"><span class="identifier">sentry</span></code>
|
||
object, if the <code class="computeroutput"><span class="identifier">sentry</span></code>
|
||
converts to <code class="computeroutput"><span class="keyword">true</span></code>, sets
|
||
a local variable <code class="computeroutput"><span class="identifier">tz</span></code>
|
||
of type <a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">timezone</span></code></a> to <code class="computeroutput"><span class="identifier">get_timezone</span><span class="special">(</span><span class="identifier">os</span><span class="special">)</span></code>.
|
||
Additionally the format string obtained with <code class="computeroutput"><a class="link" href="reference.html#chrono.reference.io.ios_state_hpp.sag.get_time_fmt" title="Non Member Function get_time_fmt(std::ios_base &)"><code class="computeroutput"><span class="identifier">get_time_fmt</span></code></a><span class="special">()</span></code>
|
||
is recorded as a pair of <code class="computeroutput"><span class="keyword">const</span>
|
||
<span class="identifier">CharT</span><span class="special">*</span></code>.
|
||
If the stream has no time_punct facet, then this pair of <code class="computeroutput"><span class="keyword">const</span> <span class="identifier">CharT</span><span class="special">*</span></code> that represent an empty range.
|
||
</p>
|
||
<p>
|
||
Next <code class="computeroutput"><span class="identifier">tp</span></code> is converted
|
||
to a <code class="computeroutput"><span class="identifier">time_t</span></code>, and
|
||
this <code class="computeroutput"><span class="identifier">time_t</span></code> is converted
|
||
to a <code class="computeroutput"><span class="identifier">tm</span></code>. The conversion
|
||
to <code class="computeroutput"><span class="identifier">tm</span></code> use <code class="computeroutput"><span class="identifier">gmtime</span></code> (when available) if the
|
||
timezone is <a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">utc</span></code></a>, else it use localtime
|
||
(if available).
|
||
</p>
|
||
<p>
|
||
Using the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">time_put</span></code> facet stored in <code class="computeroutput"><span class="identifier">os</span></code>, this inserter writes characters
|
||
to the stream using the <code class="computeroutput"><span class="identifier">tm</span></code>
|
||
and the formatting string stored in the <code class="computeroutput"><span class="identifier">time_punct</span></code>
|
||
facet, unless that facet was missing, or unless it provided an empty
|
||
string.
|
||
</p>
|
||
<p>
|
||
If the formatting string is empty, then output as follows:
|
||
</p>
|
||
<p>
|
||
First output <code class="computeroutput"><span class="identifier">tm</span></code> using
|
||
<code class="computeroutput"><span class="string">"%F %H:%M:"</span></code>
|
||
</p>
|
||
<p>
|
||
Next output a <code class="computeroutput"><span class="keyword">double</span></code>
|
||
representing the number of seconds stored in the <code class="computeroutput"><span class="identifier">tm</span></code>
|
||
plus the fractional seconds represented in <code class="computeroutput"><span class="identifier">tp</span></code>.
|
||
The format shall be <code class="computeroutput"><span class="identifier">ios</span><span class="special">::</span><span class="identifier">fixed</span></code>
|
||
and the precision shall be sufficient to represent <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">duration</span></code> exactly (e.g. if <code class="computeroutput"><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">period</span></code> is micro, the precision
|
||
should be sufficient to output six digits following the decimal point).
|
||
If the number of seconds is less than <code class="computeroutput"><span class="number">10</span></code>,
|
||
the output shall be prefixed by <code class="computeroutput"><span class="char">'0'</span></code>.
|
||
</p>
|
||
<p>
|
||
Finally if <code class="computeroutput"><span class="identifier">tz</span></code> is
|
||
<a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">local</span></code></a>, output the <code class="computeroutput"><span class="identifier">tm</span></code> using the pattern " %z".
|
||
Else append the sequence " +0000" to the stream.
|
||
</p>
|
||
<p>
|
||
If any step fails, calls <code class="computeroutput"><span class="identifier">os</span><span class="special">.</span><span class="identifier">setstate</span><span class="special">(</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span>
|
||
<span class="special">|</span> <span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">badbit</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">os</span></code>
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_io_hpp.streams.system_clock.op_in"></a><a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp.streams.system_clock.op_in" title="Non Member Function operator>>()">Non
|
||
Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>>()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span>
|
||
<span class="identifier">time_point</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Behaves as a formatted
|
||
input function. After constructing a sentry object, if the sentry
|
||
converts to true, obtains a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">time_get</span></code>
|
||
facet from <code class="computeroutput"><span class="identifier">is</span></code>, and
|
||
obtains a formatting string in the same manner as described for insertion
|
||
operator. Extract a <code class="computeroutput"><span class="identifier">tm</span></code>
|
||
using the supplied formatting string, or if empty, defaulted as described
|
||
for the insertion operator. Note that extraction does not use the
|
||
<a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">timezone</span></code></a> data stored in
|
||
the <code class="computeroutput"><span class="identifier">is</span></code> for the defaulted
|
||
string as the <a class="link" href="reference.html#chrono.reference.io.timezone_hpp.timezone" title="Scoped enum timezone"><code class="computeroutput"><span class="identifier">timezone</span></code></a> information is
|
||
stored in the stream.
|
||
</p>
|
||
<p>
|
||
Any <code class="computeroutput"><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">,</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span></code>
|
||
inserted, and then extracted should result in an equal <code class="computeroutput"><span class="identifier">time_point</span><span class="special"><</span><span class="identifier">system_clock</span><span class="special">,</span>
|
||
<a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span></code>,
|
||
excepting any precision that did not get inserted.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Example:</strong></span>
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">test</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">tp</span><span class="special">)</span>
|
||
<span class="special">{</span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">stringstream</span> <span class="identifier">s</span><span class="special">;</span>
|
||
<span class="identifier">s</span> <span class="special"><<</span> <span class="identifier">tp</span><span class="special">;</span>
|
||
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">system_clock</span><span class="special">::</span><span class="identifier">time_point</span> <span class="identifier">tp2</span><span class="special">;</span>
|
||
<span class="identifier">s</span> <span class="special">>></span> <span class="identifier">tp2</span><span class="special">;</span>
|
||
<span class="identifier">assert</span><span class="special">(</span><span class="identifier">tp</span> <span class="special">==</span> <span class="identifier">tp2</span><span class="special">);</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> is
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_io_hpp.streams.other_clocks"></a><a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp.streams.other_clocks" title="Other Clocks">Other
|
||
Clocks</a>
|
||
</h6></div></div></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_io_hpp.streams.other_clocks.op_out"></a><a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp.streams.other_clocks.op_out" title="Non Member Function operator<<()">Non
|
||
Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special"><<()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span>
|
||
<span class="keyword">const</span> <span class="identifier">time_point</span><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Behaves as a formatted
|
||
output function. After constructing a <code class="computeroutput"><span class="identifier">sentry</span></code>
|
||
object, if the <code class="computeroutput"><span class="identifier">sentry</span></code>
|
||
converts to <code class="computeroutput"><span class="keyword">true</span></code>, calls
|
||
to <code class="computeroutput"><span class="identifier">facet</span><span class="special">.</span><span class="identifier">put</span><span class="special">(</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">os</span><span class="special">,</span><span class="identifier">os</span><span class="special">.</span><span class="identifier">fill</span><span class="special">(),</span><span class="identifier">tp</span><span class="special">)</span></code>
|
||
where <code class="computeroutput"><span class="identifier">facet</span></code> is the
|
||
<code class="computeroutput"><span class="identifier">time_point_put</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code>
|
||
facet associated to <code class="computeroutput"><span class="identifier">os</span></code>
|
||
or a new created instance of the default <code class="computeroutput"><span class="identifier">time_point_put</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code> facet.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">os</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Example:</strong></span>
|
||
</p>
|
||
<pre class="programlisting"><span class="number">22644271279698</span> <span class="identifier">nanoseconds</span> <span class="identifier">since</span> <span class="identifier">boot</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h6 class="title">
|
||
<a name="chrono.reference.io.time_point_io_hpp.streams.other_clocks.op_in"></a><a class="link" href="reference.html#chrono.reference.io.time_point_io_hpp.streams.other_clocks.op_in" title="Non Member Function operator>>()">Non
|
||
Member Function <code class="computeroutput"><span class="keyword">operator</span><span class="special">>>()</span></code></a>
|
||
</h6></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span>
|
||
<span class="identifier">time_point</span><span class="special"><</span><a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a><span class="special">,</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">Duration</span></code></a><span class="special">>&</span> <span class="identifier">tp</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
Extracts <code class="computeroutput"><span class="identifier">tp</span></code> from
|
||
the stream <code class="computeroutput"><span class="identifier">is</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Behaves as a formatted
|
||
input function. After constructing a <code class="computeroutput"><span class="identifier">sentry</span></code>
|
||
object, if the <code class="computeroutput"><span class="identifier">sentry</span></code>
|
||
converts to <code class="computeroutput"><span class="keyword">true</span></code>, calls
|
||
to <code class="computeroutput"><span class="identifier">facet</span><span class="special">.</span><span class="identifier">get</span><span class="special">(</span><span class="identifier">is</span><span class="special">,</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">istreambuf_iterator</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span>
|
||
<span class="identifier">Traits</span><span class="special">>(),</span>
|
||
<span class="identifier">is</span><span class="special">,</span>
|
||
<span class="identifier">err</span><span class="special">,</span>
|
||
<span class="identifier">tp</span><span class="special">)</span></code>
|
||
where <code class="computeroutput"><span class="identifier">facet</span></code> is the
|
||
<code class="computeroutput"><span class="identifier">time_point_get</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code>
|
||
facet associated to <code class="computeroutput"><span class="identifier">is</span></code>
|
||
or a new created instance of the default <code class="computeroutput"><span class="identifier">time_point_get</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span></code> facet.
|
||
</p>
|
||
<p>
|
||
If any step fails, calls <code class="computeroutput"><span class="identifier">os</span><span class="special">.</span><span class="identifier">setstate</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">failbit</span>
|
||
<span class="special">|</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">badbit</span><span class="special">)</span></code>.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Returns:</strong></span> <code class="computeroutput"><span class="identifier">is</span></code>.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h3 class="title">
|
||
<a name="chrono.reference.round"></a><a class="link" href="reference.html#chrono.reference.round" title="Chrono Rounding Utilities">Chrono Rounding Utilities</a>
|
||
</h3></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.round.floor_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">floor</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.round.round_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">round</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.round.ceil_hpp">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">ceil</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
</dl></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.round.floor_hpp"></a><a class="link" href="reference.html#chrono.reference.round.floor_hpp" title="Header <boost/chrono/floor.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">floor</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">To</span> <span class="identifier">floor</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
<span class="special">}</span> <span class="special">}</span>
|
||
</pre>
|
||
<p>
|
||
This function round down the given parameter.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.round.round_hpp"></a><a class="link" href="reference.html#chrono.reference.round.round_hpp" title="Header <boost/chrono/round.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">round</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">To</span> <span class="identifier">round</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
<span class="special">}</span> <span class="special">}</span>
|
||
</pre>
|
||
<p>
|
||
This function round to nearest, to even on tie the given parameter.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.round.ceil_hpp"></a><a class="link" href="reference.html#chrono.reference.round.ceil_hpp" title="Header <boost/chrono/ceil.hpp>">Header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">ceil</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">To</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Period</span><span class="special">></span>
|
||
<span class="identifier">To</span> <span class="identifier">ceil</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">duration</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">,</span> <span class="identifier">Period</span><span class="special">>&</span> <span class="identifier">d</span><span class="special">);</span>
|
||
<span class="special">}</span> <span class="special">}</span>
|
||
</pre>
|
||
<p>
|
||
This function round up the given parameter.
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h3 class="title">
|
||
<a name="chrono.reference.other_clocks"></a><a class="link" href="reference.html#chrono.reference.other_clocks" title="Other Clocks">Other Clocks</a>
|
||
</h3></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp">Header
|
||
<code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">process_cpu_clocks</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.thread_clock_hpp">Header
|
||
<code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">thread_clock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a></span></dt>
|
||
</dl></div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp" title="Header <boost/chrono/process_cpu_clocks.hpp>">Header
|
||
<code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">process_cpu_clocks</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.BOOST_CHRONO_HAS_PROCESS_CLOCKS">Macro
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_PROCESS_CLOCKS</span>
|
||
</code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock">Class
|
||
<code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_user_cpu_clock">Class
|
||
<code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_system_cpu_clock">Class
|
||
<code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_cpu_clock">Class
|
||
<code class="computeroutput"><span class="identifier">process_cpu_clock</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.times">Template
|
||
Class <code class="computeroutput"><span class="identifier">process_times</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.times_io"><code class="computeroutput"><span class="identifier">process_times</span></code> Input/Output</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.times_duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code> Specialization for <code class="computeroutput"><span class="identifier">process_times</span><span class="special"><></span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_real_cpu_clock"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">></span></code>
|
||
Specialization</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_user_cpu_clock"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_user_cpu_clock</span><span class="special">></span></code>
|
||
Specialization</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_system_cpu_clock"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_system_cpu_clock</span><span class="special">></span></code>
|
||
Specialization</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_cpu_clock"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">></span></code>
|
||
Specialization</a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.times_numeric_limits"><code class="computeroutput"><span class="identifier">numeric_limits</span></code> Specialization for <code class="computeroutput"><span class="identifier">process_times</span><span class="special"><></span></code></a></span></dt>
|
||
</dl></div>
|
||
<p>
|
||
Knowing how long a program takes to execute is useful in both test and
|
||
production environments. It is also helpful if such timing information
|
||
is broken down into real (wall clock) time, CPU time spent by the user,
|
||
and CPU time spent by the operating system servicing user requests.
|
||
</p>
|
||
<p>
|
||
Process clocks don't include the time spent by the child process.
|
||
</p>
|
||
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_HAS_PROCESS_CLOCKS</span>
|
||
|
||
<span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="keyword">class</span> <span class="identifier">process_real_cpu_clock</span><span class="special">;</span>
|
||
<span class="keyword">class</span> <span class="identifier">process_user_cpu_clock</span><span class="special">;</span>
|
||
<span class="keyword">class</span> <span class="identifier">process_system_cpu_clock</span><span class="special">;</span>
|
||
<span class="keyword">class</span> <span class="identifier">process_cpu_clock</span><span class="special">;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">process_times</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span>
|
||
<span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span>
|
||
<span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">duration_values</span><span class="special"><</span><span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="special">>;</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">>;</span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_user_cpu_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">>;</span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_system_cpu_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">>;</span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">>;</span>
|
||
|
||
<span class="special">}</span> <span class="special">}</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">std</span> <span class="special">{</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="keyword">class</span> <span class="identifier">numeric_limits</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="special">>;</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.BOOST_CHRONO_HAS_PROCESS_CLOCKS"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.BOOST_CHRONO_HAS_PROCESS_CLOCKS" title="Macro BOOST_CHRONO_HAS_PROCESS_CLOCKS">Macro
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_PROCESS_CLOCKS</span>
|
||
</code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
This macro is defined if the platform supports process clocks.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="Class process_real_cpu_clock">Class
|
||
<code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a> satisfy
|
||
the <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>
|
||
requirements.
|
||
</p>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_real_cpu_clock" title="Class process_real_cpu_clock"><code class="computeroutput"><span class="identifier">process_real_cpu_clock</span></code></a> class
|
||
provides access to the real process wall-clock steady clock, i.e. the
|
||
real CPU-time clock of the calling process. The process relative current
|
||
time can be obtained by calling <code class="computeroutput"><span class="identifier">process_real_cpu_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_real_cpu_clock</span> <span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a> <span class="identifier">duration</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">is_steady</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
|
||
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">);</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.process_user_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_user_cpu_clock" title="Class process_user_cpu_clock">Class
|
||
<code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_user_cpu_clock" title="Class process_user_cpu_clock"><code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code></a> satisfy
|
||
the <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>
|
||
requirements.
|
||
</p>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_user_cpu_clock" title="Class process_user_cpu_clock"><code class="computeroutput"><span class="identifier">process_user_cpu_clock</span></code></a> class
|
||
provides access to the user CPU-time steady clock of the calling process.
|
||
The process relative user current time can be obtained by calling <code class="computeroutput"><span class="identifier">process_user_cpu_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_user_cpu_clock</span> <span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a> <span class="identifier">duration</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">process_user_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">is_steady</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
|
||
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">);</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.process_system_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_system_cpu_clock" title="Class process_system_cpu_clock">Class
|
||
<code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_system_cpu_clock" title="Class process_system_cpu_clock"><code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a> satisfy
|
||
the <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>
|
||
requirements.
|
||
</p>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_system_cpu_clock" title="Class process_system_cpu_clock"><code class="computeroutput"><span class="identifier">process_system_cpu_clock</span></code></a> class
|
||
provides access to the system CPU-time steady clock of the calling process.
|
||
The process relative system current time can be obtained by calling
|
||
<code class="computeroutput"><span class="identifier">process_system_cpu_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_system_cpu_clock</span> <span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a> <span class="identifier">duration</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">process_system_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">is_steady</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
|
||
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">);</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.process_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.process_cpu_clock" title="Class process_cpu_clock">Class
|
||
<code class="computeroutput"><span class="identifier">process_cpu_clock</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">process_cpu_clock</span></code> can
|
||
be considered as a <code class="computeroutput"><span class="identifier">tuple</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">,</span> <span class="identifier">process_user_cpu_clock</span><span class="special">,</span> <span class="identifier">process_system_cpu_clock</span><span class="special">></span></code>.
|
||
</p>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">process_cpu_clock</span></code> provides
|
||
a thin wrapper around the operating system's process time API. For POSIX-like
|
||
systems, that's the times() function, while for Windows, it's the <code class="computeroutput"><span class="identifier">GetProcessTimes</span><span class="special">()</span></code>
|
||
function.
|
||
</p>
|
||
<p>
|
||
The process relative real, user and system current time can be obtained
|
||
at once by calling <code class="computeroutput"><span class="identifier">process_clocks</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">process_cpu_clock</span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">process_times</span><span class="special"><</span><span class="identifier">nanoseconds</span><span class="special">::</span><span class="identifier">rep</span><span class="special">></span> <span class="identifier">times</span> <span class="special">;</span>
|
||
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration" title="Class Template duration<>"><code class="computeroutput"><span class="identifier">duration</span></code></a><span class="special"><</span><span class="identifier">times</span><span class="special">,</span> <span class="identifier">nano</span><span class="special">></span> <span class="identifier">duration</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">is_steady</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
|
||
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">);</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.times"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.times" title="Template Class process_times">Template
|
||
Class <code class="computeroutput"><span class="identifier">process_times</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
This class is the representation of the <code class="computeroutput"><span class="identifier">process_cpu_clock</span><span class="special">::</span><span class="identifier">duration</span></code>
|
||
class. As such it needs to implements the arithmetic operators.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">process_times</span> <span class="special">:</span> <span class="identifier">arithmetic</span><span class="special"><</span><span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">>,</span>
|
||
<span class="identifier">multiplicative</span><span class="special"><</span><span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">>,</span> <span class="identifier">Rep</span><span class="special">,</span>
|
||
<span class="identifier">less_than_comparable</span><span class="special"><</span><span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="special">></span> <span class="special">></span> <span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="identifier">Rep</span> <span class="identifier">real</span><span class="special">;</span> <span class="comment">// real (i.e wall clock) time</span>
|
||
<span class="identifier">Rep</span> <span class="identifier">user</span><span class="special">;</span> <span class="comment">// user cpu time</span>
|
||
<span class="identifier">Rep</span> <span class="identifier">system</span><span class="special">;</span> <span class="comment">// system cpu time</span>
|
||
|
||
<span class="identifier">times</span><span class="special">();</span>
|
||
<span class="identifier">times</span><span class="special">(</span>
|
||
<span class="identifier">process_real_cpu_clock</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">r</span><span class="special">,</span>
|
||
<span class="identifier">process_user_cpu_clock</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">u</span><span class="special">,</span>
|
||
<span class="identifier">process_system_cpu_clock</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">s</span><span class="special">);</span>
|
||
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">explicit</span> <span class="identifier">process_times</span><span class="special">(</span>
|
||
<span class="identifier">Rep2</span> <span class="identifier">r</span><span class="special">);</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">explicit</span> <span class="identifier">process_times</span><span class="special">(</span>
|
||
<span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="keyword">operator</span> <span class="identifier">rep</span><span class="special">()</span> <span class="keyword">const</span><span class="special">;</span>
|
||
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="identifier">process_times</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">Rep2</span><span class="special">></span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special">==(</span><span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep2</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
|
||
<span class="identifier">times</span> <span class="keyword">operator</span><span class="special">+=(</span><span class="identifier">process_times</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="identifier">times</span> <span class="keyword">operator</span><span class="special">-=(</span><span class="identifier">process_times</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="identifier">times</span> <span class="keyword">operator</span><span class="special">*=(</span><span class="identifier">process_times</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="identifier">times</span> <span class="keyword">operator</span><span class="special">/=(</span><span class="identifier">process_times</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
<span class="keyword">bool</span> <span class="keyword">operator</span><span class="special"><(</span><span class="identifier">process_times</span> <span class="keyword">const</span> <span class="special">&</span> <span class="identifier">rhs</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.times_io"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.times_io" title="process_times Input/Output"><code class="computeroutput"><span class="identifier">process_times</span></code> Input/Output</a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special"><<(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">os</span><span class="special">,</span>
|
||
<span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> Output each part separated
|
||
by ';' and surrounded by '{', '}'.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Throws:</strong></span> None.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Traits</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span>
|
||
<span class="keyword">operator</span><span class="special">>>(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span><span class="special">>&</span> <span class="identifier">is</span><span class="special">,</span>
|
||
<span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">rhs</span><span class="special">);</span>
|
||
</pre>
|
||
<p>
|
||
<span class="bold"><strong>Effects:</strong></span> overrides the value of rhs
|
||
if the input stream has the format "{r;u;s}". Otherwise, set
|
||
the input stream state as failbit | eofbit.
|
||
</p>
|
||
<p>
|
||
<span class="bold"><strong>Throws:</strong></span> None.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.times_duration_values"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.times_duration_values" title="duration_values Specialization for process_times<>"><code class="computeroutput"><span class="identifier">duration_values</span></code> Specialization for <code class="computeroutput"><span class="identifier">process_times</span><span class="special"><></span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">Rep</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.traits.duration_values" title="Class Template duration_values"><code class="computeroutput"><span class="identifier">duration_values</span></code></a><span class="special"><</span><span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">static</span> <span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="identifier">zero</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="identifier">max</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="identifier">min</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
The <code class="computeroutput"><span class="identifier">times</span></code> specific functions
|
||
<code class="computeroutput"><span class="identifier">zero</span><span class="special">()</span></code>,
|
||
<code class="computeroutput"><span class="identifier">max</span><span class="special">()</span></code>
|
||
and <code class="computeroutput"><span class="identifier">min</span><span class="special">()</span></code>
|
||
uses the relative functions on the representation of each component.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_real_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_real_cpu_clock" title="clock_string<process_real_cpu_clock> Specialization"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">></span></code>
|
||
Specialization</a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_real_cpu_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">name</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">since</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">name</span><span class="special">()</span></code>
|
||
returns "process_real_cpu_clock".
|
||
</p>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">since</span><span class="special">()</span></code>
|
||
returns " since process start-up"
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_user_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_user_cpu_clock" title="clock_string<process_user_cpu_clock> Specialization"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_user_cpu_clock</span><span class="special">></span></code>
|
||
Specialization</a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_user_cpu_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">name</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">since</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">name</span><span class="special">()</span></code>
|
||
returns "process_user_cpu_clock".
|
||
</p>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">since</span><span class="special">()</span></code>
|
||
returns " since process start-up"
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_system_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_system_cpu_clock" title="clock_string<process_system_cpu_clock> Specialization"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_system_cpu_clock</span><span class="special">></span></code>
|
||
Specialization</a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_system_cpu_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">name</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">since</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">name</span><span class="special">()</span></code>
|
||
returns "process_system_cpu_clock".
|
||
</p>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">since</span><span class="special">()</span></code>
|
||
returns " since process start-up"
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_cpu_clock"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.clock_string_process_cpu_clock" title="clock_string<process_cpu_clock> Specialization"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">></span></code>
|
||
Specialization</a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">process_cpu_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">name</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">since</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">name</span><span class="special">()</span></code>
|
||
returns "process_cpu_clock".
|
||
</p>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">since</span><span class="special">()</span></code>
|
||
returns " since process start-up"
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.process_cpu_clocks_hpp.times_numeric_limits"></a><a class="link" href="reference.html#chrono.reference.other_clocks.process_cpu_clocks_hpp.times_numeric_limits" title="numeric_limits Specialization for process_times<>"><code class="computeroutput"><span class="identifier">numeric_limits</span></code> Specialization for <code class="computeroutput"><span class="identifier">process_times</span><span class="special"><></span></code></a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">std</span> <span class="special">{</span>
|
||
<span class="keyword">template</span> <span class="special"><></span>
|
||
<span class="keyword">class</span> <span class="identifier">numeric_limits</span><span class="special"><</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">>></span> <span class="special">{</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">chrono</span><span class="special">::</span><span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span> <span class="identifier">Res</span><span class="special">;</span>
|
||
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_specialized</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="identifier">Res</span> <span class="identifier">min</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">Res</span> <span class="identifier">max</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">Res</span> <span class="identifier">lowest</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">digits</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">digits10</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_signed</span> <span class="special">=</span> <span class="keyword">false</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_integer</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">is_exact</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">int</span> <span class="identifier">radix</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
|
||
<span class="special">};</span>
|
||
<span class="special">}</span>
|
||
</pre>
|
||
<p>
|
||
The <code class="computeroutput"><span class="identifier">process_times</span><span class="special"><</span><span class="identifier">Rep</span><span class="special">></span></code>
|
||
specialization functions <code class="computeroutput"><span class="identifier">min</span><span class="special">()</span></code>, <code class="computeroutput"><span class="identifier">max</span><span class="special">()</span></code> and <code class="computeroutput"><span class="identifier">lowest</span><span class="special">()</span></code> uses the relative functions on the
|
||
representation of each component.
|
||
</p>
|
||
<p>
|
||
Notes
|
||
</p>
|
||
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">min</span><span class="special">()</span></code>
|
||
returns the tuple of mins.
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">max</span><span class="special">()</span></code>
|
||
returns the tuple of maxs.
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">lowest</span><span class="special">()</span></code>
|
||
returns the tuple of lowests.
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">digits</span></code> is the sum
|
||
of (binary) digits.
|
||
</li>
|
||
<li class="listitem">
|
||
<code class="computeroutput"><span class="identifier">digits10</span></code> is the sum
|
||
of digits10s.
|
||
</li>
|
||
</ul></div>
|
||
</div>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h4 class="title">
|
||
<a name="chrono.reference.other_clocks.thread_clock_hpp"></a><a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp" title="Header <boost/chrono/thread_clock.hpp>">Header
|
||
<code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">chrono</span><span class="special">/</span><span class="identifier">thread_clock</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code></a>
|
||
</h4></div></div></div>
|
||
<div class="toc"><dl class="toc">
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.BOOST_CHRONO_HAS_THREAD_CLOCK">Macro
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_THREAD_CLOCK</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.BOOST_CHRONO_THREAD_CLOCK_IS_STEADY">Macro
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_THREAD_CLOCK_IS_STEADY</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.thread_clock">Class
|
||
<code class="computeroutput"><span class="identifier">thread_clock</span></code></a></span></dt>
|
||
<dt><span class="section"><a href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.clock_string_thread_clock"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">thread_clock</span><span class="special">></span></code>
|
||
Specialization</a></span></dt>
|
||
</dl></div>
|
||
<p>
|
||
Knowing the time a thread takes to execute is useful in both test and production
|
||
environments.
|
||
</p>
|
||
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_HAS_THREAD_CLOCK</span>
|
||
<span class="preprocessor">#define</span> <span class="identifier">BOOST_CHRONO_THREAD_CLOCK_IS_STEADY</span>
|
||
<span class="keyword">namespace</span> <span class="identifier">boost</span> <span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">chrono</span> <span class="special">{</span>
|
||
|
||
<span class="keyword">class</span> <span class="identifier">thread_clock</span><span class="special">;</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">thread_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">>;</span>
|
||
|
||
<span class="special">}</span> <span class="special">}</span>
|
||
</pre>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.thread_clock_hpp.BOOST_CHRONO_HAS_THREAD_CLOCK"></a><a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.BOOST_CHRONO_HAS_THREAD_CLOCK" title="Macro BOOST_CHRONO_HAS_THREAD_CLOCK">Macro
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_HAS_THREAD_CLOCK</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
This macro is defined if the platform supports thread clocks.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.thread_clock_hpp.BOOST_CHRONO_THREAD_CLOCK_IS_STEADY"></a><a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.BOOST_CHRONO_THREAD_CLOCK_IS_STEADY" title="Macro BOOST_CHRONO_THREAD_CLOCK_IS_STEADY">Macro
|
||
<code class="computeroutput"><span class="identifier">BOOST_CHRONO_THREAD_CLOCK_IS_STEADY</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
This macro is defined if the platform has a thread clock. Its value is
|
||
true if it is steady and false otherwise.
|
||
</p>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.thread_clock_hpp.thread_clock"></a><a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="Class thread_clock">Class
|
||
<code class="computeroutput"><span class="identifier">thread_clock</span></code></a>
|
||
</h5></div></div></div>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a> satisfy the <a class="link" href="reference.html#chrono.reference.cpp0x.clock" title="Clock Requirements"><code class="computeroutput"><span class="identifier">Clock</span></code></a>
|
||
requirements.
|
||
</p>
|
||
<p>
|
||
<a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.thread_clock" title="Class thread_clock"><code class="computeroutput"><span class="identifier">thread_clock</span></code></a> class provides
|
||
access to the real thread wall-clock, i.e. the real CPU-time clock of
|
||
the calling thread. The thread relative current time can be obtained
|
||
by calling <code class="computeroutput"><span class="identifier">thread_clock</span><span class="special">::</span><span class="identifier">now</span><span class="special">()</span></code>.
|
||
</p>
|
||
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">thread_clock</span> <span class="special">{</span>
|
||
<span class="keyword">public</span><span class="special">:</span>
|
||
<span class="keyword">typedef</span> <a class="link" href="reference.html#chrono.reference.cpp0x.duration_hpp.duration_typedefs" title="duration typedefs"><code class="computeroutput"><span class="identifier">nanoseconds</span></code></a> <span class="identifier">duration</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">rep</span> <span class="identifier">rep</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">duration</span><span class="special">::</span><span class="identifier">period</span> <span class="identifier">period</span><span class="special">;</span>
|
||
<span class="keyword">typedef</span> <span class="identifier">chrono</span><span class="special">::</span><a class="link" href="reference.html#chrono.reference.cpp0x.time_point_hpp.time_point" title="Class template time_point<>"><code class="computeroutput"><span class="identifier">time_point</span></code></a><span class="special"><</span><span class="identifier">thread_clock</span><span class="special">></span> <span class="identifier">time_point</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">bool</span> <span class="identifier">is_steady</span> <span class="special">=</span> <span class="identifier">BOOST_CHRONO_THREAD_CLOCK_IS_STEADY</span><span class="special">;</span>
|
||
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
|
||
<span class="keyword">static</span> <span class="identifier">time_point</span> <span class="identifier">now</span><span class="special">(</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">error_code</span> <span class="special">&</span> <span class="identifier">ec</span> <span class="special">);</span>
|
||
<span class="special">};</span>
|
||
</pre>
|
||
</div>
|
||
<div class="section">
|
||
<div class="titlepage"><div><div><h5 class="title">
|
||
<a name="chrono.reference.other_clocks.thread_clock_hpp.clock_string_thread_clock"></a><a class="link" href="reference.html#chrono.reference.other_clocks.thread_clock_hpp.clock_string_thread_clock" title="clock_string<thread_clock> Specialization"><code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">thread_clock</span><span class="special">></span></code>
|
||
Specialization</a>
|
||
</h5></div></div></div>
|
||
<pre class="programlisting"><span class="preprocessor">#if</span> <span class="identifier">defined</span><span class="special">(</span><span class="identifier">BOOST_CHRONO_HAS_THREAD_CLOCK</span><span class="special">)</span>
|
||
<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="keyword">struct</span> <span class="identifier">clock_string</span><span class="special"><</span><span class="identifier">thread_clock</span><span class="special">,</span> <span class="identifier">CharT</span><span class="special">></span>
|
||
<span class="special">{</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">name</span><span class="special">();</span>
|
||
<span class="keyword">static</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span><span class="special"><</span><span class="identifier">CharT</span><span class="special">></span> <span class="identifier">since</span><span class="special">();</span>
|
||
<span class="special">};</span>
|
||
<span class="preprocessor">#endif</span>
|
||
</pre>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">name</span><span class="special">()</span></code>
|
||
returns "thread_clock".
|
||
</p>
|
||
<p>
|
||
<code class="computeroutput"><span class="identifier">clock_string</span><span class="special"><>::</span><span class="identifier">since</span><span class="special">()</span></code>
|
||
returns " since thread start-up"
|
||
</p>
|
||
</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 © 2008 Howard Hinnant<br>Copyright © 2006, 2008 Beman Dawes<br>Copyright © 2009-2013 Vicente J. Botet Escriba<p>
|
||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||
file LICENSE_1_0.txt 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="users_guide.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../chrono.html"><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="appendices.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
|
||
</div>
|
||
</body>
|
||
</html>
|