timer_queue_ptime.ipp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //
  2. // detail/impl/timer_queue_ptime.ipp
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2018 Christopher M. Kohlhoff (chris at kohlhoff dot com)
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. #ifndef BOOST_ASIO_DETAIL_IMPL_TIMER_QUEUE_PTIME_IPP
  11. #define BOOST_ASIO_DETAIL_IMPL_TIMER_QUEUE_PTIME_IPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include <boost/asio/detail/config.hpp>
  16. #if defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
  17. #include <boost/asio/detail/timer_queue_ptime.hpp>
  18. #include <boost/asio/detail/push_options.hpp>
  19. namespace boost {
  20. namespace asio {
  21. namespace detail {
  22. timer_queue<time_traits<boost::posix_time::ptime> >::timer_queue()
  23. {
  24. }
  25. timer_queue<time_traits<boost::posix_time::ptime> >::~timer_queue()
  26. {
  27. }
  28. bool timer_queue<time_traits<boost::posix_time::ptime> >::enqueue_timer(
  29. const time_type& time, per_timer_data& timer, wait_op* op)
  30. {
  31. return impl_.enqueue_timer(time, timer, op);
  32. }
  33. bool timer_queue<time_traits<boost::posix_time::ptime> >::empty() const
  34. {
  35. return impl_.empty();
  36. }
  37. long timer_queue<time_traits<boost::posix_time::ptime> >::wait_duration_msec(
  38. long max_duration) const
  39. {
  40. return impl_.wait_duration_msec(max_duration);
  41. }
  42. long timer_queue<time_traits<boost::posix_time::ptime> >::wait_duration_usec(
  43. long max_duration) const
  44. {
  45. return impl_.wait_duration_usec(max_duration);
  46. }
  47. void timer_queue<time_traits<boost::posix_time::ptime> >::get_ready_timers(
  48. op_queue<operation>& ops)
  49. {
  50. impl_.get_ready_timers(ops);
  51. }
  52. void timer_queue<time_traits<boost::posix_time::ptime> >::get_all_timers(
  53. op_queue<operation>& ops)
  54. {
  55. impl_.get_all_timers(ops);
  56. }
  57. std::size_t timer_queue<time_traits<boost::posix_time::ptime> >::cancel_timer(
  58. per_timer_data& timer, op_queue<operation>& ops, std::size_t max_cancelled)
  59. {
  60. return impl_.cancel_timer(timer, ops, max_cancelled);
  61. }
  62. void timer_queue<time_traits<boost::posix_time::ptime> >::move_timer(
  63. per_timer_data& target, per_timer_data& source)
  64. {
  65. impl_.move_timer(target, source);
  66. }
  67. } // namespace detail
  68. } // namespace asio
  69. } // namespace boost
  70. #include <boost/asio/detail/pop_options.hpp>
  71. #endif // defined(BOOST_ASIO_HAS_BOOST_DATE_TIME)
  72. #endif // BOOST_ASIO_DETAIL_IMPL_TIMER_QUEUE_PTIME_IPP