Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-15 09:43:52

0001 //
0002 // detail/timer_queue_base.hpp
0003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~
0004 //
0005 // Copyright (c) 2003-2025 Christopher M. Kohlhoff (chris at kohlhoff dot com)
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009 //
0010 
0011 #ifndef BOOST_ASIO_DETAIL_TIMER_QUEUE_BASE_HPP
0012 #define BOOST_ASIO_DETAIL_TIMER_QUEUE_BASE_HPP
0013 
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
0017 
0018 #include <boost/asio/detail/config.hpp>
0019 #include <boost/asio/detail/noncopyable.hpp>
0020 #include <boost/asio/detail/op_queue.hpp>
0021 #include <boost/asio/detail/operation.hpp>
0022 
0023 #include <boost/asio/detail/push_options.hpp>
0024 
0025 namespace boost {
0026 namespace asio {
0027 namespace detail {
0028 
0029 class timer_queue_base
0030   : private noncopyable
0031 {
0032 public:
0033   // Constructor.
0034   timer_queue_base() : next_(0) {}
0035 
0036   // Destructor.
0037   virtual ~timer_queue_base() {}
0038 
0039   // Whether there are no timers in the queue.
0040   virtual bool empty() const = 0;
0041 
0042   // Get the time to wait until the next timer.
0043   virtual long wait_duration_msec(long max_duration) const = 0;
0044 
0045   // Get the time to wait until the next timer.
0046   virtual long wait_duration_usec(long max_duration) const = 0;
0047 
0048   // Dequeue all ready timers.
0049   virtual void get_ready_timers(op_queue<operation>& ops) = 0;
0050 
0051   // Dequeue all timers.
0052   virtual void get_all_timers(op_queue<operation>& ops) = 0;
0053 
0054 private:
0055   friend class timer_queue_set;
0056 
0057   // Next timer queue in the set.
0058   timer_queue_base* next_;
0059 };
0060 
0061 template <typename Time_Traits>
0062 class timer_queue;
0063 
0064 } // namespace detail
0065 } // namespace asio
0066 } // namespace boost
0067 
0068 #include <boost/asio/detail/pop_options.hpp>
0069 
0070 #endif // BOOST_ASIO_DETAIL_TIMER_QUEUE_BASE_HPP