Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74798 - in branches/release: boost/chrono boost/chrono/detail/inlined boost/chrono/detail/inlined/mac boost/chrono/detail/inlined/posix boost/chrono/detail/inlined/win libs/chrono/example libs/chrono/src
From: vicente.botet_at_[hidden]
Date: 2011-10-08 08:11:58


Author: viboes
Date: 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
New Revision: 74798
URL: http://svn.boost.org/trac/boost/changeset/74798

Log:
Chrono: Merge #5977
Added:
   branches/release/libs/chrono/example/timer.hpp (contents, props changed)
Removed:
   branches/release/boost/chrono/detail/inlined/mac/process_clock.hpp
   branches/release/boost/chrono/detail/inlined/posix/process_clock.hpp
   branches/release/boost/chrono/detail/inlined/process_clock.hpp
   branches/release/boost/chrono/detail/inlined/run_timer.hpp
   branches/release/boost/chrono/detail/inlined/run_timer_static.hpp
   branches/release/boost/chrono/detail/inlined/win/process_clock.hpp
   branches/release/boost/chrono/process_times.hpp
   branches/release/boost/chrono/timer.hpp
   branches/release/libs/chrono/src/process_clock.cpp
   branches/release/libs/chrono/src/run_timer.cpp
   branches/release/libs/chrono/src/run_timer_static.cpp
Text files modified:
   branches/release/libs/chrono/example/chrono_accuracy_test.cpp | 2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)

Deleted: branches/release/boost/chrono/detail/inlined/mac/process_clock.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/mac/process_clock.hpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
+++ (empty file)
@@ -1,104 +0,0 @@
-// boost process_timer.cpp -----------------------------------------------------------//
-
-// Copyright Beman Dawes 1994, 2006, 2008
-// Copyright 2009 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/chrono for documentation.
-
-//--------------------------------------------------------------------------------------//
-
-#include <boost/chrono/config.hpp>
-#include <boost/chrono/process_times.hpp>
-#include <boost/assert.hpp>
-
-#include <sys/time.h> //for gettimeofday and timeval
-#include <sys/times.h> //for times
-# include <unistd.h>
-
-namespace boost
-{
-namespace chrono
-{
-namespace chrono_detail
-{
- inline long tick_factor() // multiplier to convert ticks
- // to nanoseconds; -1 if unknown
- {
- static long factor = 0;
- if ( !factor )
- {
- if ( (factor = ::sysconf( _SC_CLK_TCK )) <= 0 )
- {
- factor = -1;
- }
- else
- {
- BOOST_ASSERT( factor <= 1000000l ); // doesn't handle large ticks
- factor = 1000000l / factor; // compute factor
- if ( !factor ) factor = -1;
- }
- }
- return factor;
- }
-}
-
- void process_clock::now( process_times & times_, system::error_code & ec )
- {
-
- tms tm;
- clock_t c = ::times( &tm );
- if ( c == -1 ) // error
- {
- if (BOOST_CHRONO_IS_THROWS(ec))
- {
- boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::process_clock" ));
- }
- else
- {
- ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
- times_.real = times_.system = times_.user = nanoseconds(-1);
- }
- }
- else
- {
- times_.real = microseconds(c);
- times_.system = microseconds(tm.tms_stime + tm.tms_cstime);
- times_.user = microseconds(tm.tms_utime + tm.tms_cutime);
- if ( chrono_detail::tick_factor() != -1 )
- {
- times_.real *= chrono_detail::tick_factor();
- times_.user *= chrono_detail::tick_factor();
- times_.system *= chrono_detail::tick_factor();
- if (!BOOST_CHRONO_IS_THROWS(ec))
- {
- ec.clear();
- }
- }
- else
- {
- if (BOOST_CHRONO_IS_THROWS(ec))
- {
- boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::process_clock" ));
- }
- else
- {
- ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
- times_.real = times_.user = times_.system = nanoseconds(-1);
- }
- }
- }
-
-}
-} // namespace chrono
-} // namespace boost

Deleted: branches/release/boost/chrono/detail/inlined/posix/process_clock.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/posix/process_clock.hpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
+++ (empty file)
@@ -1,97 +0,0 @@
-// boost process_timer.cpp -----------------------------------------------------------//
-
-// Copyright Beman Dawes 1994, 2006, 2008
-// Copyright Vicente J. Botet Escriba 2009
-
-// Distributed under the Boost Software License, Version 1.0.
-// See http://www.boost.org/LICENSE_1_0.txt
-
-// See http://www.boost.org/libs/chrono for documentation.
-
-//--------------------------------------------------------------------------------------//
-
-#include <boost/chrono/config.hpp>
-#include <boost/chrono/process_times.hpp>
-#include <boost/assert.hpp>
-
-# include <sys/times.h>
-# include <unistd.h>
-
-
-namespace boost { namespace chrono {
-namespace chrono_detail
-{
- inline long tick_factor() // multiplier to convert ticks
- // to nanoseconds; -1 if unknown
- {
- static long factor = 0;
- if ( !factor )
- {
- if ( (factor = ::sysconf( _SC_CLK_TCK )) <= 0 )
- factor = -1;
- else
- {
- BOOST_ASSERT( factor <= 1000000l ); // doesn't handle large ticks
- factor = 1000000l / factor; // compute factor
- if ( !factor ) factor = -1;
- }
- }
- return factor;
- }
-}
-
- void process_clock::now( process_times & times_, system::error_code & ec ) {
-
- tms tm;
- clock_t c = ::times( &tm );
- if ( c == clock_t(-1) ) // error
- {
- if (BOOST_CHRONO_IS_THROWS(ec))
- {
- boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::process_clock" ));
- }
- else
- {
- ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
- times_.real = times_.system = times_.user = nanoseconds(-1);
- }
- }
- else
- {
- times_.real = microseconds(c);
- times_.system = microseconds(tm.tms_stime + tm.tms_cstime);
- times_.user = microseconds(tm.tms_utime + tm.tms_cutime);
- if ( chrono_detail::tick_factor() != -1 )
- {
- if (!BOOST_CHRONO_IS_THROWS(ec))
- {
- ec.clear();
- }
- times_.real *= chrono_detail::tick_factor();
- times_.user *= chrono_detail::tick_factor();
- times_.system *= chrono_detail::tick_factor();
- }
- else
- {
- if (BOOST_CHRONO_IS_THROWS(ec))
- {
- boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::process_clock" ));
- }
- else
- {
- ec.assign( errno, BOOST_CHRONO_SYSTEM_CATEGORY );
- times_.real = times_.user = times_.system = nanoseconds(-1);
- }
- }
- }
-
- }
-} }

Deleted: branches/release/boost/chrono/detail/inlined/process_clock.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/process_clock.hpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
+++ (empty file)
@@ -1,54 +0,0 @@
-// boost process_timer.cpp -----------------------------------------------------------//
-
-// Copyright Beman Dawes 1994, 2006, 2008
-// Copyright 2009 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/chrono for documentation.
-
-//--------------------------------------------------------------------------------------//
-#ifndef BOOST_CHRONO_DETAIL_INLINED_PROCESS_CLOCK_HPP
-#define BOOST_CHRONO_DETAIL_INLINED_PROCESS_CLOCK_HPP
-
-
-#include <boost/chrono/config.hpp>
-#include <boost/version.hpp>
-#include <boost/chrono/process_times.hpp>
-#include <boost/system/system_error.hpp>
-#include <boost/throw_exception.hpp>
-
-//----------------------------------------------------------------------------//
-// Windows //
-//----------------------------------------------------------------------------//
-#if defined(BOOST_CHRONO_WINDOWS_API)
-#include <boost/chrono/detail/inlined/win/process_clock.hpp>
-
-//----------------------------------------------------------------------------//
-// Mac //
-//----------------------------------------------------------------------------//
-#elif defined(BOOST_CHRONO_MAC_API)
-#include <boost/chrono/detail/inlined/mac/process_clock.hpp>
-
-//----------------------------------------------------------------------------//
-// POSIX //
-//----------------------------------------------------------------------------//
-#elif defined(BOOST_CHRONO_POSIX_API)
-#include <boost/chrono/detail/inlined/posix/process_clock.hpp>
-
-#endif // POSIX
-namespace boost { namespace chrono {
-
- void process_clock::now( time_points & tps, system::error_code & ec )
- {
- process_times t;
- process_clock::now(t,ec);
- tps.real=process_clock::time_point(t.real);
- tps.user=process_clock::time_point(t.user);
- tps.system=process_clock::time_point(t.system);
- }
-
-}}
-
-#endif

Deleted: branches/release/boost/chrono/detail/inlined/run_timer.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/run_timer.hpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
+++ (empty file)
@@ -1,193 +0,0 @@
-// boost run_timer.cpp ---------------------------------------------------------------//
-
-// Copyright Beman Dawes 1994, 2006, 2008
-// Copyright 2009-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/chrono for documentation.
-
-//--------------------------------------------------------------------------------------//
-#ifndef BOOST_CHRONO_DETAIL_INLINED_RUN_TIMER_HPP
-#define BOOST_CHRONO_DETAIL_INLINED_RUN_TIMER_HPP
-
-#include <boost/version.hpp>
-#include <boost/chrono/process_times.hpp>
-#include <boost/system/system_error.hpp>
-#include <boost/throw_exception.hpp>
-#include <boost/io/ios_state.hpp>
-#include <cstring>
-#include <boost/assert.hpp>
-
-
-namespace boost
-{
-namespace chrono
-{
-namespace chrono_detail
-{
- BOOST_CHRONO_INLINE
- const char * default_format() {
- return "\nreal %rs, cpu %cs (%p%), user %us, system %ss\n";
- }
-
- BOOST_CHRONO_INLINE
- void show_time( const boost::chrono::process_times & times,
- const char * format, int places, std::ostream & os )
- // 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.
- {
- if ( times.real < nanoseconds(0) ) return;
- if ( places > 9 )
- places = 9; // sanity check
- else if ( places < 0 )
- places = 0;
-
- 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 );
-
- nanoseconds total = times.system + times.user;
-
- for ( ; *format; ++format )
- {
- if ( *format != '%' || !*(format+1) || !std::strchr("rcpus", *(format+1)) )
- os << *format;
- else
- {
- ++format;
- switch ( *format )
- {
- case 'r':
- os << duration<double>(times.real).count();
- break;
- case 'u':
- os << duration<double>(times.user).count();
- break;
- case 's':
- os << duration<double>(times.system).count();
- break;
- case 'c':
- os << duration<double>(total).count();
- break;
- case 'p':
- {
- boost::io::ios_precision_saver ips( os );
- os.precision( 1 );
- if ( times.real.count() && total.count() )
- os << duration<double>(total).count()
- /duration<double>(times.real).count() * 100.0;
- else
- os << 0.0;
- }
- break;
- default:
- BOOST_ASSERT(0 && "run_timer internal logic error");
- }
- }
- }
- }
-
-}
-
-
-
- run_timer::run_timer( system::error_code & ec )
- : m_places(m_default_places), m_os(m_cout()) { start(ec); }
- run_timer::run_timer( std::ostream & os,
- system::error_code & ec )
- : m_places(m_default_places), m_os(os) { start(ec); }
-
- run_timer::run_timer( const std::string & format,
- system::error_code & ec )
- : m_places(m_default_places), m_os(m_cout()), m_format(format) { start(ec); }
- run_timer::run_timer( std::ostream & os, const std::string & format,
- system::error_code & ec )
- : m_places(m_default_places), m_os(os), m_format(format) { start(ec); }
-
- run_timer::run_timer( const std::string & format, int places,
- system::error_code & ec )
- : m_places(places), m_os(m_cout()), m_format(format) { start(ec); }
- run_timer::run_timer( std::ostream & os, const std::string & format,
- int places, system::error_code & ec )
- : m_places(places), m_os(os), m_format(format) { start(ec); }
-
- run_timer::run_timer( int places,
- system::error_code & ec )
- : m_places(places), m_os(m_cout()) { start(ec); }
- run_timer::run_timer( std::ostream & os, int places,
- system::error_code & ec )
- : m_places(places), m_os(os) { start(ec); }
-
- run_timer::run_timer( int places, const std::string & format,
- system::error_code & ec )
- : m_places(places), m_os(m_cout()), m_format(format) { start(ec); }
- run_timer::run_timer( std::ostream & os, int places, const std::string & format,
- system::error_code & ec )
- : m_places(places), m_os(os), m_format(format) { start(ec); }
-
- // run_timer::report -------------------------------------------------------------//
-
- void run_timer::report( system::error_code & ec )
- {
- m_reported = true;
- if ( m_format.empty() ) m_format = chrono_detail::default_format();
-
- process_times times;
- elapsed( times, ec );
- if (ec) return;
-
- if ( BOOST_CHRONO_IS_THROWS(ec) )
- {
- chrono_detail::show_time( times, m_format.c_str(), m_places, m_os );
- }
- else // non-throwing
- {
- try
- {
- chrono_detail::show_time( times, m_format.c_str(), m_places, m_os );
- if (!BOOST_CHRONO_IS_THROWS(ec))
- {
- ec.clear();
- }
- }
-
- catch (...) // eat any exceptions
- {
- BOOST_ASSERT( 0 && "error reporting not fully implemented yet" );
- if (BOOST_CHRONO_IS_THROWS(ec))
- {
- boost::throw_exception(
- system::system_error(
- errno,
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::run_timer" ));
- }
- else
- {
- ec.assign(system::errc::success, BOOST_CHRONO_SYSTEM_CATEGORY);
- }
- }
- }
- }
-
- // run_timer::test_report --------------------------------------------------------//
-
- void run_timer::test_report( duration real_, duration user_, duration system_ )
- {
- if ( m_format.empty() ) m_format = chrono_detail::default_format();
-
- process_times times;
- times.real = real_;
- times.user = user_;
- times.system = system_;
-
- chrono_detail::show_time( times, m_format.c_str(), m_places, m_os );
- }
-
- } // namespace chrono
-} // namespace boost
-
-#endif

Deleted: branches/release/boost/chrono/detail/inlined/run_timer_static.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/run_timer_static.hpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
+++ (empty file)
@@ -1,37 +0,0 @@
-// boost run_timer_static.cpp --------------------------------------------------------//
-
-// Copyright Beman Dawes 2008
-// Copyright 2009-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/chrono for documentation.
-
-//--------------------------------------------------------------------------------------//
-
-// This function is defined in a separate translation so that it will not be linked
-// in except if actually used. This is more efficient because header <iostream> is
-// required, and it incurs the cost of the standard stream objects even if they are
-// not actually used.
-
-//--------------------------------------------------------------------------------------//
-#ifndef BOOST_CHRONO_DETAIL_INLINED_RUN_TIMER_STATIC_HPP
-#define BOOST_CHRONO_DETAIL_INLINED_RUN_TIMER_STATIC_HPP
-
-
-#include <boost/version.hpp>
-#include <boost/chrono/process_times.hpp>
-#include <iostream>
-
-namespace boost
-{
- namespace chrono
- {
-
- std::ostream & run_timer::m_cout() { return std::cout; }
-
- } // namespace chrono
-} // namespace boost
-
-#endif

Deleted: branches/release/boost/chrono/detail/inlined/win/process_clock.hpp
==============================================================================
--- branches/release/boost/chrono/detail/inlined/win/process_clock.hpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
+++ (empty file)
@@ -1,80 +0,0 @@
-// boost process_timer.cpp -----------------------------------------------------------//
-
-// Copyright Beman Dawes 1994, 2006, 2008
-// Copyright 2009-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/chrono for documentation.
-
-//--------------------------------------------------------------------------------------//
-#ifndef BOOST_CHRONO_DETAIL_INLINED_WIN_PROCESS_CLOCK_HPP
-#define BOOST_CHRONO_DETAIL_INLINED_WIN_PROCESS_CLOCK_HPP
-
-#include <boost/chrono/config.hpp>
-#include <boost/chrono/system_clocks.hpp>
-#include <boost/chrono/process_times.hpp>
-#include <cassert>
-
-#include <boost/detail/win/GetLastError.hpp>
-#include <boost/detail/win/GetCurrentProcess.hpp>
-#include <boost/detail/win/GetProcessTimes.hpp>
-
-namespace boost
-{
-namespace chrono
-{
-
-void process_clock::now( process_times & times_, system::error_code & ec )
-{
-
- // note that Windows uses 100 nanosecond ticks for FILETIME
- boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
-
- times_.real = duration( steady_clock::now().time_since_epoch().count() );
-
- #ifdef UNDER_CE
- // Windows CE does not support GetProcessTimes
- assert( 0 && "GetProcessTimes not supported under Windows CE" );
- times_.real = times_.system = times_.user = nanoseconds(-1);
- #else
- if ( boost::detail::win32::GetProcessTimes(
- boost::detail::win32::GetCurrentProcess(), &creation, &exit,
- &system_time, &user_time ) )
- {
- if (!BOOST_CHRONO_IS_THROWS(ec))
- {
- ec.clear();
- }
- times_.user = duration(
- ((static_cast<time_point::rep>(user_time.dwHighDateTime) << 32)
- | user_time.dwLowDateTime) * 100 );
-
- times_.system = duration(
- ((static_cast<time_point::rep>(system_time.dwHighDateTime) << 32)
- | system_time.dwLowDateTime) * 100 );
- }
- else
- {
- boost::detail::win32::DWORD_ cause = boost::detail::win32::GetLastError();
- if (BOOST_CHRONO_IS_THROWS(ec))
- {
- boost::throw_exception(
- system::system_error(
- cause,
- BOOST_CHRONO_SYSTEM_CATEGORY,
- "chrono::process_clock" ));
- }
- else
- {
- ec.assign( cause, BOOST_CHRONO_SYSTEM_CATEGORY );
- times_.real = times_.system = times_.user = nanoseconds(-1);
- }
- }
- #endif
-}
-} // namespace chrono
-} // namespace boost
-
-#endif

Deleted: branches/release/boost/chrono/process_times.hpp
==============================================================================
--- branches/release/boost/chrono/process_times.hpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
+++ (empty file)
@@ -1,212 +0,0 @@
-// boost/chrono/process_times.hpp -----------------------------------------------------------//
-
-// Copyright Beman Dawes 1994, 2007, 2008
-// Copyright Vicente J Botet Escriba 2009-2010
-
-// 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_PROCESS_TIMES_HPP
-#define BOOST_PROCESS_TIMES_HPP
-
-#include <boost/chrono/duration.hpp>
-#include <boost/chrono/time_point.hpp>
-#include <boost/system/error_code.hpp>
-#include <boost/cstdint.hpp>
-#include <string>
-#include <ostream>
-#include <boost/chrono/detail/system.hpp>
-
-#ifndef BOOST_CHRONO_HEADER_ONLY
-#include <boost/config/abi_prefix.hpp> // must be the last #include
-#endif
-
-
-namespace boost
-{
-namespace chrono
-{
-//--------------------------------------------------------------------------------------//
-// process_clock //
-//--------------------------------------------------------------------------------------//
-
- class BOOST_CHRONO_DECL process_clock
- {
- public:
- typedef nanoseconds duration;
- typedef duration::rep rep;
- typedef duration::period period;
- typedef chrono::time_point<process_clock> time_point;
- BOOST_CHRONO_STATIC_CONSTEXPR bool is_steady = true;
-
- struct durations
- {
- process_clock::duration real; // real (i.e wall clock) time
- process_clock::duration user; // user cpu time
- process_clock::duration system; // system cpu time
- };
- struct time_points
- {
- process_clock::time_point real; // real (i.e wall clock) time
- process_clock::time_point user; // user cpu time
- process_clock::time_point system; // system cpu time
- };
-
- static BOOST_CHRONO_INLINE void now( durations & times,
- system::error_code & ec = BOOST_CHRONO_THROWS );
- static BOOST_CHRONO_INLINE void now( time_points & times,
- system::error_code & ec = BOOST_CHRONO_THROWS );
- };
-
-
-//--------------------------------------------------------------------------------------//
-// process_times //
-//--------------------------------------------------------------------------------------//
-
- typedef process_clock::durations process_times;
-
-//--------------------------------------------------------------------------------------//
-// process_timer //
-//--------------------------------------------------------------------------------------//
-
- class BOOST_CHRONO_DECL process_timer
- // BOOST_CHRONO_DECL is required to quiet compiler warnings even though
- // process_timer has no dynamically linked members, because process_timer is
- // used as a base class for run_timer, which does have dynamically linked members.
- {
- public:
-
- typedef process_clock clock;
- typedef process_clock::duration duration;
- typedef process_clock::time_point time_point;
-
- explicit process_timer( system::error_code & ec = BOOST_CHRONO_THROWS )
- {
- start(ec);
- }
-
- ~process_timer() {} // never throws()
-
- void start( system::error_code & ec = BOOST_CHRONO_THROWS )
- {
- process_clock::now( m_start, ec );
- }
-
- void elapsed( process_times & times, system::error_code & ec = BOOST_CHRONO_THROWS )
- {
- process_times end;
- process_clock::now( end, ec );
- times.real = end.real - m_start.real;
- times.user = end.user - m_start.user;
- times.system = end.system - m_start.system;
- }
-
- protected:
- process_times m_start;
- private:
- process_timer(const process_timer&); // = delete;
- process_timer& operator=(const process_timer&); // = delete;
- };
-
-//--------------------------------------------------------------------------------------//
-// run_timer //
-//--------------------------------------------------------------------------------------//
-
- class BOOST_CHRONO_DECL run_timer : public process_timer
- {
- // every function making use of inlined functions of class string are not inlined to avoid DLL issues
- public:
-
- // each constructor form has two overloads to avoid a visible default to
- // std::cout, which in turn would require including <iostream>, with its
- // high associated cost, even when the standard streams are not used.
-
- BOOST_CHRONO_INLINE
- explicit run_timer( system::error_code & ec = BOOST_CHRONO_THROWS );
- BOOST_CHRONO_INLINE
- explicit run_timer( std::ostream & os,
- system::error_code & ec = BOOST_CHRONO_THROWS );
-
- BOOST_CHRONO_INLINE
- explicit run_timer( const std::string & format,
- system::error_code & ec = BOOST_CHRONO_THROWS );
- BOOST_CHRONO_INLINE
- run_timer( std::ostream & os, const std::string & format,
- system::error_code & ec = BOOST_CHRONO_THROWS );
-
- BOOST_CHRONO_INLINE
- run_timer( const std::string & format, int places,
- system::error_code & ec = BOOST_CHRONO_THROWS );
- BOOST_CHRONO_INLINE
- run_timer( std::ostream & os, const std::string & format,
- int places, system::error_code & ec = BOOST_CHRONO_THROWS );
-
- BOOST_CHRONO_INLINE
- explicit run_timer( int places,
- system::error_code & ec = BOOST_CHRONO_THROWS );
- BOOST_CHRONO_INLINE
- run_timer( std::ostream & os, int places,
- system::error_code & ec = BOOST_CHRONO_THROWS );
-
- BOOST_CHRONO_INLINE
- run_timer( int places, const std::string & format,
- system::error_code & ec = BOOST_CHRONO_THROWS );
- BOOST_CHRONO_INLINE
- run_timer( std::ostream & os, int places, const std::string & format,
- system::error_code & ec = BOOST_CHRONO_THROWS );
-
- ~run_timer() // never throws
- {
- system::error_code ec;
- if ( !reported() ) report( ec );
- }
-
- BOOST_CHRONO_INLINE void start( system::error_code & ec = BOOST_CHRONO_THROWS )
- {
- m_reported = false;
- process_timer::start( ec );
- }
-
- BOOST_CHRONO_INLINE void report( system::error_code & ec = BOOST_CHRONO_THROWS );
-
- BOOST_CHRONO_INLINE void test_report( duration real_, duration user_, duration system_ );
-
- BOOST_CHRONO_INLINE bool reported() const { return m_reported; }
-
- BOOST_CHRONO_INLINE static int default_places() { return m_default_places; }
-
- private:
- int m_places;
- std::ostream & m_os;
-
-#if defined _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4251)
-#endif
- std::string m_format;
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
- bool m_reported;
-
- BOOST_CHRONO_INLINE static std::ostream & m_cout();
- //{return std::cout;}
- static const int m_default_places = 3;
- run_timer(const run_timer&); // = delete;
- run_timer& operator=(const run_timer&); // = delete;
- };
-
- } // namespace chrono
-} // namespace boost
-
-#ifndef BOOST_CHRONO_HEADER_ONLY
-#include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
-#else
-#include <boost/chrono/detail/inlined/process_clock.hpp>
-#include <boost/chrono/detail/inlined/run_timer.hpp>
-#include <boost/chrono/detail/inlined/run_timer_static.hpp>
-#endif
-
-#endif // BOOST_PROCESS_TIMES_HPP

Deleted: branches/release/boost/chrono/timer.hpp
==============================================================================
--- branches/release/boost/chrono/timer.hpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
+++ (empty file)
@@ -1,62 +0,0 @@
-// boost/chrono/timer.hpp ------------------------------------------------------------//
-
-// Copyright Beman Dawes 2008
-// Copyright 2009 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_TIMER_HPP
-#define BOOST_CHRONO_TIMER_HPP
-
-#include <boost/chrono/chrono.hpp>
-#include <boost/system/error_code.hpp>
-
-namespace boost
-{
- namespace chrono
- {
-
-//--------------------------------------------------------------------------------------//
-// timer //
-//--------------------------------------------------------------------------------------//
-
- template <class Clock=high_resolution_clock>
- class timer
- {
- public:
- typedef Clock clock;
- typedef typename Clock::duration duration;
- typedef typename Clock::time_point time_point;
-
- explicit timer( system::error_code & ec = BOOST_CHRONO_THROWS )
- {
- start(ec);
- }
-
- ~timer() {} // never throws
-
- void start( system::error_code & ec = BOOST_CHRONO_THROWS )
- {
- m_start = clock::now( ec );
- }
-
- duration elapsed( system::error_code & ec = BOOST_CHRONO_THROWS )
- { return clock::now( ec ) - m_start; }
-
- private:
- time_point m_start;
- };
-
- typedef boost::chrono::timer< boost::chrono::system_clock > system_timer;
-#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
- typedef boost::chrono::timer< boost::chrono::steady_clock > steady_timer;
-#endif
- typedef boost::chrono::timer< boost::chrono::high_resolution_clock > high_resolution_timer;
-
- } // namespace chrono
-} // namespace boost
-
-#endif

Modified: branches/release/libs/chrono/example/chrono_accuracy_test.cpp
==============================================================================
--- branches/release/libs/chrono/example/chrono_accuracy_test.cpp (original)
+++ branches/release/libs/chrono/example/chrono_accuracy_test.cpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
@@ -11,7 +11,7 @@
 #include <boost/chrono/chrono.hpp>
 #include <boost/chrono/process_cpu_clocks.hpp>
 #include <boost/chrono/thread_clock.hpp>
-#include <boost/chrono/timer.hpp>
+#include <libs/chrono/example/timer.hpp>
 #include <cstdlib> // for atol()
 #include <iostream>
 #include <sstream>

Added: branches/release/libs/chrono/example/timer.hpp
==============================================================================
--- (empty file)
+++ branches/release/libs/chrono/example/timer.hpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
@@ -0,0 +1,62 @@
+// boost/chrono/timer.hpp ------------------------------------------------------------//
+
+// Copyright Beman Dawes 2008
+// Copyright 2009 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_TIMER_HPP
+#define BOOST_CHRONO_TIMER_HPP
+
+#include <boost/chrono/chrono.hpp>
+#include <boost/system/error_code.hpp>
+
+namespace boost
+{
+ namespace chrono
+ {
+
+//--------------------------------------------------------------------------------------//
+// timer //
+//--------------------------------------------------------------------------------------//
+
+ template <class Clock=high_resolution_clock>
+ class timer
+ {
+ public:
+ typedef Clock clock;
+ typedef typename Clock::duration duration;
+ typedef typename Clock::time_point time_point;
+
+ explicit timer( system::error_code & ec = BOOST_CHRONO_THROWS )
+ {
+ start(ec);
+ }
+
+ ~timer() {} // never throws
+
+ void start( system::error_code & ec = BOOST_CHRONO_THROWS )
+ {
+ m_start = clock::now( ec );
+ }
+
+ duration elapsed( system::error_code & ec = BOOST_CHRONO_THROWS )
+ { return clock::now( ec ) - m_start; }
+
+ private:
+ time_point m_start;
+ };
+
+ typedef boost::chrono::timer< boost::chrono::system_clock > system_timer;
+#ifdef BOOST_CHRONO_HAS_CLOCK_STEADY
+ typedef boost::chrono::timer< boost::chrono::steady_clock > steady_timer;
+#endif
+ typedef boost::chrono::timer< boost::chrono::high_resolution_clock > high_resolution_timer;
+
+ } // namespace chrono
+} // namespace boost
+
+#endif

Deleted: branches/release/libs/chrono/src/process_clock.cpp
==============================================================================
--- branches/release/libs/chrono/src/process_clock.cpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
+++ (empty file)
@@ -1,19 +0,0 @@
-// boost process_timer.cpp -----------------------------------------------------------//
-
-// Copyright Beman Dawes 1994, 2006, 2008
-// Copyright 2009 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/chrono for documentation.
-
-//--------------------------------------------------------------------------------------//
-
-// define BOOST_CHRONO_SOURCE so that <boost/chrono/config.hpp> knows
-// the library is being built (possibly exporting rather than importing code)
-
-#define BOOST_CHRONO_SOURCE
-
-#include <boost/chrono/detail/inlined/process_clock.hpp>
-

Deleted: branches/release/libs/chrono/src/run_timer.cpp
==============================================================================
--- branches/release/libs/chrono/src/run_timer.cpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
+++ (empty file)
@@ -1,19 +0,0 @@
-// boost run_timer.cpp ---------------------------------------------------------------//
-
-// Copyright Beman Dawes 1994, 2006, 2008
-// Copyright 2009-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/chrono for documentation.
-
-//--------------------------------------------------------------------------------------//
-
-// define BOOST_CHRONO_SOURCE so that <boost/chrono/config.hpp> knows
-// the library is being built (possibly exporting rather than importing code)
-
-#define BOOST_CHRONO_SOURCE
-
-#include <boost/chrono/detail/inlined/run_timer.hpp>
-

Deleted: branches/release/libs/chrono/src/run_timer_static.cpp
==============================================================================
--- branches/release/libs/chrono/src/run_timer_static.cpp 2011-10-08 08:11:57 EDT (Sat, 08 Oct 2011)
+++ (empty file)
@@ -1,26 +0,0 @@
-// boost run_timer_static.cpp --------------------------------------------------------//
-
-// Copyright Beman Dawes 2008
-// Copyright 2009-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/chrono for documentation.
-
-//--------------------------------------------------------------------------------------//
-
-// This function is defined in a separate translation so that it will not be linked
-// in except if actually used. This is more efficient because header <iostream> is
-// required, and it incurs the cost of the standard stream objects even if they are
-// not actually used.
-
-//--------------------------------------------------------------------------------------//
-
-// define BOOST_CHRONO_SOURCE so that <boost/chrono/config.hpp> knows
-// the library is being built (possibly exporting rather than importing code)
-
-#define BOOST_CHRONO_SOURCE
-
-#include <boost/chrono/detail/inlined/run_timer_static.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