|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r74288 - trunk/boost/chrono/detail/inlined
From: vicente.botet_at_[hidden]
Date: 2011-09-06 17:17:37
Author: viboes
Date: 2011-09-06 17:17:36 EDT (Tue, 06 Sep 2011)
New Revision: 74288
URL: http://svn.boost.org/trac/boost/changeset/74288
Log:
Chrono: remove not supported run_timer and process_clocks files.
Removed:
trunk/boost/chrono/detail/inlined/process_clock.hpp
trunk/boost/chrono/detail/inlined/run_timer.hpp
trunk/boost/chrono/detail/inlined/run_timer_static.hpp
Deleted: trunk/boost/chrono/detail/inlined/process_clock.hpp
==============================================================================
--- trunk/boost/chrono/detail/inlined/process_clock.hpp 2011-09-06 17:17:36 EDT (Tue, 06 Sep 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: trunk/boost/chrono/detail/inlined/run_timer.hpp
==============================================================================
--- trunk/boost/chrono/detail/inlined/run_timer.hpp 2011-09-06 17:17:36 EDT (Tue, 06 Sep 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: trunk/boost/chrono/detail/inlined/run_timer_static.hpp
==============================================================================
--- trunk/boost/chrono/detail/inlined/run_timer_static.hpp 2011-09-06 17:17:36 EDT (Tue, 06 Sep 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
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