Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66054 - sandbox/chrono/boost/chrono/detail/inlined/win
From: vicente.botet_at_[hidden]
Date: 2010-10-17 17:17:23


Author: viboes
Date: 2010-10-17 17:17:22 EDT (Sun, 17 Oct 2010)
New Revision: 66054
URL: http://svn.boost.org/trac/boost/changeset/66054

Log:
Chrono: Adapt to Reorganize the files following http://msdn.microsoft.com/en-us/library/ee663300%28v=VS.85%29.aspx

Text files modified:
   sandbox/chrono/boost/chrono/detail/inlined/win/chrono.hpp | 39 ++++++++++++++++++++-------------------
   sandbox/chrono/boost/chrono/detail/inlined/win/process_clock.hpp | 12 ++++++------
   sandbox/chrono/boost/chrono/detail/inlined/win/thread_clock.hpp | 26 +++++++++++++-------------
   3 files changed, 39 insertions(+), 38 deletions(-)

Modified: sandbox/chrono/boost/chrono/detail/inlined/win/chrono.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/detail/inlined/win/chrono.hpp (original)
+++ sandbox/chrono/boost/chrono/detail/inlined/win/chrono.hpp 2010-10-17 17:17:22 EDT (Sun, 17 Oct 2010)
@@ -13,6 +13,7 @@
 #define BOOST_CHRONO_DETAIL_INLINED_WIN_CHRONO_HPP
 
 #include <boost/detail/win/time.hpp>
+#include <boost/detail/win/timers.hpp>
 #include <boost/detail/win/GetLastError.hpp>
 
 namespace boost
@@ -21,41 +22,41 @@
 {
 namespace chrono_detail
 {
-
+
   BOOST_CHRONO_INLINE double get_nanosecs_per_tic()
   {
- boost::detail::win32::LARGE_INTEGER_ freq;
- if ( !boost::detail::win32::QueryPerformanceFrequency( &freq ) )
- return 0.0L;
- return double(1000000000.0L / freq.QuadPart);
+ boost::detail::win32::LARGE_INTEGER_ freq;
+ if ( !boost::detail::win32::QueryPerformanceFrequency( &freq ) )
+ return 0.0L;
+ return double(1000000000.0L / freq.QuadPart);
   }
 
 }
-
+
   monotonic_clock::time_point monotonic_clock::now()
   {
- static double nanosecs_per_tic = chrono_detail::get_nanosecs_per_tic();
+ static double nanosecs_per_tic = chrono_detail::get_nanosecs_per_tic();
 
- boost::detail::win32::LARGE_INTEGER_ pcount;
+ boost::detail::win32::LARGE_INTEGER_ pcount;
     if ( (nanosecs_per_tic <= 0.0L) || (!boost::detail::win32::QueryPerformanceCounter( &pcount )) )
     {
- boost::detail::win32::DWORD_ cause =
- (nanosecs_per_tic <= 0.0L
- ? ERROR_NOT_SUPPORTED
- : boost::detail::win32::GetLastError());
+ boost::detail::win32::DWORD_ cause =
+ (nanosecs_per_tic <= 0.0L
+ ? ERROR_NOT_SUPPORTED
+ : boost::detail::win32::GetLastError());
       boost::throw_exception(
 #if ((BOOST_VERSION / 100000) < 2) && ((BOOST_VERSION / 100 % 1000) < 44)
         system::system_error( cause, system::system_category, "chrono::monotonic_clock" ));
 #else
         system::system_error( cause, system::system_category(), "chrono::monotonic_clock" ));
-#endif
+#endif
     }
 
     return monotonic_clock::time_point(monotonic_clock::duration(
       static_cast<monotonic_clock::rep>((nanosecs_per_tic) * pcount.QuadPart) ));
   }
 
-
+
   monotonic_clock::time_point monotonic_clock::now( system::error_code & ec )
   {
     static double nanosecs_per_tic = chrono_detail::get_nanosecs_per_tic();
@@ -63,12 +64,12 @@
     boost::detail::win32::LARGE_INTEGER_ pcount;
     if ( (nanosecs_per_tic <= 0.0L) || (!boost::detail::win32::QueryPerformanceCounter( &pcount )) )
     {
- boost::detail::win32::DWORD_ cause = ((nanosecs_per_tic <= 0.0L) ? ERROR_NOT_SUPPORTED : boost::detail::win32::GetLastError());
+ boost::detail::win32::DWORD_ cause = ((nanosecs_per_tic <= 0.0L) ? ERROR_NOT_SUPPORTED : boost::detail::win32::GetLastError());
 #if ((BOOST_VERSION / 100000) < 2) && ((BOOST_VERSION / 100 % 1000) < 44)
       ec.assign( cause, system::system_category );
 #else
       ec.assign( cause, system::system_category() );
-#endif
+#endif
       return monotonic_clock::time_point(duration(0));
     }
 
@@ -80,8 +81,8 @@
   BOOST_CHRONO_INLINE
   system_clock::time_point system_clock::now()
   {
- boost::detail::win32::FILETIME_ ft;
- boost::detail::win32::GetSystemTimeAsFileTime( &ft ); // never fails
+ boost::detail::win32::FILETIME_ ft;
+ boost::detail::win32::GetSystemTimeAsFileTime( &ft ); // never fails
     return system_clock::time_point(system_clock::duration(
       (static_cast<__int64>( ft.dwHighDateTime ) << 32) | ft.dwLowDateTime));
   }
@@ -89,7 +90,7 @@
   BOOST_CHRONO_INLINE
   system_clock::time_point system_clock::now( system::error_code & ec )
   {
- boost::detail::win32::FILETIME_ ft;
+ boost::detail::win32::FILETIME_ ft;
     boost::detail::win32::GetSystemTimeAsFileTime( &ft ); // never fails
     ec.clear();
     return time_point(duration(

Modified: sandbox/chrono/boost/chrono/detail/inlined/win/process_clock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/detail/inlined/win/process_clock.hpp (original)
+++ sandbox/chrono/boost/chrono/detail/inlined/win/process_clock.hpp 2010-10-17 17:17:22 EDT (Sun, 17 Oct 2010)
@@ -17,15 +17,15 @@
 #include <boost/chrono/process_times.hpp>
 #include <cassert>
 
-#include <boost/detail/win/time.hpp>
 #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 )
     {
 
@@ -34,8 +34,8 @@
 
       times_.real = duration( monotonic_clock::now().time_since_epoch().count() );
 
- if ( boost::detail::win32::GetProcessTimes(
- boost::detail::win32::GetCurrentProcess(), &creation, &exit,
+ if ( boost::detail::win32::GetProcessTimes(
+ boost::detail::win32::GetCurrentProcess(), &creation, &exit,
              &system_time, &user_time ) )
       {
         ec.clear();
@@ -54,7 +54,7 @@
         ec.assign( boost::detail::win32::GetLastError(), system::system_category );
 #else
         ec.assign( boost::detail::win32::GetLastError(), system::system_category() );
-#endif
+#endif
         times_.real = times_.system = times_.user = nanoseconds(-1);
       }
 
@@ -62,4 +62,4 @@
   } // namespace chrono
 } // namespace boost
 
-#endif
+#endif

Modified: sandbox/chrono/boost/chrono/detail/inlined/win/thread_clock.hpp
==============================================================================
--- sandbox/chrono/boost/chrono/detail/inlined/win/thread_clock.hpp (original)
+++ sandbox/chrono/boost/chrono/detail/inlined/win/thread_clock.hpp 2010-10-17 17:17:22 EDT (Sun, 17 Oct 2010)
@@ -15,9 +15,9 @@
 #include <boost/chrono/thread_clock.hpp>
 #include <cassert>
 
-#include <boost/detail/win/time.hpp>
 #include <boost/detail/win/GetLastError.hpp>
 #include <boost/detail/win/GetCurrentThread.hpp>
+#include <boost/detail/win/GetThreadTimes.hpp>
 
 namespace boost
 {
@@ -28,10 +28,10 @@
     {
 
       // note that Windows uses 100 nanosecond ticks for FILETIME
- boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
+ boost::detail::win32::FILETIME_ creation, exit, user_time, system_time;
 
- if ( boost::detail::win32::GetThreadTimes(
- boost::detail::win32::GetCurrentThread (), &creation, &exit,
+ if ( boost::detail::win32::GetThreadTimes(
+ boost::detail::win32::GetCurrentThread (), &creation, &exit,
              &system_time, &user_time ) )
       {
         duration user = duration(
@@ -41,10 +41,10 @@
         duration system = duration(
           ((static_cast<duration::rep>(system_time.dwHighDateTime) << 32)
             | system_time.dwLowDateTime) * 100 );
-
+
         ec.clear();
         return time_point(system+user);
-
+
       }
       else
       {
@@ -53,12 +53,12 @@
         ec.assign( boost::detail::win32::GetLastError(), system::system_category );
 #else
         ec.assign( boost::detail::win32::GetLastError(), system::system_category() );
-#endif
+#endif
         return thread_clock::time_point(duration(0));
       }
 
     }
-
+
     thread_clock::time_point thread_clock::now( )
     {
 
@@ -75,9 +75,9 @@
         duration system = duration(
           ((static_cast<duration::rep>(system_time.dwHighDateTime) << 32)
             | system_time.dwLowDateTime) * 100 );
-
+
         return time_point(system+user);
-
+
       }
       else
       {
@@ -86,13 +86,13 @@
             system::system_error( boost::detail::win32::GetLastError(), system::system_category, "chrono::monotonic_clock" ));
 #else
             system::system_error( boost::detail::win32::GetLastError(), system::system_category(), "chrono::monotonic_clock" ));
-#endif
+#endif
       }
 
     }
-
 
-
+
+
   } // 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