Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59261 - sandbox/chrono/boost/chrono
From: vicente.botet_at_[hidden]
Date: 2010-01-24 18:53:23


Author: viboes
Date: 2010-01-24 18:53:22 EST (Sun, 24 Jan 2010)
New Revision: 59261
URL: http://svn.boost.org/trac/boost/changeset/59261

Log:
Boost.Chrono: Version 0.3.2,
* code cleanup
* added get_reporter metafunction on stopwatch_accumulator
* fix compiler bug in suspendible_clock.hpp
* specialize stopwatch_reporter_default_formatter for stopwatch<suspendible_clock<process_cpu_clock> >
Text files modified:
   sandbox/chrono/boost/chrono/stopwatch.hpp | 2 +-
   sandbox/chrono/boost/chrono/stopwatch_accumulator.hpp | 4 ++++
   sandbox/chrono/boost/chrono/suspendible_clock.hpp | 10 +++-------
   sandbox/chrono/boost/chrono/time_formatter.hpp | 6 ++++++
   4 files changed, 14 insertions(+), 8 deletions(-)

Modified: sandbox/chrono/boost/chrono/stopwatch.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatch.hpp (original)
+++ sandbox/chrono/boost/chrono/stopwatch.hpp 2010-01-24 18:53:22 EST (Sun, 24 Jan 2010)
@@ -164,7 +164,7 @@
         typedef stopwatch_stopper<stopwatch<Clock> > scoped_stop;
         typedef stopwatch_suspender<stopwatch<Clock> > scoped_suspend;
         typedef stopwatch_resumer<stopwatch<Clock> > scoped_resume;
- template <class Formatter=typename stopwatch_reporter_default_formatter<stopwatch<Clock> >::type>
+ template <class Formatter=typename stopwatch_reporter_default_formatter<stopwatch<Clock> >::type>
         struct get_reporter {
             typedef stopwatch_reporter<stopwatch<Clock>,Formatter > type;
         };

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-24 18:53:22 EST (Sun, 24 Jan 2010)
@@ -189,6 +189,10 @@
         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>
+ struct get_reporter {
+ typedef stopwatch_reporter<stopwatch_accumulator,Formatter > type;
+ };
         typedef stopwatch_reporter<stopwatch_accumulator<Clock> > reporter;
     private:
         bool running_;

Modified: sandbox/chrono/boost/chrono/suspendible_clock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/suspendible_clock.hpp (original)
+++ sandbox/chrono/boost/chrono/suspendible_clock.hpp 2010-01-24 18:53:22 EST (Sun, 24 Jan 2010)
@@ -20,7 +20,7 @@
 
 namespace boost { namespace chrono {
 
- template < class Clock >
+ template < class Clock=high_resolution_clock >
     class suspendible_clock {
     public:
         typedef typename Clock::duration duration;
@@ -140,18 +140,14 @@
     template < class Clock >
     thread_specific_ptr<typename suspendible_clock<Clock>::thread_specific_context> suspendible_clock<Clock>::ptr_;
 
-
-
     template <class Clock>
     struct is_suspendible<suspendible_clock<Clock> > : mpl:: true_ {};
 
-
-
     template <class Clock>
     class scoped_suspend<suspendible_clock<Clock> >
         : public suspendible_clock<Clock>::scoped_suspend {
     public:
- scoped_suspend(system::error_code & ec = system::throws) : Clock::scoped_suspend(ec) {}
+ scoped_suspend(system::error_code & ec = system::throws) : suspendible_clock<Clock>::scoped_suspend(ec) {}
     private:
         scoped_suspend(); // = delete;
         scoped_suspend(const scoped_suspend&); // = delete;
@@ -163,4 +159,4 @@
 
 #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
 
-#endif // BOOST_CHRONO_PROCESS_CPU_CLOCKS_HPP
+#endif // BOOST_CHRONO_SUSPENDIBLE_CLOCK_HPP

Modified: sandbox/chrono/boost/chrono/time_formatter.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/time_formatter.hpp (original)
+++ sandbox/chrono/boost/chrono/time_formatter.hpp 2010-01-24 18:53:22 EST (Sun, 24 Jan 2010)
@@ -15,6 +15,7 @@
 #include <boost/current_function.hpp>
 #include <boost/chrono/detail/default_out.hpp>
 #include <boost/chrono/detail/adaptive_string.hpp>
+#include <boost/chrono/suspendible_clock.hpp>
 #include <boost/system/error_code.hpp>
 #include <boost/cstdint.hpp>
 #include <string>
@@ -162,6 +163,11 @@
         typedef time_formatter type;
     };
 
+ template <>
+ struct stopwatch_reporter_default_formatter<stopwatch<suspendible_clock<process_cpu_clock> > > {
+ typedef stopwatch_reporter_default_formatter<stopwatch<process_cpu_clock> >::type type;
+ };
+
   } // 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