|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74424 - in sandbox/stopwatches: boost/chrono boost/chrono/stopwatches boost/chrono/stopwatches/formatters boost/chrono/stopwatches/reporters libs/chrono/stopwatches/example
From: vicente.botet_at_[hidden]
Date: 2011-09-16 18:05:27
Author: viboes
Date: 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
New Revision: 74424
URL: http://svn.boost.org/trac/boost/changeset/74424
Log:
Stopwatches: cleanup + adptation of oneshot formatter to base_formatter
Text files modified:
sandbox/stopwatches/boost/chrono/stopwatches.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/clock_suspender.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/config.hpp | 6 ++--
sandbox/stopwatches/boost/chrono/stopwatches/formatters/elapsed_formatter.hpp | 30 ++++++++++++++------------
sandbox/stopwatches/boost/chrono/stopwatches/formatters/oneshot_formatter.hpp | 44 +++++++++++++++------------------------
sandbox/stopwatches/boost/chrono/stopwatches/lightweight_stopwatch.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/reporters/stopwatch_reporter.hpp | 27 +++++++-----------------
sandbox/stopwatches/boost/chrono/stopwatches/scoped_stopclock.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/stopclock.hpp | 23 +-------------------
sandbox/stopwatches/boost/chrono/stopwatches/stopclock_accumulator.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_formatter.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_reporter.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_scoped.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/stopwatches.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/suspendible_clock.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/t24_hours.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/t24_hours_formatter.hpp | 4 +-
sandbox/stopwatches/boost/chrono/stopwatches/time_formatter.hpp | 4 +-
sandbox/stopwatches/libs/chrono/stopwatches/example/scoped_stopwatch_example.cpp | 12 ++++++++--
sandbox/stopwatches/libs/chrono/stopwatches/example/stopwatch_accumulator_example.cpp | 2
24 files changed, 90 insertions(+), 122 deletions(-)
Modified: sandbox/stopwatches/boost/chrono/stopwatches.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -10,8 +10,8 @@
//
//////////////////////////////////////////////////////////////////////////////
-#ifndef BOOST_STOPWATCHES_HPP
-#define BOOST_STOPWATCHES_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_HPP
+#define BOOST_CHRONO_STOPWATCHES_HPP
//-----------------------------------------------------------------------------
#include <boost/chrono/stopwatches/stopwatches.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/clock_suspender.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/clock_suspender.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/clock_suspender.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// See http://www.boost.org/LICENSE_1_0.txt
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_CLOCK_SUSPENDER_CLOCK_HPP
-#define BOOST_STOPWATCHES_CLOCK_SUSPENDER_CLOCK_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_CLOCK_SUSPENDER_CLOCK_HPP
+#define BOOST_CHRONO_STOPWATCHES_CLOCK_SUSPENDER_CLOCK_HPP
#include <boost/system/error_code.hpp>
#include <boost/mpl/bool.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/config.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/config.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/config.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -5,10 +5,10 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_CONFIG_HPP
-#define BOOST_STOPWATCHES_CONFIG_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_CONFIG_HPP
+#define BOOST_CHRONO_STOPWATCHES_CONFIG_HPP
#include <boost/config.hpp>
-#endif // BOOST_STOPWATCHES_CONFIG_HPP
+#endif // BOOST_CHRONO_STOPWATCHES_CONFIG_HPP
Modified: sandbox/stopwatches/boost/chrono/stopwatches/formatters/elapsed_formatter.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/formatters/elapsed_formatter.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/formatters/elapsed_formatter.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// See http://www.boost.org/LICENSE_1_0.txt
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_FORMATTERS_ELAPSED_HPP
-#define BOOST_STOPWATCHES_FORMATTERS_ELAPSED_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_FORMATTERS_ELAPSED_HPP
+#define BOOST_CHRONO_STOPWATCHES_FORMATTERS_ELAPSED_HPP
#include <boost/chrono/stopwatches/formatters/base_formatter.hpp>
#include <boost/system/error_code.hpp>
@@ -27,10 +27,10 @@
namespace chrono
{
-
- template<typename Ratio=micro, typename CharT = char, typename Traits = std::char_traits<CharT>,
+ template<typename Ratio = micro, typename CharT = char,
+ typename Traits = std::char_traits<CharT>,
class Alloc = std::allocator<CharT> >
- class basic_elapsed_formatter : public base_formatter<CharT, Traits>
+ class basic_elapsed_formatter: public base_formatter<CharT, Traits>
{
public:
@@ -40,26 +40,28 @@
typedef CharT char_type;
typedef std::basic_ostream<CharT, Traits> ostream_type;
- basic_elapsed_formatter() : base_type(),
- internal_fmt_(BOOST_CHRONO_STOPWATCHES_ELAPSED_FORMAT_DEFAULT),
+ basic_elapsed_formatter() :
+ base_type(),
+ internal_fmt_(BOOST_CHRONO_STOPWATCHES_ELAPSED_FORMAT_DEFAULT),
fmt_(internal_fmt_)
{
}
- basic_elapsed_formatter(ostream_type& os) : base_type(os),
- internal_fmt_(BOOST_CHRONO_STOPWATCHES_ELAPSED_FORMAT_DEFAULT),
+ basic_elapsed_formatter(ostream_type& os) :
+ base_type(os),
+ internal_fmt_(BOOST_CHRONO_STOPWATCHES_ELAPSED_FORMAT_DEFAULT),
fmt_(internal_fmt_)
{
}
- basic_elapsed_formatter(const char* fmt, ostream_type& os=std::cout) :
- base_type(os),
- internal_fmt_(fmt), fmt_(internal_fmt_)
+ basic_elapsed_formatter(const char* fmt, ostream_type& os = std::cout) :
+ base_type(os), internal_fmt_(fmt), fmt_(internal_fmt_)
{
}
- basic_elapsed_formatter(string_type const& fmt, ostream_type& os=std::cout) :
+ basic_elapsed_formatter(string_type const& fmt, ostream_type& os =
+ std::cout) :
base_type(os), internal_fmt_(fmt), fmt_(internal_fmt_)
{
}
- basic_elapsed_formatter(format_type & fmt, ostream_type& os=std::cout) :
+ basic_elapsed_formatter(format_type & fmt, ostream_type& os = std::cout) :
base_type(os), fmt_(fmt)
{
}
Modified: sandbox/stopwatches/boost/chrono/stopwatches/formatters/oneshot_formatter.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/formatters/oneshot_formatter.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/formatters/oneshot_formatter.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// See http://www.boost.org/LICENSE_1_0.txt
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_FORMATTERS_ONESHOT_HPP
-#define BOOST_STOPWATCHES_FORMATTERS_ONESHOT_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_FORMATTERS_ONESHOT_HPP
+#define BOOST_CHRONO_STOPWATCHES_FORMATTERS_ONESHOT_HPP
#include <boost/chrono/chrono.hpp>
#include <boost/system/error_code.hpp>
@@ -30,43 +30,33 @@
template<typename CharT = char, typename Traits = std::char_traits<CharT>,
class Alloc = std::allocator<CharT> >
- class basic_oneshot_formatter
+ class basic_oneshot_formatter: public base_formatter<CharT, Traits>
{
public:
+ typedef base_formatter<CharT, Traits> base_type;
typedef std::basic_string<CharT, Traits, Alloc> string_type;
typedef CharT char_type;
typedef std::basic_ostream<CharT, Traits> ostream_type;
basic_oneshot_formatter() :
- format_(BOOST_CHRONO_STOPWATCHES_ONESHOOT_FORMAT_DEFAULT),
- precision_(3), os_(std::cout)
+ base_type(), format_(BOOST_CHRONO_STOPWATCHES_ONESHOOT_FORMAT_DEFAULT)
{
}
basic_oneshot_formatter(ostream_type& os) :
- format_(BOOST_CHRONO_STOPWATCHES_ONESHOOT_FORMAT_DEFAULT),
- precision_(3), os_(os)
+ base_type(os),
+ format_(BOOST_CHRONO_STOPWATCHES_ONESHOOT_FORMAT_DEFAULT)
{
}
basic_oneshot_formatter(const char_type* fmt, ostream_type& os =
std::cout) :
- format_(fmt), precision_(3), os_(os)
+ base_type(os), format_(fmt)
{
}
basic_oneshot_formatter(string_type const& fmt, ostream_type& os =
std::cout) :
- str_(fmt), format_(str_.c_str()), precision_(3), os_(os)
+ base_type(), str_(fmt), format_(str_.c_str())
{
}
- void set_precision(std::size_t precision)
- {
- precision_ = precision;
- if (precision_ > 9)
- precision_ = 9; // sanity check
- }
- void set_os(ostream_type os)
- {
- os_ = os;
- }
static string_type format(const char* s)
{
string_type res(s);
@@ -84,24 +74,26 @@
if (d < duration_t::zero())
return;
- boost::io::ios_flags_saver ifs(os_);
- os_.setf(std::ios_base::fixed, std::ios_base::floatfield);
- boost::io::ios_precision_saver ips(os_);
- os_.precision(precision_);
+ boost::io::ios_flags_saver ifs(this->os_);
+ this->os_.setf(std::ios_base::fixed, std::ios_base::floatfield);
+ boost::io::ios_precision_saver ips(this->os_);
+ this->os_.precision(this->precision_);
+ duration_style_io_saver<> idss(this->os_);
+ this->os_ << duration_fmt(this->style_);
for (; *format_; ++format_)
{
if ((*format_ != '%') || (!*(format_ + 1))
|| (!std::strchr("d", *(format_ + 1))))
{
- os_ << *format_;
+ this->os_ << *format_;
} else
{
++format_;
switch (*format_)
{
case 'd':
- os_ << boost::chrono::duration<double>(d).count();
+ this->os_ << boost::chrono::duration<double>(d).count();
break;
default:
// todo this should be replaced by a ec or an exception.
@@ -114,8 +106,6 @@
private:
string_type str_;
const char_type* format_;
- std::size_t precision_;
- ostream_type & os_;
};
typedef basic_oneshot_formatter<char> oneshot_formatter;
Modified: sandbox/stopwatches/boost/chrono/stopwatches/lightweight_stopwatch.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/lightweight_stopwatch.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/lightweight_stopwatch.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_LIGHTWEIGHT_STOPWATCH__HPP
-#define BOOST_STOPWATCHES_LIGHTWEIGHT_STOPWATCH__HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_LIGHTWEIGHT_STOPWATCH__HPP
+#define BOOST_CHRONO_STOPWATCHES_LIGHTWEIGHT_STOPWATCH__HPP
#include <utility>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/reporters/stopwatch_reporter.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/reporters/stopwatch_reporter.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/reporters/stopwatch_reporter.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -5,8 +5,8 @@
// copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_REPORTERS_STOPWATCH_REPORTER_HPP
-#define BOOST_STOPWATCHES_REPORTERS_STOPWATCH_REPORTER_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_REPORTERS_STOPWATCH_REPORTER_HPP
+#define BOOST_CHRONO_STOPWATCHES_REPORTERS_STOPWATCH_REPORTER_HPP
#if !defined(BOOST_ENABLE_WARNINGS) && !defined(BOOST_STOPWATCHES_ENABLE_WARNINGS)
#if defined __GNUC__
@@ -91,10 +91,12 @@
template<class Stopwatch, class Formatter>
void basic_stopwatch_reporter2<Stopwatch, Formatter>::report(system::error_code & ec)
{
- // chrono::clock_suspender<typename Stopwatch::clock> _(ec);
- // if (!BOOST_CHRONO_IS_THROWS(ec)) {
- // if (ec) return;
- // }
+ chrono::clock_suspender<typename Stopwatch::clock> _(ec);
+ if (!BOOST_CHRONO_IS_THROWS(ec))
+ {
+ if (ec)
+ return;
+ }
reported_ = true;
formatter_(*this, ec);
@@ -220,17 +222,4 @@
#endif
-//boost::chrono::basic_stopwatch_reporter2<Stopwatch, Formatter>::basic_stopwatch_reporter2(const Formatter&)Õ
-//boost::chrono::basic_stopwatch_reporter2<Stopwatch, Formatter>::basic_stopwatch_reporter2(const boost::chrono::basic_stopwatch_reporter2<Stopwatch, Formatter>&) [with Stopwatch = boost::chrono::stopwatch<boost::chrono::system_clock>, Formatter = boost::chrono::basic_elapsed_formatter<boost::ratio<1l, 1000000l>, char, std::char_traits<char>, std::allocator<char> >]
-//boost::chrono::basic_stopwatch_reporter2<Stopwatch, Formatter>::basic_stopwatch_reporter2(const typename Formatter::string_type&) [with Stopwatch = boost::chrono::stopwatch<boost::chrono::system_clock>, Formatter = boost::chrono::basic_elapsed_formatter<boost::ratio<1l, 1000000l>, char, std::char_traits<char>, std::allocator<char> >]
-//boost::chrono::basic_stopwatch_reporter2<Stopwatch, Formatter>::basic_stopwatch_reporter2(const typename Formatter::char_type*) [with Stopwatch = boost::chrono::stopwatch<boost::chrono::system_clock>, Formatter = boost::chrono::basic_elapsed_formatter<boost::ratio<1l, 1000000l>, char, std::char_traits<char>, std::allocator<char> >]
-
-
-
-
-
-
-
-
-
Modified: sandbox/stopwatches/boost/chrono/stopwatches/scoped_stopclock.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/scoped_stopclock.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/scoped_stopclock.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_SCOPED_STOPCLOCK_HPP
-#define BOOST_STOPWATCHES_SCOPED_STOPCLOCK_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_SCOPED_STOPCLOCK_HPP
+#define BOOST_CHRONO_STOPWATCHES_SCOPED_STOPCLOCK_HPP
#include <boost/chrono/stopwatches/stopwatch_reporter.hpp>
#include <boost/chrono/stopwatches/stopwatch.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/stopclock.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/stopclock.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopclock.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_STOPCLOCK_HPP
-#define BOOST_STOPWATCHES_STOPCLOCK_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_STOPCLOCK_HPP
+#define BOOST_CHRONO_STOPWATCHES_STOPCLOCK_HPP
#include <boost/chrono/stopwatches/config.hpp>
#include <boost/chrono/stopwatches/detail/static_assert.hpp>
@@ -19,25 +19,6 @@
namespace boost { namespace chrono {
-//--------------------------------------------------------------------------------------//
-//~ provides a everything a Timer provides and it adds reporting capabilities that can be invoked in a single line of code. The reporting is controleed by two parameters:
-
- //~ * format : The output format
- //~ * places(precission): the number of decimal placess used.
-
-//~ The default places is given by default_places and is 3. The default format is "\n%ts\n", where
-
- //~ * %t : the result of elapsed() when the reporting is done.
-
-//~ The time is given using the suffix "s" following the System International d'Unites Std.
-
-/* void f1()
- * {
- * stopclock<> _;
- * // ...
- * }
- */
-//--------------------------------------------------------------------------------------//
template <class Clock>
struct stopwatch_reporter_default_formatter<stopwatch<Clock> > {
Modified: sandbox/stopwatches/boost/chrono/stopwatches/stopclock_accumulator.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/stopclock_accumulator.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopclock_accumulator.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_STOPCLOCK_ACCUMULATOR_HPP
-#define BOOST_STOPWATCHES_STOPCLOCK_ACCUMULATOR_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_STOPCLOCK_ACCUMULATOR_HPP
+#define BOOST_CHRONO_STOPWATCHES_STOPCLOCK_ACCUMULATOR_HPP
#include <boost/chrono/stopwatches/config.hpp>
#include <boost/chrono/stopwatches/detail/static_assert.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/stopwatch.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_STOPWATCH_HPP
-#define BOOST_STOPWATCHES_STOPWATCH_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_STOPWATCH_HPP
+#define BOOST_CHRONO_STOPWATCHES_STOPWATCH_HPP
#include <utility>
#include <boost/chrono/chrono.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_HPP
-#define BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_STOPWATCH_ACCUMULATOR_HPP
+#define BOOST_CHRONO_STOPWATCHES_STOPWATCH_ACCUMULATOR_HPP
#include <utility>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_formatter.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_FORMATTER_HPP
-#define BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_FORMATTER_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_STOPWATCH_ACCUMULATOR_FORMATTER_HPP
+#define BOOST_CHRONO_STOPWATCHES_STOPWATCH_ACCUMULATOR_FORMATTER_HPP
#include <boost/chrono/chrono.hpp>
#include <boost/system/error_code.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_accumulator_time_formatter.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_TIMES_FORMATTER_HPP
-#define BOOST_STOPWATCHES_STOPWATCH_ACCUMULATOR_TIMES_FORMATTER_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_STOPWATCH_ACCUMULATOR_TIMES_FORMATTER_HPP
+#define BOOST_CHRONO_STOPWATCHES_STOPWATCH_ACCUMULATOR_TIMES_FORMATTER_HPP
#include <boost/chrono/chrono.hpp>
#include <boost/system/error_code.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_formatter.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_formatter.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_formatter.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_STOPWATCH_FORMATTER_HPP
-#define BOOST_STOPWATCHES_STOPWATCH_FORMATTER_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_STOPWATCH_FORMATTER_HPP
+#define BOOST_CHRONO_STOPWATCHES_STOPWATCH_FORMATTER_HPP
#include <boost/chrono/chrono.hpp>
#include <boost/system/error_code.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_reporter.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_reporter.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_reporter.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_STOPWATCH_REPORTER_HPP
-#define BOOST_STOPWATCHES_STOPWATCH_REPORTER_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_STOPWATCH_REPORTER_HPP
+#define BOOST_CHRONO_STOPWATCHES_STOPWATCH_REPORTER_HPP
#if !defined(BOOST_ENABLE_WARNINGS) && !defined(BOOST_STOPWATCHES_ENABLE_WARNINGS)
#if defined __GNUC__
Modified: sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_scoped.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_scoped.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatch_scoped.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_STOPWATCH_SCOPED_HPP
-#define BOOST_STOPWATCHES_STOPWATCH_SCOPED_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_STOPWATCH_SCOPED_HPP
+#define BOOST_CHRONO_STOPWATCHES_STOPWATCH_SCOPED_HPP
#include <boost/chrono/chrono.hpp>
#include <boost/system/error_code.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/stopwatches.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/stopwatches.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/stopwatches.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -10,8 +10,8 @@
//
//////////////////////////////////////////////////////////////////////////////
-#ifndef BOOST_STOPWATCHES_STOPWATCHES_HPP
-#define BOOST_STOPWATCHES_STOPWATCHES_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_STOPWATCHES_HPP
+#define BOOST_CHRONO_STOPWATCHES_STOPWATCHES_HPP
//-----------------------------------------------------------------------------
#include <boost/chrono/stopwatches/scoped_stopclock.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/suspendible_clock.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/suspendible_clock.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/suspendible_clock.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// See http://www.boost.org/LICENSE_1_0.txt
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_SUSPENDIBLE_CLOCK_HPP
-#define BOOST_STOPWATCHES_SUSPENDIBLE_CLOCK_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_SUSPENDIBLE_CLOCK_HPP
+#define BOOST_CHRONO_STOPWATCHES_SUSPENDIBLE_CLOCK_HPP
#include <boost/version.hpp>
#include <boost/chrono/chrono.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/t24_hours.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/t24_hours.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/t24_hours.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// See http://www.boost.org/LICENSE_1_0.txt
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_T24_HOURS_HPP
-#define BOOST_STOPWATCHES_T24_HOURS_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_T24_HOURS_HPP
+#define BOOST_CHRONO_STOPWATCHES_T24_HOURS_HPP
#include <boost/chrono/chrono.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/t24_hours_formatter.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/t24_hours_formatter.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/t24_hours_formatter.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_T24_HOURS_FORMATTER_HPP
-#define BOOST_STOPWATCHES_T24_HOURS_FORMATTER_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_T24_HOURS_FORMATTER_HPP
+#define BOOST_CHRONO_STOPWATCHES_T24_HOURS_FORMATTER_HPP
#include <boost/chrono/chrono.hpp>
#include <boost/chrono/stopwatches/t24_hours.hpp>
Modified: sandbox/stopwatches/boost/chrono/stopwatches/time_formatter.hpp
==============================================================================
--- sandbox/stopwatches/boost/chrono/stopwatches/time_formatter.hpp (original)
+++ sandbox/stopwatches/boost/chrono/stopwatches/time_formatter.hpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -4,8 +4,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/chrono/stopwatches for documentation.
-#ifndef BOOST_STOPWATCHES_TIME_FORMATTER_HPP
-#define BOOST_STOPWATCHES_TIME_FORMATTER_HPP
+#ifndef BOOST_CHRONO_STOPWATCHES_TIME_FORMATTER_HPP
+#define BOOST_CHRONO_STOPWATCHES_TIME_FORMATTER_HPP
#include <boost/chrono/chrono.hpp>
#include <boost/chrono/process_cpu_clocks.hpp>
Modified: sandbox/stopwatches/libs/chrono/stopwatches/example/scoped_stopwatch_example.cpp
==============================================================================
--- sandbox/stopwatches/libs/chrono/stopwatches/example/scoped_stopwatch_example.cpp (original)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/scoped_stopwatch_example.cpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -6,6 +6,7 @@
#include <iostream>
#include <boost/chrono/stopwatches/stopwatches.hpp>
+#include <boost/chrono/stopwatches/simple_stopwatch.hpp>
#include <boost/chrono/stopwatches/formatters/elapsed_formatter.hpp>
#include <boost/chrono/stopwatches/formatters/oneshot_formatter.hpp>
#include <boost/chrono/stopwatches/reporters/stopwatch_reporter.hpp>
@@ -19,10 +20,15 @@
template <>
struct stopwatch_reporter2_default_formatter<stopwatch<system_clock> > {
typedef elapsed_formatter type;
- }; template <>
+ };
+ template <>
struct stopwatch_reporter2_default_formatter<stopwatch<high_resolution_clock> > {
typedef elapsed_formatter type;
};
+ template <>
+ struct stopwatch_reporter2_default_formatter<simple_stopwatch<high_resolution_clock> > {
+ typedef elapsed_formatter type;
+ };
}}
using namespace boost::chrono;
@@ -32,7 +38,7 @@
long double res;
void f0(long j)
{
- stopwatch_reporter2<stopwatch<high_resolution_clock> > sw;
+ stopwatch_reporter2<simple_stopwatch<high_resolution_clock> > sw;
for (long i =0; i< j; i+=1)
res+=std::sqrt( res+123.456L+i ); // burn some time
}
@@ -79,7 +85,7 @@
f3(3000000);
std::cout<< res << std::endl;
- return 1;
+ return 0;
}
Modified: sandbox/stopwatches/libs/chrono/stopwatches/example/stopwatch_accumulator_example.cpp
==============================================================================
--- sandbox/stopwatches/libs/chrono/stopwatches/example/stopwatch_accumulator_example.cpp (original)
+++ sandbox/stopwatches/libs/chrono/stopwatches/example/stopwatch_accumulator_example.cpp 2011-09-16 18:05:25 EDT (Fri, 16 Sep 2011)
@@ -115,5 +115,5 @@
// std::cout << "f1() Mean: " << accumulators::mean(acc) << std::endl;
// std::cout << "f1() Min: " << (accumulators::min)(acc) << std::endl;
// std::cout << "f1() Max: " << (accumulators::max)(acc) << std::endl;
- return 1;
+ return 0;
}
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