Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59371 - sandbox/chrono/boost/chrono
From: vicente.botet_at_[hidden]
Date: 2010-01-30 13:49:51


Author: viboes
Date: 2010-01-30 13:49:50 EST (Sat, 30 Jan 2010)
New Revision: 59371
URL: http://svn.boost.org/trac/boost/changeset/59371

Log:
Boost.Chrono: Version 0.4.0,
* Adding support for wide character for stopwatch_reporter, stopclock, and stopclock_accumulator.

Text files modified:
   sandbox/chrono/boost/chrono/stopclock.hpp | 139 ++++++++++++++++++++++++++
   sandbox/chrono/boost/chrono/stopclock_accumulator.hpp | 140 +++++++++++++++++++++++++++
   sandbox/chrono/boost/chrono/stopwatch.hpp | 5
   sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp | 7 +
   sandbox/chrono/boost/chrono/stopwatch_reporter.hpp | 203 +++++++++++++++++++++++++++++++++------
   5 files changed, 454 insertions(+), 40 deletions(-)

Modified: sandbox/chrono/boost/chrono/stopclock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopclock.hpp (original)
+++ sandbox/chrono/boost/chrono/stopclock.hpp 2010-01-30 13:49:50 EST (Sat, 30 Jan 2010)
@@ -43,6 +43,67 @@
  */
 //--------------------------------------------------------------------------------------//
 
+ template <class Clock, class Formatter>
+ class basic_stopclock : public basic_stopwatch_reporter<chrono::stopwatch<Clock>, Formatter> {
+ typedef basic_stopwatch_reporter<chrono::stopwatch<Clock>, Formatter> base_type;
+ public:
+ typedef Clock clock;
+ typedef chrono::stopwatch<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit basic_stopclock( system::error_code & ec = system::throws )
+ : base_type(ec) { }
+ explicit basic_stopclock( ostream_type & os,
+ system::error_code & ec = system::throws )
+ : base_type(os, ec) { }
+
+ explicit basic_stopclock( const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(format, ec) { }
+
+ explicit basic_stopclock( int places,
+ system::error_code & ec = system::throws )
+ : base_type(places, ec) { }
+
+ basic_stopclock( ostream_type & os, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, ec) { }
+
+ basic_stopclock( const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(format, places, ec) { }
+
+ basic_stopclock( ostream_type & os, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, ec) { }
+
+ basic_stopclock( int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(places, format, ec) { }
+
+ basic_stopclock( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, places, ec) { }
+
+ basic_stopclock( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, format, ec) { }
+
+ typedef stopwatch_runner<basic_stopclock> scoped_run;
+ typedef stopwatch_stopper<basic_stopclock> scoped_stop;
+ typedef stopwatch_suspender<basic_stopclock> scoped_suspend;
+ typedef stopwatch_resumer<basic_stopclock> scoped_resume;
+
+ };
+
+ template <class Clock, class Formatter>
+ struct stopwatch_reporter_default_formatter<basic_stopclock<Clock,Formatter> > {
+ typedef Formatter type;
+ };
+
     template <class Clock=process_cpu_clock, class Formatter=typename stopwatch_reporter_default_formatter<stopwatch<Clock> >::type>
     class stopclock;
 
@@ -52,8 +113,8 @@
     };
 
     template <class Clock, class Formatter>
- class stopclock : public stopwatch_reporter<chrono::stopwatch<Clock>, Formatter> {
- typedef stopwatch_reporter<chrono::stopwatch<Clock>, Formatter> base_type;
+ class stopclock : public basic_stopclock<Clock, Formatter> {
+ typedef basic_stopclock<Clock, Formatter> base_type;
     public:
         typedef Clock clock;
         typedef chrono::stopwatch<Clock> stopwatch;
@@ -117,6 +178,80 @@
     typedef stopclock< boost::chrono::process_system_cpu_clock > process_system_cpu_stopclock;
     //typedef stopclock< boost::chrono::process_cpu_clock > process_cpu_stopclock;
 
+ template <class Clock=process_cpu_clock, class Formatter=typename wstopwatch_reporter_default_formatter<stopwatch<Clock> >::type>
+ class wstopclock;
+
+ template <class Clock, class Formatter>
+ struct stopwatch_reporter_default_formatter<wstopclock<Clock,Formatter> > {
+ typedef Formatter type;
+ };
+
+ template <class Clock, class Formatter>
+ class wstopclock : public basic_stopclock<Clock, Formatter> {
+ typedef basic_stopclock<Clock, Formatter> base_type;
+ public:
+ typedef Clock clock;
+ typedef chrono::stopwatch<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit wstopclock( system::error_code & ec = system::throws )
+ : base_type(ec) { }
+ explicit wstopclock( ostream_type & os,
+ system::error_code & ec = system::throws )
+ : base_type(os, ec) { }
+
+ explicit wstopclock( const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(format, ec) { }
+
+ explicit wstopclock( int places,
+ system::error_code & ec = system::throws )
+ : base_type(places, ec) { }
+
+ wstopclock( ostream_type & os, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, ec) { }
+
+ wstopclock( const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(format, places, ec) { }
+
+ wstopclock( ostream_type & os, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, ec) { }
+
+ wstopclock( int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(places, format, ec) { }
+
+ wstopclock( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, places, ec) { }
+
+ wstopclock( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, format, ec) { }
+
+ typedef stopwatch_runner<wstopclock> scoped_run;
+ typedef stopwatch_stopper<wstopclock> scoped_stop;
+ typedef stopwatch_suspender<wstopclock> scoped_suspend;
+ typedef stopwatch_resumer<wstopclock> scoped_resume;
+
+ };
+
+ typedef wstopclock< boost::chrono::system_clock > system_wstopclock;
+ #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ typedef wstopclock< boost::chrono::monotonic_clock > monotonic_wstopclock;
+ #endif
+ typedef wstopclock< boost::chrono::high_resolution_clock > high_resolution_wstopclock;
+ typedef wstopclock< boost::chrono::process_real_cpu_clock > process_real_cpu_wstopclock;
+ typedef wstopclock< boost::chrono::process_user_cpu_clock > process_user_cpu_wstopclock;
+ typedef wstopclock< boost::chrono::process_system_cpu_clock > process_system_cpu_wstopclock;
+ //typedef wstopclock< boost::chrono::process_cpu_clock > process_cpu_wstopclock;
+
 
   } // namespace chrono
 } // namespace boost

Modified: sandbox/chrono/boost/chrono/stopclock_accumulator.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopclock_accumulator.hpp (original)
+++ sandbox/chrono/boost/chrono/stopclock_accumulator.hpp 2010-01-30 13:49:50 EST (Sat, 30 Jan 2010)
@@ -44,6 +44,68 @@
  */
 //--------------------------------------------------------------------------------------//
 
+
+ template <class Clock, class Formatter>
+ class basic_stopclock_accumulator : public basic_stopwatch_reporter<stopwatch_accumulator<Clock>, Formatter> {
+ typedef basic_stopwatch_reporter<stopwatch_accumulator<Clock>, Formatter> base_type;
+ public:
+ typedef Clock clock;
+ typedef stopwatch_accumulator<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit basic_stopclock_accumulator( system::error_code & ec = system::throws )
+ : base_type(ec) { }
+ explicit basic_stopclock_accumulator( ostream_type & os,
+ system::error_code & ec = system::throws )
+ : base_type(os, ec) { }
+
+ explicit basic_stopclock_accumulator( const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(format, ec) { }
+
+ explicit basic_stopclock_accumulator( int places,
+ system::error_code & ec = system::throws )
+ : base_type(places, ec) { }
+
+ basic_stopclock_accumulator( ostream_type & os, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, ec) { }
+
+ basic_stopclock_accumulator( const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(format, places, ec) { }
+
+ basic_stopclock_accumulator( ostream_type & os, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, ec) { }
+
+ basic_stopclock_accumulator( int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(places, format, ec) { }
+
+ basic_stopclock_accumulator( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, places, ec) { }
+
+ basic_stopclock_accumulator( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, format, ec) { }
+
+
+ typedef stopwatch_runner<basic_stopclock_accumulator> scoped_run;
+ typedef stopwatch_stopper<basic_stopclock_accumulator> scoped_stop;
+ typedef stopwatch_suspender<basic_stopclock_accumulator> scoped_suspend;
+ typedef stopwatch_resumer<basic_stopclock_accumulator> scoped_resume;
+ };
+
+ template <class Clock, class Formatter>
+ struct stopwatch_reporter_default_formatter<basic_stopclock_accumulator<Clock,Formatter> > {
+ typedef Formatter type;
+ };
+
     template <class Clock=high_resolution_clock, class Formatter=typename stopwatch_reporter_default_formatter<stopwatch_accumulator<Clock> >::type>
     class stopclock_accumulator;
 
@@ -53,8 +115,8 @@
     };
 
     template <class Clock, class Formatter>
- class stopclock_accumulator : public stopwatch_reporter<stopwatch_accumulator<Clock>, Formatter> {
- typedef stopwatch_reporter<stopwatch_accumulator<Clock>, Formatter> base_type;
+ class stopclock_accumulator : public basic_stopclock_accumulator<Clock, Formatter> {
+ typedef basic_stopclock_accumulator<Clock, Formatter> base_type;
     public:
         typedef Clock clock;
         typedef stopwatch_accumulator<Clock> stopwatch;
@@ -118,6 +180,80 @@
     typedef stopclock_accumulator< boost::chrono::process_system_cpu_clock > process_system_cpu_stopclock_accumulator;
     //typedef stopclock_accumulator< boost::chrono::process_cpu_clock > process_cpu_stopclock_accumulator;
 
+ template <class Clock=high_resolution_clock, class Formatter=typename wstopwatch_reporter_default_formatter<stopwatch_accumulator<Clock> >::type>
+ class wstopclock_accumulator;
+
+ template <class Clock, class Formatter>
+ struct stopwatch_reporter_default_formatter<wstopclock_accumulator<Clock,Formatter> > {
+ typedef Formatter type;
+ };
+
+ template <class Clock, class Formatter>
+ class wstopclock_accumulator : public basic_stopclock_accumulator<Clock, Formatter> {
+ typedef basic_stopclock_accumulator<Clock, Formatter> base_type;
+ public:
+ typedef Clock clock;
+ typedef stopwatch_accumulator<Clock> stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit wstopclock_accumulator( system::error_code & ec = system::throws )
+ : base_type(ec) { }
+ explicit wstopclock_accumulator( ostream_type & os,
+ system::error_code & ec = system::throws )
+ : base_type(os, ec) { }
+
+ explicit wstopclock_accumulator( const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(format, ec) { }
+
+ explicit wstopclock_accumulator( int places,
+ system::error_code & ec = system::throws )
+ : base_type(places, ec) { }
+
+ wstopclock_accumulator( ostream_type & os, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, ec) { }
+
+ wstopclock_accumulator( const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(format, places, ec) { }
+
+ wstopclock_accumulator( ostream_type & os, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, ec) { }
+
+ wstopclock_accumulator( int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(places, format, ec) { }
+
+ wstopclock_accumulator( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, places, ec) { }
+
+ wstopclock_accumulator( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, format, ec) { }
+
+
+ typedef stopwatch_runner<wstopclock_accumulator> scoped_run;
+ typedef stopwatch_stopper<wstopclock_accumulator> scoped_stop;
+ typedef stopwatch_suspender<wstopclock_accumulator> scoped_suspend;
+ typedef stopwatch_resumer<wstopclock_accumulator> scoped_resume;
+ };
+
+ typedef wstopclock_accumulator< boost::chrono::system_clock > system_wstopclock_accumulator;
+ #ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+ typedef wstopclock_accumulator< boost::chrono::monotonic_clock > monotonic_wstopclock_accumulator;
+ #endif
+ typedef wstopclock_accumulator< boost::chrono::high_resolution_clock > high_resolution_wstopclock_accumulator;
+ typedef wstopclock_accumulator< boost::chrono::process_real_cpu_clock > process_real_cpu_wstopclock_accumulator;
+ typedef wstopclock_accumulator< boost::chrono::process_user_cpu_clock > process_user_cpu_wstopclock_accumulator;
+ typedef wstopclock_accumulator< boost::chrono::process_system_cpu_clock > process_system_cpu_wstopclock_accumulator;
+ //typedef wstopclock_accumulator< boost::chrono::process_cpu_clock > process_cpu_wstopclock_accumulator;
+
   } // namespace chrono
 } // namespace boost
 

Modified: sandbox/chrono/boost/chrono/stopwatch.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatch.hpp (original)
+++ sandbox/chrono/boost/chrono/stopwatch.hpp 2010-01-30 13:49:50 EST (Sat, 30 Jan 2010)
@@ -47,6 +47,11 @@
         typedef stopwatch_formatter type;
     };
 
+ template <class Clock>
+ struct wstopwatch_reporter_default_formatter<stopwatch<Clock> > {
+ typedef wstopwatch_formatter type;
+ };
+
     struct dont_start_t{};
     static const dont_start_t dont_start = {};
     template <class Clock>

Modified: sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp (original)
+++ sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp 2010-01-30 13:49:50 EST (Sat, 30 Jan 2010)
@@ -63,6 +63,11 @@
         typedef stopwatch_accumulator_formatter type;
     };
 
+ template <class Clock, class Accumulator>
+ struct wstopwatch_reporter_default_formatter<stopwatch_accumulator<Clock, Accumulator> > {
+ typedef wstopwatch_accumulator_formatter type;
+ };
+
 //--------------------------------------------------------------------------------------//
     template <class Clock, class Accumulator>
     class stopwatch_accumulator
@@ -189,7 +194,7 @@
         typedef stopwatch_stopper<stopwatch_accumulator<Clock> > scoped_stop;
         typedef stopwatch_suspender<stopwatch_accumulator<Clock> > scoped_suspend;
         typedef stopwatch_resumer<stopwatch_accumulator<Clock> > scoped_resume;
- template <class Formatter=typename stopwatch_reporter_default_formatter<stopwatch_accumulator>::type>
+ template <class Formatter=typename stopwatch_reporter_default_formatter<stopwatch_accumulator>::type>
         struct get_reporter {
             typedef stopwatch_reporter<stopwatch_accumulator,Formatter > type;
         };

Modified: sandbox/chrono/boost/chrono/stopwatch_reporter.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatch_reporter.hpp (original)
+++ sandbox/chrono/boost/chrono/stopwatch_reporter.hpp 2010-01-30 13:49:50 EST (Sat, 30 Jan 2010)
@@ -65,23 +65,8 @@
  */
 //--------------------------------------------------------------------------------------//
 
-
- template <class Stopwatch>
- struct stopwatch_reporter_default_formatter {
- typename Stopwatch::formatter type;
- };
-
- template <class Stopwatch, class Formatter=typename stopwatch_reporter_default_formatter<Stopwatch>::type>
- class stopwatch_reporter;
-
     template <class Stopwatch, class Formatter>
- struct stopwatch_reporter_default_formatter<stopwatch_reporter<Stopwatch, Formatter> > {
- typedef Formatter type;
- };
-
-
- template <class Stopwatch, class Formatter>
- class stopwatch_reporter : public Stopwatch {
+ class basic_stopwatch_reporter : public Stopwatch {
     public:
         typedef typename Stopwatch::clock clock;
         typedef Stopwatch stopwatch;
@@ -90,45 +75,45 @@
         typedef typename Formatter::char_type char_type;
         typedef typename Formatter::ostream_type ostream_type;
 
- explicit stopwatch_reporter( system::error_code & ec = system::throws )
+ explicit basic_stopwatch_reporter( system::error_code & ec = system::throws )
         : m_places(Formatter::default_places()), m_os(Formatter::default_os()), m_format(Formatter::default_format()), m_reported(false) { }
- explicit stopwatch_reporter( ostream_type & os,
+ explicit basic_stopwatch_reporter( ostream_type & os,
                     system::error_code & ec = system::throws )
         : m_places(Formatter::default_places()), m_os(os), m_format(Formatter::default_format()), m_reported(false) { }
 
- explicit stopwatch_reporter( const string_type & format,
+ explicit basic_stopwatch_reporter( const string_type & format,
                     system::error_code & ec = system::throws )
         : m_places(Formatter::default_places()), m_os(Formatter::default_os()), m_format(format), m_reported(false) {}
 
- explicit stopwatch_reporter( int places,
+ explicit basic_stopwatch_reporter( int places,
                     system::error_code & ec = system::throws )
         : m_places(places), m_os(Formatter::default_os()), m_format(Formatter::default_format()), m_reported(false) { }
 
- stopwatch_reporter( ostream_type & os, const string_type & format,
+ basic_stopwatch_reporter( ostream_type & os, const string_type & format,
                     system::error_code & ec = system::throws )
         : m_places(Formatter::default_places()), m_os(os), m_format(format), m_reported(false) { }
 
- stopwatch_reporter( const string_type & format, int places,
+ basic_stopwatch_reporter( const string_type & format, int places,
                     system::error_code & ec = system::throws )
         : m_places(places), m_os(Formatter::default_os()), m_format(format), m_reported(false) { }
 
- stopwatch_reporter( ostream_type & os, int places,
+ basic_stopwatch_reporter( ostream_type & os, int places,
                     system::error_code & ec = system::throws )
         : m_places(places), m_os(os), m_format(Formatter::default_format()), m_reported(false) { }
 
- stopwatch_reporter( int places, const string_type & format,
+ basic_stopwatch_reporter( int places, const string_type & format,
                     system::error_code & ec = system::throws )
         : m_places(places), m_os(Formatter::default_os()), m_format(format), m_reported(false) { }
 
- stopwatch_reporter( ostream_type & os, const string_type & format, int places,
+ basic_stopwatch_reporter( ostream_type & os, const string_type & format, int places,
                     system::error_code & ec = system::throws )
         : m_places(places), m_os(os), m_format(format), m_reported(false) { }
 
- stopwatch_reporter( ostream_type & os, int places, const string_type & format,
+ basic_stopwatch_reporter( ostream_type & os, int places, const string_type & format,
                     system::error_code & ec = system::throws )
         : m_places(places), m_os(os), m_format(format), m_reported(false) { }
 
- ~stopwatch_reporter() {// never throws
+ ~basic_stopwatch_reporter() {// never throws
             system::error_code ec;
             //this->stop(ec);
             if ( !reported() ) {
@@ -141,10 +126,10 @@
         bool reported() const { return m_reported; }
 
 
- typedef stopwatch_runner<stopwatch_reporter<Stopwatch,Formatter> > scoped_run;
- typedef stopwatch_stopper<stopwatch_reporter<Stopwatch,Formatter> > scoped_stop;
- typedef stopwatch_suspender<stopwatch_reporter<Stopwatch,Formatter> > scoped_suspend;
- typedef stopwatch_resumer<stopwatch_reporter<Stopwatch,Formatter> > scoped_resume;
+ typedef stopwatch_runner<basic_stopwatch_reporter<Stopwatch,Formatter> > scoped_run;
+ typedef stopwatch_stopper<basic_stopwatch_reporter<Stopwatch,Formatter> > scoped_stop;
+ typedef stopwatch_suspender<basic_stopwatch_reporter<Stopwatch,Formatter> > scoped_suspend;
+ typedef stopwatch_resumer<basic_stopwatch_reporter<Stopwatch,Formatter> > scoped_resume;
 
     protected:
         int m_places;
@@ -153,13 +138,13 @@
         bool m_reported;
 
 
- //stopwatch_reporter(); // = delete;
- stopwatch_reporter(const stopwatch_reporter&); // = delete;
- stopwatch_reporter& operator=(const stopwatch_reporter&); // = delete;
+ //basic_stopwatch_reporter(); // = delete;
+ basic_stopwatch_reporter(const basic_stopwatch_reporter&); // = delete;
+ basic_stopwatch_reporter& operator=(const basic_stopwatch_reporter&); // = delete;
     };
 
     template <class Stopwatch, class Formatter>
- void stopwatch_reporter<Stopwatch, Formatter>::report( system::error_code & ec ) {
+ void basic_stopwatch_reporter<Stopwatch, Formatter>::report( system::error_code & ec ) {
         chrono::scoped_suspend<typename Stopwatch::clock> _(ec);
         m_reported = true;
         if ( m_format.empty() ) m_format = Formatter::default_format();
@@ -180,6 +165,154 @@
     }
 
 
+ template <class Stopwatch>
+ struct stopwatch_reporter_default_formatter;
+
+ template <class Stopwatch, class Formatter=typename stopwatch_reporter_default_formatter<Stopwatch>::type>
+ class stopwatch_reporter;
+
+ template <class Stopwatch, class Formatter>
+ struct stopwatch_reporter_default_formatter<stopwatch_reporter<Stopwatch, Formatter> > {
+ typedef Formatter type;
+ };
+
+
+ template <class Stopwatch, class Formatter>
+ class stopwatch_reporter : public basic_stopwatch_reporter<Stopwatch,Formatter> {
+ typedef basic_stopwatch_reporter<Stopwatch,Formatter> base_type;
+ public:
+ typedef typename Stopwatch::clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit stopwatch_reporter( system::error_code & ec = system::throws )
+ : base_type(ec) { }
+ explicit stopwatch_reporter( ostream_type & os,
+ system::error_code & ec = system::throws )
+ : base_type(os, ec) { }
+
+ explicit stopwatch_reporter( const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(format, ec) { }
+
+ explicit stopwatch_reporter( int places,
+ system::error_code & ec = system::throws )
+ : base_type(places, ec) { }
+
+ stopwatch_reporter( ostream_type & os, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, ec) { }
+
+ stopwatch_reporter( const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(format, places, ec) { }
+
+ stopwatch_reporter( ostream_type & os, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, ec) { }
+
+ stopwatch_reporter( int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(places, format, ec) { }
+
+ stopwatch_reporter( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, places, ec) { }
+
+ stopwatch_reporter( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, format, ec) { }
+
+ typedef stopwatch_runner<stopwatch_reporter<Stopwatch,Formatter> > scoped_run;
+ typedef stopwatch_stopper<stopwatch_reporter<Stopwatch,Formatter> > scoped_stop;
+ typedef stopwatch_suspender<stopwatch_reporter<Stopwatch,Formatter> > scoped_suspend;
+ typedef stopwatch_resumer<stopwatch_reporter<Stopwatch,Formatter> > scoped_resume;
+
+ protected:
+
+
+ //stopwatch_reporter(); // = delete;
+ stopwatch_reporter(const stopwatch_reporter&); // = delete;
+ stopwatch_reporter& operator=(const stopwatch_reporter&); // = delete;
+ };
+
+
+ template <class Stopwatch>
+ struct wstopwatch_reporter_default_formatter;
+
+ template <class Stopwatch, class Formatter=typename wstopwatch_reporter_default_formatter<Stopwatch>::type>
+ class wstopwatch_reporter;
+
+ template <class Stopwatch, class Formatter>
+ struct wstopwatch_reporter_default_formatter<wstopwatch_reporter<Stopwatch, Formatter> > {
+ typedef Formatter type;
+ };
+
+
+ template <class Stopwatch, class Formatter>
+ class wstopwatch_reporter : public basic_stopwatch_reporter<Stopwatch,Formatter> {
+ typedef basic_stopwatch_reporter<Stopwatch,Formatter> base_type;
+ public:
+ typedef typename Stopwatch::clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+ typedef typename Formatter::string_type string_type;
+ typedef typename Formatter::char_type char_type;
+ typedef typename Formatter::ostream_type ostream_type;
+
+ explicit wstopwatch_reporter( system::error_code & ec = system::throws )
+ : base_type(ec) { }
+ explicit wstopwatch_reporter( ostream_type & os,
+ system::error_code & ec = system::throws )
+ : base_type(os, ec) { }
+
+ explicit wstopwatch_reporter( const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(format, ec) { }
+
+ explicit wstopwatch_reporter( int places,
+ system::error_code & ec = system::throws )
+ : base_type(places, ec) { }
+
+ wstopwatch_reporter( ostream_type & os, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, ec) { }
+
+ wstopwatch_reporter( const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(format, places, ec) { }
+
+ wstopwatch_reporter( ostream_type & os, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, ec) { }
+
+ wstopwatch_reporter( int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(places, format, ec) { }
+
+ wstopwatch_reporter( ostream_type & os, const string_type & format, int places,
+ system::error_code & ec = system::throws )
+ : base_type(os, format, places, ec) { }
+
+ wstopwatch_reporter( ostream_type & os, int places, const string_type & format,
+ system::error_code & ec = system::throws )
+ : base_type(os, places, format, ec) { }
+
+ typedef stopwatch_runner<wstopwatch_reporter<Stopwatch,Formatter> > scoped_run;
+ typedef stopwatch_stopper<wstopwatch_reporter<Stopwatch,Formatter> > scoped_stop;
+ typedef stopwatch_suspender<wstopwatch_reporter<Stopwatch,Formatter> > scoped_suspend;
+ typedef stopwatch_resumer<wstopwatch_reporter<Stopwatch,Formatter> > scoped_resume;
+
+ protected:
+
+ //wstopwatch_reporter(); // = delete;
+ wstopwatch_reporter(const wstopwatch_reporter&); // = delete;
+ wstopwatch_reporter& operator=(const wstopwatch_reporter&); // = delete;
+ };
+
   } // namespace chrono
 } // namespace boost
 


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