|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59368 - sandbox/chrono/boost/chrono
From: vicente.botet_at_[hidden]
Date: 2010-01-30 07:50:42
Author: viboes
Date: 2010-01-30 07:50:41 EST (Sat, 30 Jan 2010)
New Revision: 59368
URL: http://svn.boost.org/trac/boost/changeset/59368
Log:
Boost.Chrono: Version 0.4.0,
* rename digital_time by 24_hours
Added:
sandbox/chrono/boost/chrono/t24_hours.hpp
- copied, changed from r59070, /sandbox/chrono/boost/chrono/digital_time.hpp
sandbox/chrono/boost/chrono/t24_hours_formatter.hpp
- copied, changed from r59260, /sandbox/chrono/boost/chrono/digital_time_formatter.hpp
Removed:
sandbox/chrono/boost/chrono/digital_time.hpp
sandbox/chrono/boost/chrono/digital_time_formatter.hpp
Text files modified:
sandbox/chrono/boost/chrono/stopwatches.hpp | 4 +-
sandbox/chrono/boost/chrono/t24_hours.hpp | 10 ++++----
sandbox/chrono/boost/chrono/t24_hours_formatter.hpp | 46 ++++++++++++++++++++--------------------
3 files changed, 30 insertions(+), 30 deletions(-)
Deleted: sandbox/chrono/boost/chrono/digital_time.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/digital_time.hpp 2010-01-30 07:50:41 EST (Sat, 30 Jan 2010)
+++ (empty file)
@@ -1,72 +0,0 @@
-// boost/chrono/digital_time.hpp -----------------------------------------------------------//
-
-// Copyright 2010 Vicente J. Botet Escriba
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// See http://www.boost.org/libs/system for documentation.
-
-#ifndef BOOST_CHRONO_DIGITAL_TIME_HPP
-#define BOOST_CHRONO_DIGITAL_TIME_HPP
-
-#include <boost/chrono/chrono.hpp>
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-namespace boost { namespace chrono {
-
-class digital_time {
- typedef boost::chrono::duration<boost::int_least32_t, ratio<24*3600> > days;
- typedef boost::chrono::hours hours;
- typedef boost::chrono::minutes minutes;
- typedef boost::chrono::seconds seconds;
- typedef boost::chrono::nanoseconds nanoseconds;
-public:
- days days_;
- hours hours_;
- minutes minutes_;
- seconds seconds_;
- nanoseconds nanoseconds_;
-
- template <class Rep, class Period>
- static days get_days(const boost::chrono::duration<Rep, Period>& d) {
- return boost::chrono::duration_cast<days>(d);
- };
-
- template <class Rep, class Period>
- static hours get_hours(const boost::chrono::duration<Rep, Period>& d) {
- return boost::chrono::duration_cast<hours>(d % days(1));
- };
-
- template <class Rep, class Period>
- static minutes get_minutes(const boost::chrono::duration<Rep, Period>& d) {
- return boost::chrono::duration_cast<minutes>(d % hours(1));
- };
-
- template <class Rep, class Period>
- static seconds get_seconds(const boost::chrono::duration<Rep, Period>& d) {
- return boost::chrono::duration_cast<seconds>(d % minutes(1));
- };
-
- template <class Rep, class Period>
- static nanoseconds get_nanoseconds(const boost::chrono::duration<Rep, Period>& d) {
- return boost::chrono::duration_cast<nanoseconds>(d % seconds(1));
- };
-
- template <class Rep, class Period>
- explicit digital_time(const boost::chrono::duration<Rep, Period>& d)
- : days_ (get_days(d))
- , hours_ (get_hours(d))
- , minutes_ (get_minutes(d))
- , seconds_ (get_seconds(d))
- , nanoseconds_ (get_nanoseconds(d))
- {}
-};
-
-} // namespace chrono
-} // namespace boost
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-
-#endif // BOOST_CHRONO_PROCESS_CLOCK_HPP
Deleted: sandbox/chrono/boost/chrono/digital_time_formatter.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/digital_time_formatter.hpp 2010-01-30 07:50:41 EST (Sat, 30 Jan 2010)
+++ (empty file)
@@ -1,166 +0,0 @@
-// boost/chrono/digital_time_formatter.hpp ------------------------------------------------------------//
-
-// Copyright 2010 Vicente J. Botet Escriba
-
-// 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)
-
-// See http://www.boost.org/libs/system for documentation.
-
-#ifndef BOOST_CHRONO_DIGITAL_TIME_FORMATTER_HPP
-#define BOOST_CHRONO_DIGITAL_TIME_FORMATTER_HPP
-
-#include <boost/chrono/chrono.hpp>
-#include <boost/chrono/digital_time.hpp>
-#include <boost/current_function.hpp>
-#include <boost/chrono/detail/default_out.hpp>
-#include <boost/chrono/detail/adaptive_string.hpp>
-#include <boost/system/error_code.hpp>
-#include <boost/cstdint.hpp>
-#include <string>
-#include <iostream>
-#include <boost/io/ios_state.hpp>
-#include <cstring>
-#include <cassert>
-
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-
-#define BOOST_CHRONO_DIGITAL_TIME_FORMAT_DEFAULT "%d day(s) %h:%m:%s.%n\n"
-
-namespace boost { namespace chrono {
-
-//--------------------------------------------------------------------------------------//
-//--------------------------------------------------------------------------------------//
-
-
- template <
- typename CharT=char,
- typename Traits=std::char_traits<CharT>,
- class Alloc=std::allocator<CharT>
- >
- class basic_digital_time_formatter {
- public:
-
- typedef std::basic_string<CharT,Traits,Alloc> string_type;
- typedef CharT char_type;
- typedef std::basic_ostream<CharT,Traits> ostream_type;
-
- static ostream_type & default_os();
- static const char_type* default_format();
- static string_type format(const char_type* s) {
- string_type res(s);
- res += boost::chrono::detail::adaptive_string(" : ");
- res += default_format();
- //res += boost::chrono::detail::adaptive_string(" tokes %d day(s) %h:%m:%s.%n\n");
- return res;
- }
- static int default_places() { return 3; }
-
- template <class Stopwatch >
- static void show_time( Stopwatch & stopwatch_
- , const char_type* format, int places, ostream_type & os
- , system::error_code & ec)
- // NOTE WELL: Will truncate least-significant digits to LDBL_DIG, which may
- // be as low as 10, although will be 15 for many common platforms.
- {
- typedef typename Stopwatch::duration duration_t;
- duration_t d = stopwatch_.elapsed( ec );
-
- 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( places );
-
- digital_time dt(d);
- for ( ; *format; ++format ) {
- if ( *format != '%' || !*(format+1) || !std::strchr("dhmsn", *(format+1)) ) {
- os << *format;
- } else {
- ++format;
- switch ( *format ) {
- case 'd':
- os << dt.days_.count();
- break;
- case 'h':
- {
- boost::io::ios_flags_saver ifs( os );
- os.width(2); os.fill('0');
- os << dt.hours_.count();
- break;
- }
- case 'm':
- {
- boost::io::ios_flags_saver ifs( os );
- os.width(2); os.fill('0');
- os << dt.minutes_.count();
- break;
- }
- case 's':
- {
- boost::io::ios_flags_saver ifs( os );
- os.width(2); os.fill('0');
- os << dt.seconds_.count();
- break;
- }
- case 'n':
- {
- boost::io::ios_flags_saver ifs( os );
- os.width(9); os.fill('0');
- os << dt.nanoseconds_.count();
- break;
- }
- default:
- assert(0 && "digital_time_formatter internal logic error");
- }
- }
- }
- }
- };
-
-namespace detail {
- template <typename CharT>
- struct basic_digital_time_formatter_default_format;
- template <>
- struct basic_digital_time_formatter_default_format<char> {
- static const char* apply() {return BOOST_CHRONO_DIGITAL_TIME_FORMAT_DEFAULT; }
- };
-#ifndef BOOST_NO_STD_WSTRING
- template <>
- struct basic_digital_time_formatter_default_format<wchar_t> {
- static const wchar_t* apply() {return L"%d day(s) %h:%m:%s.%n\n"; }
- };
-
-#endif
-}
-
- template <typename CharT,typename Traits, class Alloc>
- const typename basic_digital_time_formatter<CharT,Traits,Alloc>::char_type*
- basic_digital_time_formatter<CharT,Traits,Alloc>::default_format() {
- return detail::basic_digital_time_formatter_default_format<CharT>::apply();
- }
-
- template <typename CharT,typename Traits, class Alloc>
- typename basic_digital_time_formatter<CharT,Traits,Alloc>::ostream_type &
- basic_digital_time_formatter<CharT,Traits,Alloc>::default_os() {
- return detail::default_out<CharT,Traits>::apply();
- }
-
- typedef basic_digital_time_formatter<char> digital_time_formatter;
- typedef basic_digital_time_formatter<wchar_t> wdigital_time_formatter;
-
- } // namespace chrono
-} // namespace boost
-
-#define BOOST_CHRONO_DIGITAL_TIME_FORMAT(F) boost::chrono::detail::adaptive_string(F " : " BOOST_CHRONO_DIGITAL_TIME_FORMAT_DEFAULT)
-#ifdef __GNUC__
-#define BOOST_CHRONO_DIGITAL_TIME_FUNCTION_FORMAT boost::chrono::digital_time_formatter::format(BOOST_CURRENT_FUNCTION)
-#else
-#define BOOST_CHRONO_DIGITAL_TIME_FUNCTION_FORMAT BOOST_CHRONO_DIGITAL_TIME_FORMAT(BOOST_CURRENT_FUNCTION)
-#endif
-
-
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-
-#endif // BOOST_CHRONO_DIGITAL_TIME_FORMATTER_HPP
Modified: sandbox/chrono/boost/chrono/stopwatches.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/stopwatches.hpp (original)
+++ sandbox/chrono/boost/chrono/stopwatches.hpp 2010-01-30 07:50:41 EST (Sat, 30 Jan 2010)
@@ -14,8 +14,8 @@
#define BOOST_CHRONO_STOPWATCHES__HPP
//-----------------------------------------------------------------------------
-#include <boost/chrono/digital_time.hpp>
-#include <boost/chrono/digital_time_formatter.hpp>
+#include <boost/chrono/t24_hours.hpp>
+#include <boost/chrono/t24_hours_formatter.hpp>
#include <boost/chrono/scoped_stopclock.hpp>
#include <boost/chrono/process_cpu_clocks.hpp>
#include <boost/chrono/stopclock.hpp>
Copied: sandbox/chrono/boost/chrono/t24_hours.hpp (from r59070, /sandbox/chrono/boost/chrono/digital_time.hpp)
==============================================================================
--- /sandbox/chrono/boost/chrono/digital_time.hpp (original)
+++ sandbox/chrono/boost/chrono/t24_hours.hpp 2010-01-30 07:50:41 EST (Sat, 30 Jan 2010)
@@ -1,4 +1,4 @@
-// boost/chrono/digital_time.hpp -----------------------------------------------------------//
+// boost/chrono/t24_hours.hpp -----------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
@@ -7,8 +7,8 @@
// See http://www.boost.org/libs/system for documentation.
-#ifndef BOOST_CHRONO_DIGITAL_TIME_HPP
-#define BOOST_CHRONO_DIGITAL_TIME_HPP
+#ifndef BOOST_CHRONO_T24_HOURS_HPP
+#define BOOST_CHRONO_T24_HOURS_HPP
#include <boost/chrono/chrono.hpp>
@@ -16,7 +16,7 @@
namespace boost { namespace chrono {
-class digital_time {
+class t24_hours {
typedef boost::chrono::duration<boost::int_least32_t, ratio<24*3600> > days;
typedef boost::chrono::hours hours;
typedef boost::chrono::minutes minutes;
@@ -55,7 +55,7 @@
};
template <class Rep, class Period>
- explicit digital_time(const boost::chrono::duration<Rep, Period>& d)
+ explicit t24_hours(const boost::chrono::duration<Rep, Period>& d)
: days_ (get_days(d))
, hours_ (get_hours(d))
, minutes_ (get_minutes(d))
Copied: sandbox/chrono/boost/chrono/t24_hours_formatter.hpp (from r59260, /sandbox/chrono/boost/chrono/digital_time_formatter.hpp)
==============================================================================
--- /sandbox/chrono/boost/chrono/digital_time_formatter.hpp (original)
+++ sandbox/chrono/boost/chrono/t24_hours_formatter.hpp 2010-01-30 07:50:41 EST (Sat, 30 Jan 2010)
@@ -1,4 +1,4 @@
-// boost/chrono/digital_time_formatter.hpp ------------------------------------------------------------//
+// boost/chrono/t24_hours_formatter.hpp ------------------------------------------------------------//
// Copyright 2010 Vicente J. Botet Escriba
@@ -7,11 +7,11 @@
// See http://www.boost.org/libs/system for documentation.
-#ifndef BOOST_CHRONO_DIGITAL_TIME_FORMATTER_HPP
-#define BOOST_CHRONO_DIGITAL_TIME_FORMATTER_HPP
+#ifndef BOOST_CHRONO_T24_HOURS_FORMATTER_HPP
+#define BOOST_CHRONO_T24_HOURS_FORMATTER_HPP
#include <boost/chrono/chrono.hpp>
-#include <boost/chrono/digital_time.hpp>
+#include <boost/chrono/t24_hours.hpp>
#include <boost/current_function.hpp>
#include <boost/chrono/detail/default_out.hpp>
#include <boost/chrono/detail/adaptive_string.hpp>
@@ -25,7 +25,7 @@
#include <boost/config/abi_prefix.hpp> // must be the last #include
-#define BOOST_CHRONO_DIGITAL_TIME_FORMAT_DEFAULT "%d day(s) %h:%m:%s.%n\n"
+#define BOOST_CHRONO_24_HOURS_FORMAT_DEFAULT "%d day(s) %h:%m:%s.%n\n"
namespace boost { namespace chrono {
@@ -38,7 +38,7 @@
typename Traits=std::char_traits<CharT>,
class Alloc=std::allocator<CharT>
>
- class basic_digital_time_formatter {
+ class basic_24_hours_formatter {
public:
typedef std::basic_string<CharT,Traits,Alloc> string_type;
@@ -73,7 +73,7 @@
boost::io::ios_precision_saver ips( os );
os.precision( places );
- digital_time dt(d);
+ t24_hours dt(d);
for ( ; *format; ++format ) {
if ( *format != '%' || !*(format+1) || !std::strchr("dhmsn", *(format+1)) ) {
os << *format;
@@ -112,7 +112,7 @@
break;
}
default:
- assert(0 && "digital_time_formatter internal logic error");
+ assert(0 && "basic_24_hours_formatter internal logic error");
}
}
}
@@ -121,14 +121,14 @@
namespace detail {
template <typename CharT>
- struct basic_digital_time_formatter_default_format;
+ struct basic_24_hours_formatter_default_format;
template <>
- struct basic_digital_time_formatter_default_format<char> {
- static const char* apply() {return BOOST_CHRONO_DIGITAL_TIME_FORMAT_DEFAULT; }
+ struct basic_24_hours_formatter_default_format<char> {
+ static const char* apply() {return BOOST_CHRONO_24_HOURS_FORMAT_DEFAULT; }
};
#ifndef BOOST_NO_STD_WSTRING
template <>
- struct basic_digital_time_formatter_default_format<wchar_t> {
+ struct basic_24_hours_formatter_default_format<wchar_t> {
static const wchar_t* apply() {return L"%d day(s) %h:%m:%s.%n\n"; }
};
@@ -136,31 +136,31 @@
}
template <typename CharT,typename Traits, class Alloc>
- const typename basic_digital_time_formatter<CharT,Traits,Alloc>::char_type*
- basic_digital_time_formatter<CharT,Traits,Alloc>::default_format() {
- return detail::basic_digital_time_formatter_default_format<CharT>::apply();
+ const typename basic_24_hours_formatter<CharT,Traits,Alloc>::char_type*
+ basic_24_hours_formatter<CharT,Traits,Alloc>::default_format() {
+ return detail::basic_24_hours_formatter_default_format<CharT>::apply();
}
template <typename CharT,typename Traits, class Alloc>
- typename basic_digital_time_formatter<CharT,Traits,Alloc>::ostream_type &
- basic_digital_time_formatter<CharT,Traits,Alloc>::default_os() {
+ typename basic_24_hours_formatter<CharT,Traits,Alloc>::ostream_type &
+ basic_24_hours_formatter<CharT,Traits,Alloc>::default_os() {
return detail::default_out<CharT,Traits>::apply();
}
- typedef basic_digital_time_formatter<char> digital_time_formatter;
- typedef basic_digital_time_formatter<wchar_t> wdigital_time_formatter;
+ typedef basic_24_hours_formatter<char> t24_hours_formatter;
+ typedef basic_24_hours_formatter<wchar_t> wt24_hours_formatter;
} // namespace chrono
} // namespace boost
-#define BOOST_CHRONO_DIGITAL_TIME_FORMAT(F) boost::chrono::detail::adaptive_string(F " : " BOOST_CHRONO_DIGITAL_TIME_FORMAT_DEFAULT)
+#define BOOST_CHRONO_24_HOURS_FORMAT(F) boost::chrono::detail::adaptive_string(F " : " BOOST_CHRONO_24_HOURS_FORMAT_DEFAULT)
#ifdef __GNUC__
-#define BOOST_CHRONO_DIGITAL_TIME_FUNCTION_FORMAT boost::chrono::digital_time_formatter::format(BOOST_CURRENT_FUNCTION)
+#define BOOST_CHRONO_24_HOURS_FUNCTION_FORMAT boost::chrono::t24_hours_formatter::format(BOOST_CURRENT_FUNCTION)
#else
-#define BOOST_CHRONO_DIGITAL_TIME_FUNCTION_FORMAT BOOST_CHRONO_DIGITAL_TIME_FORMAT(BOOST_CURRENT_FUNCTION)
+#define BOOST_CHRONO_24_HOURS_FUNCTION_FORMAT BOOST_CHRONO_24_HOURS_FORMAT(BOOST_CURRENT_FUNCTION)
#endif
#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#endif // BOOST_CHRONO_DIGITAL_TIME_FORMATTER_HPP
+#endif // BOOST_CHRONO_T24_HOURS_FORMATTER_HPP
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