11 #ifndef ASIO_WINDOWS_STREAM_HANDLE_SERVICE_HPP 12 #define ASIO_WINDOWS_STREAM_HANDLE_SERVICE_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 20 #if defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) \ 21 || defined(GENERATING_DOCUMENTATION) 35 class stream_handle_service
36 #if defined(GENERATING_DOCUMENTATION)
43 #if defined(GENERATING_DOCUMENTATION) 50 typedef detail::win_iocp_handle_service service_impl_type;
54 #if defined(GENERATING_DOCUMENTATION) 55 typedef implementation_defined implementation_type;
57 typedef service_impl_type::implementation_type implementation_type;
61 #if defined(GENERATING_DOCUMENTATION) 62 typedef implementation_defined native_type;
64 typedef service_impl_type::native_handle_type native_type;
68 #if defined(GENERATING_DOCUMENTATION) 69 typedef implementation_defined native_handle_type;
71 typedef service_impl_type::native_handle_type native_handle_type;
76 :
asio::detail::service_base<stream_handle_service>(io_service),
77 service_impl_(io_service)
82 void construct(implementation_type& impl)
84 service_impl_.construct(impl);
87 #if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) 88 void move_construct(implementation_type& impl,
90 implementation_type& other_impl)
92 service_impl_.move_construct(impl, other_impl);
96 void move_assign(implementation_type& impl,
97 stream_handle_service& other_service,
98 implementation_type& other_impl)
100 service_impl_.move_assign(impl, other_service.service_impl_, other_impl);
102 #endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) 105 void destroy(implementation_type& impl)
107 service_impl_.destroy(impl);
114 return service_impl_.assign(impl, handle, ec);
118 bool is_open(
const implementation_type& impl)
const 120 return service_impl_.is_open(impl);
127 return service_impl_.close(impl, ec);
131 native_type native(implementation_type& impl)
133 return service_impl_.native_handle(impl);
137 native_handle_type native_handle(implementation_type& impl)
139 return service_impl_.native_handle(impl);
146 return service_impl_.cancel(impl, ec);
150 template <
typename ConstBufferSequence>
151 std::size_t write_some(implementation_type& impl,
154 return service_impl_.write_some(impl, buffers, ec);
158 template <
typename ConstBufferSequence,
typename WriteHandler>
161 async_write_some(implementation_type& impl,
162 const ConstBufferSequence& buffers,
169 service_impl_.async_write_some(impl, buffers,
init.handler);
171 return init.result.get();
175 template <
typename MutableBufferSequence>
176 std::size_t read_some(implementation_type& impl,
179 return service_impl_.read_some(impl, buffers, ec);
183 template <
typename MutableBufferSequence,
typename ReadHandler>
186 async_read_some(implementation_type& impl,
187 const MutableBufferSequence& buffers,
194 service_impl_.async_read_some(impl, buffers,
init.handler);
196 return init.result.get();
201 void shutdown_service()
203 service_impl_.shutdown_service();
207 service_impl_type service_impl_;
215 #endif // defined(ASIO_HAS_WINDOWS_STREAM_HANDLE) 218 #endif // ASIO_WINDOWS_STREAM_HANDLE_SERVICE_HPP Class used to uniquely identify a service.
Provides core I/O functionality.
asio::basic_streambuf< Allocator > MatchCondition enable_if< is_match_condition< MatchCondition >::value >::type *detail::async_result_init< ReadHandler, void(asio::error_code, std::size_t)> init(ASIO_MOVE_CAST(ReadHandler)(handler))
ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler, void(asio::error_code, Iterator)) async_connect(basic_socket< Protocol
const MutableBufferSequence & buffers
asio::basic_streambuf< Allocator > CompletionCondition ASIO_MOVE_ARG(ReadHandler) handler)
Class to represent an error code value.
ASIO_DECL int close(int d, state_type &state, asio::error_code &ec)
#define ASIO_MOVE_CAST(type)
Base class for all io_service services.