2 // detail/timer_queue_base.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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)
11 #ifndef BOOST_ASIO_DETAIL_TIMER_QUEUE_BASE_HPP
12 #define BOOST_ASIO_DETAIL_TIMER_QUEUE_BASE_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
19 #include <boost/asio/detail/noncopyable.hpp>
20 #include <boost/asio/detail/op_queue.hpp>
21 #include <boost/asio/detail/operation.hpp>
23 #include <boost/asio/detail/push_options.hpp>
29 class timer_queue_base
34 timer_queue_base() : next_(0) {}
37 virtual ~timer_queue_base() {}
39 // Whether there are no timers in the queue.
40 virtual bool empty() const = 0;
42 // Get the time to wait until the next timer.
43 virtual long wait_duration_msec(long max_duration) const = 0;
45 // Get the time to wait until the next timer.
46 virtual long wait_duration_usec(long max_duration) const = 0;
48 // Dequeue all ready timers.
49 virtual void get_ready_timers(op_queue<operation>& ops) = 0;
51 // Dequeue all timers.
52 virtual void get_all_timers(op_queue<operation>& ops) = 0;
55 friend class timer_queue_set;
57 // Next timer queue in the set.
58 timer_queue_base* next_;
61 template <typename Time_Traits>
68 #include <boost/asio/detail/pop_options.hpp>
70 #endif // BOOST_ASIO_DETAIL_TIMER_QUEUE_BASE_HPP