2 // detail/win_iocp_operation.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com)
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)
11 #ifndef BOOST_ASIO_DETAIL_WIN_IOCP_OPERATION_HPP
12 #define BOOST_ASIO_DETAIL_WIN_IOCP_OPERATION_HPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
20 #if defined(BOOST_ASIO_HAS_IOCP)
22 #include <boost/asio/detail/handler_tracking.hpp>
23 #include <boost/asio/detail/op_queue.hpp>
24 #include <boost/asio/detail/socket_types.hpp>
25 #include <boost/system/error_code.hpp>
27 #include <boost/asio/detail/push_options.hpp>
33 class win_iocp_io_service;
35 // Base class for all operations. A function pointer is used instead of virtual
36 // functions to avoid the associated overhead.
37 class win_iocp_operation
39 BOOST_ASIO_ALSO_INHERIT_TRACKED_HANDLER
42 void complete(win_iocp_io_service& owner,
43 const boost::system::error_code& ec,
44 std::size_t bytes_transferred)
46 func_(&owner, this, ec, bytes_transferred);
51 func_(0, this, boost::system::error_code(), 0);
55 typedef void (*func_type)(
56 win_iocp_io_service*, win_iocp_operation*,
57 const boost::system::error_code&, std::size_t);
59 win_iocp_operation(func_type func)
66 // Prevents deletion through this type.
82 friend class op_queue_access;
83 friend class win_iocp_io_service;
84 win_iocp_operation* next_;
93 #include <boost/asio/detail/pop_options.hpp>
95 #endif // defined(BOOST_ASIO_HAS_IOCP)
97 #endif // BOOST_ASIO_DETAIL_WIN_IOCP_OPERATION_HPP