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