From d93aae6b5070d4f80ad01cf27e45973377e7d100 Mon Sep 17 00:00:00 2001 From: lotodore Date: Wed, 9 Feb 2011 19:48:22 +0000 Subject: [PATCH] Fixing cppcheck issues by removing unused files of the boost timer lib. --- src/third_party/boost/timers.hpp | 4 +- src/third_party/boost/timers/posix.hpp | 45 -------- .../boost/timers/posix/ftime_device.hpp | 86 --------------- .../boost/timers/posix/gru_device.hpp | 88 --------------- .../boost/timers/posix/gtod_device.hpp | 86 --------------- src/third_party/boost/timers/win32.hpp | 57 ---------- .../boost/timers/win32/gpt_device.hpp | 97 ---------------- .../boost/timers/win32/gstaft_device.hpp | 86 --------------- .../boost/timers/win32/gtc_device.hpp | 81 -------------- .../boost/timers/win32/gtt_device.hpp | 97 ---------------- .../boost/timers/win32/qpc_device.hpp | 104 ------------------ .../boost/timers/win32/tgt_device.hpp | 96 ---------------- 12 files changed, 2 insertions(+), 925 deletions(-) delete mode 100644 src/third_party/boost/timers/posix.hpp delete mode 100644 src/third_party/boost/timers/posix/ftime_device.hpp delete mode 100644 src/third_party/boost/timers/posix/gru_device.hpp delete mode 100644 src/third_party/boost/timers/posix/gtod_device.hpp delete mode 100644 src/third_party/boost/timers/win32.hpp delete mode 100644 src/third_party/boost/timers/win32/gpt_device.hpp delete mode 100644 src/third_party/boost/timers/win32/gstaft_device.hpp delete mode 100644 src/third_party/boost/timers/win32/gtc_device.hpp delete mode 100644 src/third_party/boost/timers/win32/gtt_device.hpp delete mode 100644 src/third_party/boost/timers/win32/qpc_device.hpp delete mode 100644 src/third_party/boost/timers/win32/tgt_device.hpp diff --git a/src/third_party/boost/timers.hpp b/src/third_party/boost/timers.hpp index 2743b56a..88e374b0 100644 --- a/src/third_party/boost/timers.hpp +++ b/src/third_party/boost/timers.hpp @@ -21,10 +21,10 @@ #include "timers/timer.hpp" #include "timers/portable.hpp" -#ifdef BOOST_WINDOWS +/*#ifdef BOOST_WINDOWS #include "timers/win32.hpp" #else #include "timers/posix.hpp" -#endif +#endif*/ // Modified by Lothar May: We only need the portable timers. #endif // _BOOST_TIMERS_HPP diff --git a/src/third_party/boost/timers/posix.hpp b/src/third_party/boost/timers/posix.hpp deleted file mode 100644 index e33834e0..00000000 --- a/src/third_party/boost/timers/posix.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef _BOOST_TIMERS_POSIX_HPP -#define _BOOST_TIMERS_POSIX_HPP - -// (C) Copyright Vaucher Philippe 2007 - -// Use, modification and distribution is subject to the -// Boost Software License, Version 1.0. (See accompanying -// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) -// Author: Vaucher Philippe 2007 - - -// -------------------------- Includes -------------------------- - -#include "timer.hpp" -#include "posix/ftime_device.hpp" -#include "posix/gru_device.hpp" -#include "posix/gtod_device.hpp" - - -// -------------------------- Code -------------------------- - -namespace boost -{ -namespace timers -{ -namespace posix -{ - - // ftime() device - typedef timer ftime_timer; - - // getcputime() device - typedef timer gru_timer; - - // gettimeofday() device - typedef timer gtod_timer; - - // Typedef which timer is the best - typedef gtod_timer best_timer; - -} // namespace posix -} // namespace timers -} // namespace boost - -#endif // _BOOST_TIMERS_POSIX_HPP diff --git a/src/third_party/boost/timers/posix/ftime_device.hpp b/src/third_party/boost/timers/posix/ftime_device.hpp deleted file mode 100644 index c6a620ae..00000000 --- a/src/third_party/boost/timers/posix/ftime_device.hpp +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _BOOST_TIMERS_POSIX_FTIME_DEVICE_HPP -#define _BOOST_TIMERS_POSIX_FTIME_DEVICE_HPP - -// (C) Copyright Vaucher Philippe 2007 - -// Use, modification and distribution is subject to the -// Boost Software License, Version 1.0. (See accompanying -// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) -// Author: Vaucher Philippe 2007 - - -// -------------------------- Includes -------------------------- - -// Boost headers -#include - -// Linux headers -#include - -// -------------------------- Code -------------------------- - -namespace boost -{ -namespace timers -{ -namespace posix -{ - -//! The gtod_device class is based on gettimeofday() to compute the time -class ftime_device -{ - - public: - - typedef posix_time::ptime time_type; - typedef time_type::time_duration_type time_duration_type; - - explicit ftime_device() : m_elapsed(0, 0, 0) - { - std::memset(&m_start, 0, sizeof(timeb)); - } - - void start() - { - if(!is_time(m_start)) - ftime(&m_start); - } - - const time_duration_type& elapsed() const - { - if(is_time(m_start)) - { - timeb current; - ftime(¤t); - int64_t seconds = current.time - m_start.time; - int64_t milliseconds = current.millitm - m_start.millitm; - m_elapsed += posix_time::milliseconds(seconds * 1000 + milliseconds); - m_start = current; - } - return m_elapsed; - } - - void reset() - { - m_elapsed = time_duration_type(0,0,0); - std::memset(&m_start, 0, sizeof(timeb)); - } - - - private: - - bool is_time(const timeb& value) const - { - return value.time != 0; - } - - mutable timeb m_start; - mutable time_duration_type m_elapsed; - -}; - -} // namespace posix -} // namespace timers -} // namespace boost - -#endif // _BOOST_TIMERS_POSIX_FTIME_DEVICE_HPP diff --git a/src/third_party/boost/timers/posix/gru_device.hpp b/src/third_party/boost/timers/posix/gru_device.hpp deleted file mode 100644 index f1faceab..00000000 --- a/src/third_party/boost/timers/posix/gru_device.hpp +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef _BOOST_TIMERS_POSIX_GRU_DEVICE_HPP -#define _BOOST_TIMERS_POSIX_GRU_DEVICE_HPP - -// (C) Copyright Vaucher Philippe 2007 - -// Use, modification and distribution is subject to the -// Boost Software License, Version 1.0. (See accompanying -// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) -// Author: Vaucher Philippe 2007 - - -// -------------------------- Includes -------------------------- - -// Boost headers -#include - -// Linux headers -#include -#include - - -// -------------------------- Code -------------------------- - -namespace boost -{ -namespace timers -{ -namespace posix -{ - -//! The gru_device class is based on getrusage() to compute the time -class gru_device -{ - - public: - - typedef posix_time::ptime time_type; - typedef time_type::time_duration_type time_duration_type; - - explicit gru_device() : m_elapsed(0, 0, 0) - { - std::memset(&m_start, 0, sizeof(timeval)); - } - - void start() - { - if(!is_time(m_start)) - getrusage(RUSAGE_SELF, &m_start); - } - - const time_duration_type& elapsed() const - { - if(is_time(m_start)) - { - rusage current; - getrusage(RUSAGE_SELF, ¤t); - int64_t seconds = current.ru_utime.tv_sec - m_start.ru_utime.tv_sec; - int64_t microseconds = current.ru_utime.tv_usec - m_start.ru_utime.tv_usec; - m_elapsed += posix_time::microseconds(seconds * 1000000 + microseconds); - m_start = current; - } - return m_elapsed; - } - - void reset() - { - m_elapsed = time_duration_type(0,0,0); - std::memset(&m_start, 0, sizeof(timeval)); - } - - - private: - - bool is_time(const rusage& value) const - { - return value.ru_utime.tv_sec || value.ru_utime.tv_usec; - } - - mutable rusage m_start; - mutable time_duration_type m_elapsed; - -}; - -} // namespace posix -} // namespace timers -} // namespace boost - -#endif // _BOOST_TIMERS_POSIX_GRU_DEVICE_HPP diff --git a/src/third_party/boost/timers/posix/gtod_device.hpp b/src/third_party/boost/timers/posix/gtod_device.hpp deleted file mode 100644 index df9a8d7d..00000000 --- a/src/third_party/boost/timers/posix/gtod_device.hpp +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _BOOST_TIMERS_POSIX_GTOD_DEVICE_HPP -#define _BOOST_TIMERS_POSIX_GTOD_DEVICE_HPP - -// (C) Copyright Vaucher Philippe 2007 - -// Use, modification and distribution is subject to the -// Boost Software License, Version 1.0. (See accompanying -// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) -// Author: Vaucher Philippe 2007 - - -// -------------------------- Includes -------------------------- - -// Boost headers -#include - -// Linux headers -#include - -// -------------------------- Code -------------------------- - -namespace boost -{ -namespace timers -{ -namespace posix -{ - -//! The gtod_device class is based on gettimeofday() to compute the time -class gtod_device -{ - - public: - - typedef posix_time::ptime time_type; - typedef time_type::time_duration_type time_duration_type; - - explicit gtod_device() : m_elapsed(0, 0, 0) - { - std::memset(&m_start, 0, sizeof(timeval)); - } - - void start() - { - if(!is_time(m_start)) - gettimeofday(&m_start, 0); - } - - const time_duration_type& elapsed() const - { - if(is_time(m_start)) - { - timeval current; - gettimeofday(¤t, 0); - int64_t seconds = current.tv_sec - m_start.tv_sec; - int64_t microseconds = current.tv_usec - m_start.tv_usec; - m_elapsed += posix_time::microseconds(seconds * 1000000 + microseconds); - m_start = current; - } - return m_elapsed; - } - - void reset() - { - m_elapsed = time_duration_type(0,0,0); - std::memset(&m_start, 0, sizeof(timeval)); - } - - - private: - - bool is_time(const timeval& value) const - { - return value.tv_sec || value.tv_usec; - } - - mutable timeval m_start; - mutable time_duration_type m_elapsed; - -}; - -} // namespace posix -} // namespace timers -} // namespace boost - -#endif // _BOOST_TIMERS_POSIX_GTOD_DEVICE_HPP diff --git a/src/third_party/boost/timers/win32.hpp b/src/third_party/boost/timers/win32.hpp deleted file mode 100644 index 38a33e71..00000000 --- a/src/third_party/boost/timers/win32.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef _BOOST_TIMERS_WIN32_HPP -#define _BOOST_TIMERS_WIN32_HPP - -// (C) Copyright Vaucher Philippe 2007 - -// Use, modification and distribution is subject to the -// Boost Software License, Version 1.0. (See accompanying -// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) -// Author: Vaucher Philippe 2007 - - -// -------------------------- Includes -------------------------- - -#include "timer.hpp" -#include "win32/gpt_device.hpp" -#include "win32/gtc_device.hpp" -#include "win32/gtt_device.hpp" -#include "win32/gstaft_device.hpp" -#include "win32/qpc_device.hpp" -#include "win32/tgt_device.hpp" - - -// -------------------------- Code -------------------------- - -namespace boost -{ -namespace timers -{ -namespace win32 -{ - - // GetProcessTimes() device - typedef timer gpt_timer; - - // GetThreadTimes() device - typedef timer gtt_timer; - - // GetTickCount() device - typedef timer gtc_timer; - - // GetSystemTimeAsFileTime() device - typedef timer gstaft_timer; - - // QueryPerformanceCounter() device - typedef timer qpc_timer; - - // timeGetTime() device - typedef timer tgt_timer; - - // Typedef which timer is the best - typedef qpc_timer best_timer; - -} // namespace win32 -} // namespace timers -} // namespace boost - -#endif // _BOOST_TIMERS_WIN32_HPP diff --git a/src/third_party/boost/timers/win32/gpt_device.hpp b/src/third_party/boost/timers/win32/gpt_device.hpp deleted file mode 100644 index e4992771..00000000 --- a/src/third_party/boost/timers/win32/gpt_device.hpp +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef _BOOST_TIMERS_WIN32_GPT_DEVICE_HPP -#define _BOOST_TIMERS_WIN32_GPT_DEVICE_HPP - -// (C) Copyright Vaucher Philippe 2007 - -// Use, modification and distribution is subject to the -// Boost Software License, Version 1.0. (See accompanying -// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) -// Author: Vaucher Philippe 2007 - - -// -------------------------- Includes -------------------------- - -// Standard headers -#include - -// Boost headers -#include -#include - -// Windows headers -#define WIN32_LEAN_AND_MEAN -#include - - -// -------------------------- Code -------------------------- - -namespace boost -{ -namespace timers -{ -namespace win32 -{ - -//! The gtt_device class is based on GetThreadTimes() to compute the time -class gpt_device -{ - - public: - - typedef posix_time::ptime time_type; - typedef time_type::time_duration_type time_duration_type; - - explicit gpt_device() : m_start(0, 0), m_elapsed(0, 0, 0) - { - } - - void start() - { - if(!is_time(m_start)) - { - FILETIME tmp1, tmp2; - GetProcessTimes(GetCurrentProcess(), &tmp1, &tmp2, reinterpret_cast(&m_start.first), reinterpret_cast(&m_start.second)); - } - } - - const time_duration_type& elapsed() const - { - if(is_time(m_start)) - { - std::pair current; - FILETIME tmp1, tmp2; - GetProcessTimes(GetCurrentProcess(), &tmp1, &tmp2, reinterpret_cast(¤t.first), reinterpret_cast(¤t.second)); - // diff is measured in 100ns intervals... - uint64_t diff = (current.first - m_start.first) + (current.second - m_start.second); - // ... so we must divide by 10 to get nanoseconds - uint64_t nanoseconds = static_cast(diff / 10.0); - m_elapsed += posix_time::milliseconds(static_cast(nanoseconds / 1000.0)); - m_start = current; - } - return m_elapsed; - } - - void reset() - { - m_elapsed = time_duration_type(0,0,0); - m_start.first = m_start.second = 0; - } - - - private: - - bool is_time(const std::pair& time) const - { - return (time.first != 0 || time.second != 0); - } - - mutable std::pair m_start; - mutable time_duration_type m_elapsed; - -}; - -} // namespace win32 -} // namespace timers -} // namespace boost - -#endif // _BOOST_TIMERS_WIN32_GTT_DEVICE_HPP diff --git a/src/third_party/boost/timers/win32/gstaft_device.hpp b/src/third_party/boost/timers/win32/gstaft_device.hpp deleted file mode 100644 index 542ca41e..00000000 --- a/src/third_party/boost/timers/win32/gstaft_device.hpp +++ /dev/null @@ -1,86 +0,0 @@ -#ifndef _BOOST_TIMERS_WIN32_GSTAFT_DEVICE_HPP -#define _BOOST_TIMERS_WIN32_GSTAFT_DEVICE_HPP - -// (C) Copyright Vaucher Philippe 2007 - -// Use, modification and distribution is subject to the -// Boost Software License, Version 1.0. (See accompanying -// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) -// Author: Vaucher Philippe 2007 - - -// -------------------------- Includes -------------------------- - -// Boost headers -#include -#include - -// Windows headers -#define WIN32_LEAN_AND_MEAN -#include - - -// -------------------------- Code -------------------------- - -namespace boost -{ -namespace timers -{ -namespace win32 -{ - -//! The gstaft_device class is based on GetSystemTimeAsFileTime() to compute the time -class gstaft_device -{ - - public: - - typedef posix_time::ptime time_type; - typedef time_type::time_duration_type time_duration_type; - - explicit gstaft_device() : m_elapsed(0, 0, 0) - { - std::memset(&m_start, 0, sizeof(ULARGE_INTEGER)); - } - - void start() - { - if(!m_start.QuadPart) - GetSystemTimeAsFileTime(reinterpret_cast(&m_start)); - } - - const time_duration_type& elapsed() const - { - if(m_start.QuadPart) - { - ULARGE_INTEGER current; - GetSystemTimeAsFileTime(reinterpret_cast(¤t)); - // diff is measured in 100ns intervals... - uint64_t diff = current.QuadPart - m_start.QuadPart; - // ... so we must divide by 10 to get nanoseconds - uint64_t nanoseconds = static_cast(diff / 10.0); - m_elapsed += posix_time::milliseconds(static_cast(nanoseconds / 1000.0)); - m_start = current; - } - return m_elapsed; - } - - void reset() - { - m_elapsed = time_duration_type(0,0,0); - std::memset(&m_start, 0, sizeof(ULARGE_INTEGER)); - } - - - private: - - mutable ULARGE_INTEGER m_start; - mutable time_duration_type m_elapsed; - -}; - -} // namespace win32 -} // namespace timers -} // namespace boost - -#endif // _BOOST_TIMERS_WIN32_GSTAFT_DEVICE_HPP diff --git a/src/third_party/boost/timers/win32/gtc_device.hpp b/src/third_party/boost/timers/win32/gtc_device.hpp deleted file mode 100644 index f7c60f36..00000000 --- a/src/third_party/boost/timers/win32/gtc_device.hpp +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef _BOOST_TIMERS_WIN32_GTC_DEVICE_HPP -#define _BOOST_TIMERS_WIN32_GTC_DEVICE_HPP - -// (C) Copyright Vaucher Philippe 2007 - -// Use, modification and distribution is subject to the -// Boost Software License, Version 1.0. (See accompanying -// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) -// Author: Vaucher Philippe 2007 - - -// -------------------------- Includes -------------------------- - -// Boost headers -#include -#include - -// Windows headers -#define WIN32_LEAN_AND_MEAN -#include - - -// -------------------------- Code -------------------------- - -namespace boost -{ -namespace timers -{ -namespace win32 -{ - -//! The gtc_device class is based on GetTickCount() to compute the time -class gtc_device -{ - - public: - - typedef posix_time::ptime time_type; - typedef time_type::time_duration_type time_duration_type; - - explicit gtc_device() : m_start(0), m_elapsed(0, 0, 0) - { - } - - void start() - { - if(!m_start) - m_start = GetTickCount(); - } - - const time_duration_type& elapsed() const - { - if(m_start) - { - uint32_t current = GetTickCount(); - uint64_t milliseconds = current - m_start; - m_elapsed += posix_time::milliseconds(milliseconds); - m_start = current; - } - return m_elapsed; - } - - void reset() - { - m_elapsed = time_duration_type(0,0,0); - m_start = 0; - } - - - private: - - mutable uint32_t m_start; - mutable time_duration_type m_elapsed; - -}; - -} // namespace win32 -} // namespace timers -} // namespace boost - -#endif // _BOOST_TIMERS_WIN32_GTC_DEVICE_HPP diff --git a/src/third_party/boost/timers/win32/gtt_device.hpp b/src/third_party/boost/timers/win32/gtt_device.hpp deleted file mode 100644 index d4d4c103..00000000 --- a/src/third_party/boost/timers/win32/gtt_device.hpp +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef _BOOST_TIMERS_WIN32_GTT_DEVICE_HPP -#define _BOOST_TIMERS_WIN32_GTT_DEVICE_HPP - -// (C) Copyright Vaucher Philippe 2007 - -// Use, modification and distribution is subject to the -// Boost Software License, Version 1.0. (See accompanying -// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) -// Author: Vaucher Philippe 2007 - - -// -------------------------- Includes -------------------------- - -// Standard headers -#include - -// Boost headers -#include -#include - -// Windows headers -#define WIN32_LEAN_AND_MEAN -#include - - -// -------------------------- Code -------------------------- - -namespace boost -{ -namespace timers -{ -namespace win32 -{ - -//! The gtt_device class is based on GetThreadTimes() to compute the time -class gtt_device -{ - - public: - - typedef posix_time::ptime time_type; - typedef time_type::time_duration_type time_duration_type; - - explicit gtt_device() : m_start(0, 0), m_elapsed(0, 0, 0) - { - } - - void start() - { - if(!is_time(m_start)) - { - FILETIME tmp1, tmp2; - GetThreadTimes(GetCurrentThread(), &tmp1, &tmp2, reinterpret_cast(&m_start.first), reinterpret_cast(&m_start.second)); - } - } - - const time_duration_type& elapsed() const - { - if(is_time(m_start)) - { - std::pair current; - FILETIME tmp1, tmp2; - GetThreadTimes(GetCurrentThread(), &tmp1, &tmp2, reinterpret_cast(¤t.first), reinterpret_cast(¤t.second)); - // diff is measured in 100ns intervals... - uint64_t diff = (current.first - m_start.first) + (current.second - m_start.second); - // ... so we must divide by 10 to get nanoseconds - uint64_t nanoseconds = static_cast(diff / 10.0); - m_elapsed += posix_time::milliseconds(static_cast(nanoseconds / 1000.0)); - m_start = current; - } - return m_elapsed; - } - - void reset() - { - m_elapsed = time_duration_type(0,0,0); - m_start.first = m_start.second = 0; - } - - - private: - - bool is_time(const std::pair& time) const - { - return (time.first != 0 || time.second != 0); - } - - mutable std::pair m_start; - mutable time_duration_type m_elapsed; - -}; - -} // namespace win32 -} // namespace timers -} // namespace boost - -#endif // _BOOST_TIMERS_WIN32_GTT_DEVICE_HPP diff --git a/src/third_party/boost/timers/win32/qpc_device.hpp b/src/third_party/boost/timers/win32/qpc_device.hpp deleted file mode 100644 index 59a73bfa..00000000 --- a/src/third_party/boost/timers/win32/qpc_device.hpp +++ /dev/null @@ -1,104 +0,0 @@ -#ifndef _BOOST_TIMERS_WIN32_QPC_DEVICE_HPP -#define _BOOST_TIMERS_WIN32_QPC_DEVICE_HPP - -// (C) Copyright Vaucher Philippe 2007 - -// Use, modification and distribution is subject to the -// Boost Software License, Version 1.0. (See accompanying -// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) -// Author: Vaucher Philippe 2007 - - -// -------------------------- Includes -------------------------- - -// Boost headers -#include -#include - -// Windows headers -#define WIN32_LEAN_AND_MEAN -#include - - -// -------------------------- Code -------------------------- - -namespace boost -{ -namespace timers -{ -namespace win32 -{ - -class qpc_device -{ - - public: - - typedef posix_time::ptime time_type; - typedef time_type::time_duration_type time_duration_type; - - explicit qpc_device() : m_elapsed(0, 0, 0) - { - #ifdef BOOST_QPC_SET_AFFINITY - m_affinity = SetThreadAffinityMask(GetCurrentThread(), 1); - #endif - - m_start.QuadPart = 0; - if(!QueryPerformanceFrequency(&m_frequency)) - throw_exception(std::runtime_error("qpc_device: QueryPerformanceFrequency() indicated there's no high-resolution performance counter")); - - // Make it so we have the future results directly in milliseconds - m_frequency.QuadPart /= 1000; - } - - ~qpc_device() - { - #ifdef BOOST_QPC_SET_AFFINITY - SetThreadAffinityMask(GetCurrentThread(), m_affinity); - #endif - } - - void start() - { - if(!m_start.QuadPart && !QueryPerformanceCounter(&m_start)) - throw_exception(std::runtime_error("qpc_device: QueryPerformanceCounter() failed")); - } - - const time_duration_type& elapsed() const - { - if(m_start.QuadPart) - { - LARGE_INTEGER current; - if(!QueryPerformanceCounter(¤t)) - throw_exception(std::runtime_error("qpc_device: QueryPerformanceCounter() failed")); - int64_t milliseconds = (current.QuadPart - m_start.QuadPart) / m_frequency.QuadPart; - m_elapsed += posix_time::milliseconds(milliseconds); - m_start = current; - } - return m_elapsed; - } - - void reset() - { - m_elapsed = time_duration_type(0,0,0); - m_start.QuadPart = 0; - } - - - private: - - LARGE_INTEGER m_frequency; - mutable LARGE_INTEGER m_start; - mutable time_duration_type m_elapsed; - - #ifdef BOOST_QPC_SET_AFFINITY - DWORD_PTR m_affinity; - #endif - -}; - -} // namespace win32 -} // namespace timers -} // namespace boost - -#endif // _BOOST_TIMERS_WIN32_QUERYPERFORMANCECOUNTER_HPP diff --git a/src/third_party/boost/timers/win32/tgt_device.hpp b/src/third_party/boost/timers/win32/tgt_device.hpp deleted file mode 100644 index 777d961e..00000000 --- a/src/third_party/boost/timers/win32/tgt_device.hpp +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef _BOOST_TIMERS_WIN32_TGT_DEVICE_HPP -#define _BOOST_TIMERS_WIN32_TGT_DEVICE_HPP - -// (C) Copyright Vaucher Philippe 2007 - -// Use, modification and distribution is subject to the -// Boost Software License, Version 1.0. (See accompanying -// file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0) -// Author: Vaucher Philippe 2007 - - -// -------------------------- Includes -------------------------- - -// Boost headers -#include -#include - -// Windows headers -#define WIN32_LEAN_AND_MEAN -#include -#include - -// Automagically link winmm.lib if we can -#if (defined _MSC_VER) && (_MSC_VER >= 1200) -#pragma comment(lib, "winmm.lib") -#endif - -// -------------------------- Code -------------------------- - -namespace boost -{ -namespace timers -{ -namespace win32 -{ - -//! The tgt_device class is based on timeGetTime() to compute the time -class tgt_device -{ - - public: - - typedef posix_time::ptime time_type; - typedef time_type::time_duration_type time_duration_type; - - explicit tgt_device() : m_start(0), m_elapsed(0, 0, 0) - { - #ifndef BOOST_TGT_DEFAULT_RES - timeBeginPeriod(1); - #endif - } - - ~tgt_device() - { - #ifndef BOOST_TGT_DEFAULT_RES - timeEndPeriod(1); - #endif - } - - void start() - { - if(!m_start) - m_start = timeGetTime(); - } - - const time_duration_type& elapsed() const - { - if(m_start) - { - uint32_t current = timeGetTime(); - int64_t milliseconds = current - m_start; - m_elapsed += posix_time::milliseconds(milliseconds); - m_start = current; - } - return m_elapsed; - } - - void reset() - { - m_elapsed = time_duration_type(0,0,0); - m_start = 0; - } - - - private: - - mutable uint32_t m_start; - mutable time_duration_type m_elapsed; - -}; - -} // namespace win32 -} // namespace timers -} // namespace boost - -#endif // _BOOST_TIMERS_WIN32_TGT_DEVICE_HPP