Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59096 - in sandbox/chrono/boost/chrono: . typeof typeof/boost typeof/boost/chrono
From: vicente.botet_at_[hidden]
Date: 2010-01-17 13:45:08


Author: viboes
Date: 2010-01-17 13:45:07 EST (Sun, 17 Jan 2010)
New Revision: 59096
URL: http://svn.boost.org/trac/boost/changeset/59096

Log:
Boost.Chrono: Version 0.3.0,
* Added typeof registration for duration and time_point
* Add typedef to name the parameters of stopclocks
Added:
   sandbox/chrono/boost/chrono/typeof/
   sandbox/chrono/boost/chrono/typeof/boost/
   sandbox/chrono/boost/chrono/typeof/boost/chrono/
   sandbox/chrono/boost/chrono/typeof/boost/chrono/chrono.hpp (contents, props changed)
   sandbox/chrono/boost/chrono/typeof/boost/ratio.hpp (contents, props changed)
Text files modified:
   sandbox/chrono/boost/chrono/chrono.hpp | 4 +---
   sandbox/chrono/boost/chrono/function_stopclock.hpp | 4 ++++
   sandbox/chrono/boost/chrono/stopclock.hpp | 4 ++++
   sandbox/chrono/boost/chrono/stopwatch_reporter.hpp | 4 ++++
   sandbox/chrono/boost/chrono/stopwatch_scoped.hpp | 18 +++++++++---------
   5 files changed, 22 insertions(+), 12 deletions(-)

Modified: sandbox/chrono/boost/chrono/chrono.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/chrono.hpp (original)
+++ sandbox/chrono/boost/chrono/chrono.hpp 2010-01-17 13:45:07 EST (Sun, 17 Jan 2010)
@@ -97,9 +97,7 @@
 #define BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) \
     BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
 #elif defined(BOOST_CHRONO_USES_ARRAY_ASSERT)
-#define BOOST_CHRONO_CONCAT(A,B) A##B
-#define BOOST_CHRONO_NAME(A,B) BOOST_CHRONO_CONCAT(A,B)
-#define BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_CHRONO_NAME(__boost_chrono_test_,__LINE__)[CND];
+#define BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES) static char BOOST_JOIN(__boost_chrono_test_,__LINE__)[CND];
 #else
 #define BOOST_CHRONO_STATIC_ASSERT(CND, MSG, TYPES)
 #endif

Modified: sandbox/chrono/boost/chrono/function_stopclock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/function_stopclock.hpp (original)
+++ sandbox/chrono/boost/chrono/function_stopclock.hpp 2010-01-17 13:45:07 EST (Sun, 17 Jan 2010)
@@ -43,6 +43,10 @@
     class function_stopclock : public stopwatch_reporter<Stopwatch, Formatter> {
         typedef stopwatch_reporter<Stopwatch, Formatter> base_type;
     public:
+ typedef Clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+
         explicit function_stopclock( const std::string& func, system::error_code & ec = system::throws )
         : base_type(ec), func_(func)
         { begin(); }

Modified: sandbox/chrono/boost/chrono/stopclock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopclock.hpp (original)
+++ sandbox/chrono/boost/chrono/stopclock.hpp 2010-01-17 13:45:07 EST (Sun, 17 Jan 2010)
@@ -43,6 +43,10 @@
     class stopclock : public stopwatch_reporter<Stopwatch, Formatter> {
         typedef stopwatch_reporter<Stopwatch, Formatter> base_type;
     public:
+ typedef Clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+
         explicit stopclock( system::error_code & ec = system::throws )
         : base_type(ec) { }
         explicit stopclock( std::ostream & os,

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-17 13:45:07 EST (Sun, 17 Jan 2010)
@@ -82,6 +82,10 @@
     template <class Stopwatch, class Formatter>
     class stopwatch_reporter : public Stopwatch {
     public:
+ typedef typename Stopwatch::clock clock;
+ typedef Stopwatch stopwatch;
+ typedef Formatter formatter;
+
         explicit 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( std::ostream & os,

Modified: sandbox/chrono/boost/chrono/stopwatch_scoped.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatch_scoped.hpp (original)
+++ sandbox/chrono/boost/chrono/stopwatch_scoped.hpp 2010-01-17 13:45:07 EST (Sun, 17 Jan 2010)
@@ -23,8 +23,8 @@
 //--------------------------------------------------------------------------------------//
     template <class Stopwatch> class stopwatch_runner {
     public:
- typedef Stopwatch stopwatch_type;
- stopwatch_runner(stopwatch_type & a, system::error_code & ec = system::throws)
+ typedef Stopwatch stopwatch;
+ stopwatch_runner(stopwatch & a, system::error_code & ec = system::throws)
         : stopwatch_(a) {
             stopwatch_.start(ec);
         }
@@ -39,7 +39,7 @@
         }
 #endif
     private:
- stopwatch_type& stopwatch_;
+ stopwatch& stopwatch_;
         stopwatch_runner();//= delete;
         stopwatch_runner(const stopwatch_runner&); // = delete;
         stopwatch_runner& operator=(const stopwatch_runner&); // = delete;
@@ -49,8 +49,8 @@
 //--------------------------------------------------------------------------------------//
     template <class Stopwatch> class stopwatch_suspender {
     public:
- typedef Stopwatch stopwatch_type;
- stopwatch_suspender(stopwatch_type & a, system::error_code & ec = system::throws)
+ typedef Stopwatch stopwatch;
+ stopwatch_suspender(stopwatch & a, system::error_code & ec = system::throws)
         : stopwatch_(a) {
             stopwatch_.suspend(ec);
         }
@@ -59,7 +59,7 @@
             stopwatch_.resume(ec);
         }
     private:
- stopwatch_type& stopwatch_;
+ stopwatch& stopwatch_;
         stopwatch_suspender(); // = delete;
         stopwatch_suspender(const stopwatch_suspender&); // = delete;
         stopwatch_suspender& operator=(const stopwatch_suspender&); // = delete;
@@ -68,8 +68,8 @@
 //--------------------------------------------------------------------------------------//
     template <class Stopwatch> class stopwatch_resumer {
     public:
- typedef Stopwatch stopwatch_type;
- stopwatch_resumer(stopwatch_type & a, system::error_code & ec = system::throws)
+ typedef Stopwatch stopwatch;
+ stopwatch_resumer(stopwatch & a, system::error_code & ec = system::throws)
         : stopwatch_(a) {
             stopwatch_.resume(ec);
         }
@@ -78,7 +78,7 @@
             stopwatch_.suspend(ec);
         }
     private:
- stopwatch_type& stopwatch_;
+ stopwatch& stopwatch_;
         stopwatch_resumer(); // = delete;
         stopwatch_resumer(const stopwatch_resumer&); // = delete;
         stopwatch_resumer& operator=(const stopwatch_resumer&); // = delete;

Added: sandbox/chrono/boost/chrono/typeof/boost/chrono/chrono.hpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/boost/chrono/typeof/boost/chrono/chrono.hpp 2010-01-17 13:45:07 EST (Sun, 17 Jan 2010)
@@ -0,0 +1,32 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 20010.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// Based on the unique_threader/unique_joiner design from of Kevlin Henney (n1883)
+//
+// See http://www.boost.org/libs/chrono for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CHRONO_TYPEOF_RATIO__HPP
+#define BOOST_CHRONO_TYPEOF_RATIO__HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/typeof/typeof.hpp>
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::chrono::duration, (typename)(typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::chrono::time_point, (typename)(typename))
+#if 0
+BOOST_TYPEOF_REGISTER_TYPE(boost::chrono::system_clock)
+#ifdef BOOST_CHRONO_HAS_CLOCK_MONOTONIC
+BOOST_TYPEOF_REGISTER_TYPE(boost::chrono::monotonic_clock)
+#endif
+BOOST_TYPEOF_REGISTER_TYPE(boost::chrono::high_resolution_clock)
+
+#endif
+#endif

Added: sandbox/chrono/boost/chrono/typeof/boost/ratio.hpp
==============================================================================
--- (empty file)
+++ sandbox/chrono/boost/chrono/typeof/boost/ratio.hpp 2010-01-17 13:45:07 EST (Sun, 17 Jan 2010)
@@ -0,0 +1,24 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Vicente J. Botet Escriba 20010.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or
+// copy at http://www.boost.org/LICENSE_1_0.txt)
+//
+// Based on the unique_threader/unique_joiner design from of Kevlin Henney (n1883)
+//
+// See http://www.boost.org/libs/chrono for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CHRONO_TYPEOF_RATIO__HPP
+#define BOOST_CHRONO_TYPEOF_RATIO__HPP
+
+#include <boost/ratio.hpp>
+#include <boost/typeof/typeof.hpp>
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TEMPLATE(boost::ratio, (boost::intmax_t)(boost::intmax_t))
+
+#endif


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