File indexing completed on 2025-01-18 09:28:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_ASIO_DETAIL_SCHEDULER_OPERATION_HPP
0012 #define BOOST_ASIO_DETAIL_SCHEDULER_OPERATION_HPP
0013
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif
0017
0018 #include <boost/system/error_code.hpp>
0019 #include <boost/asio/detail/handler_tracking.hpp>
0020 #include <boost/asio/detail/op_queue.hpp>
0021
0022 #include <boost/asio/detail/push_options.hpp>
0023
0024 namespace boost {
0025 namespace asio {
0026 namespace detail {
0027
0028 class scheduler;
0029
0030
0031
0032 class scheduler_operation BOOST_ASIO_INHERIT_TRACKED_HANDLER
0033 {
0034 public:
0035 typedef scheduler_operation operation_type;
0036
0037 void complete(void* owner, const boost::system::error_code& ec,
0038 std::size_t bytes_transferred)
0039 {
0040 func_(owner, this, ec, bytes_transferred);
0041 }
0042
0043 void destroy()
0044 {
0045 func_(0, this, boost::system::error_code(), 0);
0046 }
0047
0048 protected:
0049 typedef void (*func_type)(void*,
0050 scheduler_operation*,
0051 const boost::system::error_code&, std::size_t);
0052
0053 scheduler_operation(func_type func)
0054 : next_(0),
0055 func_(func),
0056 task_result_(0)
0057 {
0058 }
0059
0060
0061 ~scheduler_operation()
0062 {
0063 }
0064
0065 private:
0066 friend class op_queue_access;
0067 scheduler_operation* next_;
0068 func_type func_;
0069 protected:
0070 friend class scheduler;
0071 unsigned int task_result_;
0072 };
0073
0074 }
0075 }
0076 }
0077
0078 #include <boost/asio/detail/pop_options.hpp>
0079
0080 #endif