1//
2// detail/timer_queue_base.hpp
3// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
4//
5// Copyright (c) 2003-2015 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
11#ifndef ASIO_DETAIL_TIMER_QUEUE_BASE_HPP
12#define ASIO_DETAIL_TIMER_QUEUE_BASE_HPP
13
14
15#include "asio/detail/config.hpp"
16#include "asio/detail/noncopyable.hpp"
17#include "asio/detail/op_queue.hpp"
18#include "asio/detail/operation.hpp"
19
20#include "asio/detail/push_options.hpp"
21
22namespace asio {
23namespace detail {
24
25class timer_queue_base
26  : private noncopyable
27{
28public:
29  // Constructor.
30  timer_queue_base() : next_(0) {}
31
32  // Destructor.
33  virtual ~timer_queue_base() {}
34
35  // Whether there are no timers in the queue.
36  virtual bool empty() const = 0;
37
38  // Get the time to wait until the next timer.
39  virtual long wait_duration_msec(long max_duration) const = 0;
40
41  // Get the time to wait until the next timer.
42  virtual long wait_duration_usec(long max_duration) const = 0;
43
44  // Dequeue all ready timers.
45  virtual void get_ready_timers(op_queue<operation>& ops) = 0;
46
47  // Dequeue all timers.
48  virtual void get_all_timers(op_queue<operation>& ops) = 0;
49
50private:
51  friend class timer_queue_set;
52
53  // Next timer queue in the set.
54  timer_queue_base* next_;
55};
56
57template <typename Time_Traits>
58class timer_queue;
59
60} // namespace detail
61} // namespace asio
62
63#include "asio/detail/pop_options.hpp"
64
65#endif // ASIO_DETAIL_TIMER_QUEUE_BASE_HPP
66