2 // timer_queue_base.hpp
3 // ~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2008 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/push_options.hpp>
20 #include <boost/asio/detail/socket_types.hpp> // Must come before posix_time.
22 #include <boost/asio/detail/push_options.hpp>
23 #include <boost/date_time/posix_time/posix_time_types.hpp>
24 #include <boost/asio/detail/pop_options.hpp>
26 #include <boost/asio/detail/noncopyable.hpp>
32 class timer_queue_base
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 boost::posix_time::time_duration
wait_duration() const = 0;
45 // Dispatch all ready timers.
46 virtual void dispatch_timers() = 0;
48 // Dispatch any pending cancels for timers.
49 virtual void dispatch_cancellations() = 0;
51 // Complete all timers that are waiting to be completed.
52 virtual void complete_timers() = 0;
54 // Destroy all timers.
55 virtual void destroy_timers() = 0;
62 #include <boost/asio/detail/pop_options.hpp>
64 #endif // BOOST_ASIO_DETAIL_TIMER_QUEUE_BASE_HPP