Clementine
timer_queue_set.hpp
1 //
2 // detail/timer_queue_set.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2020 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_SET_HPP
12 #define ASIO_DETAIL_TIMER_QUEUE_SET_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include "asio/detail/config.hpp"
19 #include "asio/detail/timer_queue_base.hpp"
20 
21 #include "asio/detail/push_options.hpp"
22 
23 namespace asio {
24 namespace detail {
25 
27 {
28 public:
29  // Constructor.
30  ASIO_DECL timer_queue_set();
31 
32  // Add a timer queue to the set.
33  ASIO_DECL void insert(timer_queue_base* q);
34 
35  // Remove a timer queue from the set.
36  ASIO_DECL void erase(timer_queue_base* q);
37 
38  // Determine whether all queues are empty.
39  ASIO_DECL bool all_empty() const;
40 
41  // Get the wait duration in milliseconds.
42  ASIO_DECL long wait_duration_msec(long max_duration) const;
43 
44  // Get the wait duration in microseconds.
45  ASIO_DECL long wait_duration_usec(long max_duration) const;
46 
47  // Dequeue all ready timers.
48  ASIO_DECL void get_ready_timers(op_queue<operation>& ops);
49 
50  // Dequeue all timers.
51  ASIO_DECL void get_all_timers(op_queue<operation>& ops);
52 
53 private:
54  timer_queue_base* first_;
55 };
56 
57 } // namespace detail
58 } // namespace asio
59 
60 #include "asio/detail/pop_options.hpp"
61 
62 #if defined(ASIO_HEADER_ONLY)
63 # include "asio/detail/impl/timer_queue_set.ipp"
64 #endif // defined(ASIO_HEADER_ONLY)
65 
66 #endif // ASIO_DETAIL_TIMER_QUEUE_SET_HPP
Definition: timer_queue_set.hpp:26
Definition: chrono.h:284
Definition: timer_queue_base.hpp:28
Definition: any_io_executor.hpp:28