Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:43:11

0001 //
0002 // detail/scheduler_task.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_SCHEDULER_TASK_HPP
0012 #define BOOST_ASIO_DETAIL_SCHEDULER_TASK_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/op_queue.hpp>
0019 
0020 #include <boost/asio/detail/push_options.hpp>
0021 
0022 namespace boost {
0023 namespace asio {
0024 namespace detail {
0025 
0026 class scheduler_operation;
0027 
0028 // Base class for all tasks that may be run by a scheduler.
0029 class scheduler_task
0030 {
0031 public:
0032   // Run the task once until interrupted or events are ready to be dispatched.
0033   virtual void run(long usec, op_queue<scheduler_operation>& ops) = 0;
0034 
0035   // Interrupt the task.
0036   virtual void interrupt() = 0;
0037 
0038 protected:
0039   // Prevent deletion through this type.
0040   ~scheduler_task()
0041   {
0042   }
0043 };
0044 
0045 } // namespace detail
0046 } // namespace asio
0047 } // namespace boost
0048 
0049 #include <boost/asio/detail/pop_options.hpp>
0050 
0051 #endif // BOOST_ASIO_DETAIL_SCHEDULER_TASK_HPP