|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74773 - trunk/libs/timer/doc
From: bdawes_at_[hidden]
Date: 2011-10-06 21:07:24
Author: bemandawes
Date: 2011-10-06 21:07:23 EDT (Thu, 06 Oct 2011)
New Revision: 74773
URL: http://svn.boost.org/trac/boost/changeset/74773
Log:
Apply new default scheme to docs
Text files modified:
trunk/libs/timer/doc/cpu_timers.html | 114 +++++++++++++--------------------------
1 files changed, 38 insertions(+), 76 deletions(-)
Modified: trunk/libs/timer/doc/cpu_timers.html
==============================================================================
--- trunk/libs/timer/doc/cpu_timers.html (original)
+++ trunk/libs/timer/doc/cpu_timers.html 2011-10-06 21:07:23 EDT (Thu, 06 Oct 2011)
@@ -50,15 +50,15 @@
<td width="100%" bgcolor="#E8F5FF">
<a href="#Introduction">Introduction</a><br>
<a href="#Example">Using the timers</a><br>
- Using auto_cpu_time
r<br>
+ Using auto_cpu_timer
<br>
Using cpu_timer
<br>
<a href="#Reference">Reference</a><br>
<code> <boost/timer/timer.hpp></code><a href="#Synopsis">
synopsis</a><br>
+ Default format<br>
Typedef nanosecond_type
<br>
<a href="#Non-member-functions">Non-member functions</a><br>
- <code>default_format()</code><br>
format()
<br>
<a href="#Class-cpu_timer">Class <code>cpu_timer</code></a><br>
@@ -228,11 +228,9 @@
const int <a name="default_places">default_places</a> = 6;
- const std::string& default_format();
+ std::string format(const cpu_times& times, short places, const std::string& format);
+ std::string format(const cpu_times& times, short places = default_places);
- std::string format(const cpu_times& times,
- short places = default_places,
- const std::string& format = default_format());
} // namespace timer
} // namespace boost</pre>
</blockquote>
@@ -240,6 +238,10 @@
</tr>
</table>
+<h3><a name="Default-format">Default format</a></h3>
+
+<p>The default format is " %ws wall, %us user + %ss system = %ts CPU (%p%)\n".</p>
+
<h3>Typedef <a name="nanosecond_type"><code>nanosecond_type</code></a></h3>
<p>The typedef <code>nanosecond_type</code> provides an implementation defined type capable
@@ -272,14 +274,8 @@
<h3><a name="Non-member-functions">Non-member functions</a></h3>
-<pre><span style="background-color: #D7EEFF">const std::string& </span><span style="background-color: #D7EEFF"><a name="default_format">default_format</a>();</span></pre>
-<blockquote>
- <p><i>Returns:</i> <code>std::string(" %ws wall, %us user + %ss system = %ts
- CPU (%p%)\n")</code>.</p>
-</blockquote>
-<pre><span style="background-color: #D7EEFF">std::string </span><a name="format"><span style="background-color: #D7EEFF">format</span></a><span style="background-color: #D7EEFF">(const</span><span style="background-color: #D7EEFF"> </span>cpu_times<span style="background-color: #D7EEFF">& times,
- short places = </span><span style="background-color: #D7EEFF">default_places,
- const std::string& format = default_format()); </span></pre>
+<pre><span style="background-color: #D7EEFF">std::string </span><a name="format"><span style="background-color: #D7EEFF">format</span></a><span style="background-color: #D7EEFF">(const </span>cpu_times<span style="background-color: #D7EEFF">& times, short places, const std::string& format);
+std::string </span><a name="format"><span style="background-color: #D7EEFF">format</span></a><span style="background-color: #D7EEFF">(const </span>cpu_times<span style="background-color: #D7EEFF">& times, short places = default_places);</span></pre>
<blockquote>
<p><i>Overview: </i>Converts the <code>times</code> argument's values to strings
@@ -288,9 +284,8 @@
string.</p>
<p><i>Effects:</i> If <code>places</code> is less than 0, it is set to <code>default_places</code>. If <code>places</code> is
-more than 9, it is set to 9. if the <code>format</code>
-argument is <code>empty()</code>, it is set to <code>
-default_format</code>.</p>
+more than 9, it is set to 9. For the overload without the <code>format</code>
+argument, the default format is used as <code>format</code>.</p>
<p><i>Returns:</i> A string that is a copy of <code>format</code>, except that any
instances of the sequences shown below are replaced by the indicated value.
@@ -364,8 +359,9 @@
// observers
bool is_stopped() const noexcept;
cpu_times elapsed() const noexcept;
- std::string format(int places = default_places,
- const std::string& format = default_format()) const;
+ std::string format(int places, const std::string& format) const;
+ std::string format(int places = default_places) const;
+
// actions
void start() noexcept;
const cpu_times& stop() noexcept;
@@ -404,12 +400,12 @@
values.</p>
</blockquote>
-<pre><span style="background-color: #D7EEFF">std::string <a name="cpu_timer-format">format</a>(int</span><span style="background-color: #D7EEFF"> places = </span><span style="background-color: #D7EEFF">default_places,
- const std::string& format = default_format()) const;</span></pre>
+<pre><span style="background-color: #D7EEFF">std::string </span>format<span style="background-color: #D7EEFF">(int</span><span style="background-color: #D7EEFF"> places, const std::string& format) const;
+std::string </span>format<span style="background-color: #D7EEFF">(int</span><span style="background-color: #D7EEFF"> places = </span><span style="background-color: #D7EEFF">default_places</span><span style="background-color: #D7EEFF">) const;</span></pre>
<blockquote>
<p><i>Overview:</i> Returns a string for the current elapsed time as formatted
- by the format function.</p>
- <p><i>Returns:</i> <code>timer::format(elapsed(), places, format)</code>.</p>
+ by the format non-member function.</p>
+ <p><i>Returns:</i> <code>boost::timer::format(elapsed(), places<i>[, format]</i>)</code>.</p>
</blockquote>
<h3><a name="cpu_timer-actions"><code>cpu_timer</code>
actions</a></h3>
@@ -459,13 +455,12 @@
class <a name="auto_cpu_timer">auto_cpu_timer</a> : public cpu_timer
{
public:
- explicit auto_cpu_timer(short places = default_places,
- const std::string& format = default_format());
- explicit auto_cpu_timer(const std::string& format);
- explicit auto_cpu_timer(std::ostream& os,
- short places = default_places,
- const std::string& format = default_format());
- auto_cpu_timer(std::ostream& os, const std::string& format);
+ explicit auto_cpu_timer(short places = default_places);
+ auto_cpu_timer(short places, const std::string& format);
+ explicit auto_cpu_timer(const std::string& format);
+ auto_cpu_timer(std::ostream& os, short places, const std::string& format);
+ explicit auto_cpu_timer(std::ostream& os, short places = default_places);
+ auto_cpu_timer(std::ostream& os, const std::string& format);
<a href="#auto_cpu_timer-destructor">~auto_cpu_timer</a>() noexcept;
@@ -473,11 +468,6 @@
cpu_timer& operator=(const cpu_timer&) = default;
void report();
-
- private:
- std::ostream& m_os; // <b><i>exposition only</i></b>
- short m_places; // <b><i>exposition only</i></b>
- std::string m_format; // <b><i>exposition only</i></b>
};</pre>
</td>
</tr>
@@ -486,49 +476,21 @@
argument argument imply <code>
std::cout</code>. An argument default is avoided as it would require including <code><iostream></code>,
with its high costs, even when the standard streams are not used. <i>--end note</i>]</p>
+
<h3><a name="auto_cpu_timer-constructors"><code>auto_cpu_timer</code> constructors</a></h3>
-<pre><span style="background-color: #D7EEFF">explicit <a name="auto_cpu_timer-1">auto_cpu_timer</a>(short places = </span>default_places<span style="background-color: #D7EEFF">,
- const std::string& format = default_format());</span></pre>
-<blockquote>
- <p><i>Effects:</i> Constructs an object of type <code>
- auto_cpu_timer</code>.</p>
- <p><i>Postconditions:
- </i>As if<i><br>
- </i><code> m_os == std::cout</code>,<code><br>
- m_places == places</code>,<code><br>
- m_format == format</code></p>
-</blockquote>
-<pre><span style="background-color: #D7EEFF">explicit <a name="auto_cpu_timer-2">auto_cpu_timer</a>(const</span><span style="background-color: #D7EEFF"> std::string& format);</span></pre>
-<blockquote>
- <p><i>Effects:</i> Constructs an object of type <code>
- auto_cpu_timer</code>.</p>
- <p><i>Postconditions:
- </i>As if<i><br>
- </i><code> m_os == std::cout</code>,<code><br>
- m_places == default_places</code>,<code><br>
- m_format == format</code></p>
-</blockquote>
-<pre><span style="background-color: #D7EEFF">explicit <a name="auto_cpu_timer-3">auto_cpu_timer</a>(std::ostream</span><span style="background-color: #D7EEFF">& </span><span style="background-color: #D7EEFF">os</span><span style="background-color: #D7EEFF">,
- short places = </span>default_places<span style="background-color: #D7EEFF">,
- const std::string& format = </span><span style="background-color: #D7EEFF">default_format());</span></pre>
-<blockquote>
- <p><i>Effects:</i> Constructs an object of type <code>
- auto_cpu_timer</code>.</p>
- <p><i>Postconditions:
- </i>As if<i><br>
- </i><code> m_os == os</code>,<code><br>
- m_places == places</code>,<code><br>
- m_format == format</code></p>
-</blockquote>
-<pre><span style="background-color: #D7EEFF"><a name="auto_cpu_timer-4">auto_cpu_timer</a>(std::ostream</span><span style="background-color: #D7EEFF">& </span><span style="background-color: #D7EEFF">os</span><span style="background-color: #D7EEFF">, const std::string& format);</span></pre>
+
+<pre><span style="background-color: #D7EEFF">explicit <a name="auto_cpu_timer-1">auto_cpu_timer</a>(short</span><span style="background-color: #D7EEFF"> places = </span><span style="background-color: #D7EEFF">default_places</span><span style="background-color: #D7EEFF">);
+ <a name="auto_cpu_timer-2">auto_cpu_timer</a>(short</span><span style="background-color: #D7EEFF"> places, const std::string& format);
+explicit <a name="auto_cpu_timer-3">auto_cpu_timer</a>(const</span><span style="background-color: #D7EEFF"> std::string& format);
+ <a name="auto_cpu_timer-4">auto_cpu_timer</a>(std::ostream</span><span style="background-color: #D7EEFF">& </span><span style="background-color: #D7EEFF">os</span><span style="background-color: #D7EEFF">, short places, const std::string& format);<br>explicit <a name="auto_cpu_timer-5">auto_cpu_timer</a>(std::ostream</span><span style="background-color: #D7EEFF">& </span><span style="background-color: #D7EEFF">os</span><span style="background-color: #D7EEFF">, short places = </span><span style="background-color: #D7EEFF">default_places</span><span style="background-color: #D7EEFF">);<br> <a name="auto_cpu_timer-6">auto_cpu_timer</a>(std::ostream</span><span style="background-color: #D7EEFF">& </span><span style="background-color: #D7EEFF">os</span><span style="background-color: #D7EEFF">, const std::string& format);
+</span></pre>
<blockquote>
<p><i>Effects:</i> Constructs an object of type <code>
- auto_cpu_timer</code>.</p>
- <p><i>Postconditions:
- </i>As if<i><br>
- </i><code> m_os == os</code>,<code><br>
- m_places == </code>default_places,<code><br>
- m_format == format</code></p>
+ auto_cpu_timer</code>, storing <code>os</code>, <code>places</code>, and <code>
+ format</code>. For the overloads without a <code>format</code>
+argument, the default format is stored as the
+ <code>format</code>. For the overloads without an <code>os</code>
+argument, std::cout is stored as the <code>os</code>.</p>
</blockquote>
<h3><a name="auto_cpu_timer-destructor"><code>auto_cpu_timer</code> destructor</a></h3>
<pre><span style="background-color: #D7EEFF">~</span><span style="background-color: #D7EEFF">auto_cpu_timer</span><span style="background-color: #D7EEFF">() noexcept;</span></pre>
@@ -683,7 +645,7 @@
<hr>
<p><font size="2">Revised:
-<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B %Y" startspan -->04 October 2011<!--webbot bot="Timestamp" endspan i-checksum="32185" --></font></p>
+<!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B %Y" startspan -->06 October 2011<!--webbot bot="Timestamp" endspan i-checksum="32189" --></font></p>
<p><font size="2">© Copyright Beman Dawes, 2006<br>
© Copyright Beman Dawes and Robert Stewart, 2011</font></p>
<p><font size="2">Distributed under the Boost Software License, Version 1.0. See www.boost.org/ LICENSE_1_0.txt</font></p>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk