12 #ifndef ASIO_DETAIL_WIN_IOCP_SERIAL_PORT_SERVICE_HPP 13 #define ASIO_DETAIL_WIN_IOCP_SERIAL_PORT_SERVICE_HPP 15 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 17 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 21 #if defined(ASIO_HAS_IOCP) && defined(ASIO_HAS_SERIAL_PORT) 34 class win_iocp_serial_port_service
38 typedef win_iocp_handle_service::native_handle_type native_handle_type;
41 typedef win_iocp_handle_service::implementation_type implementation_type;
51 void construct(implementation_type& impl)
53 handle_service_.construct(impl);
57 void move_construct(implementation_type& impl,
58 implementation_type& other_impl)
60 handle_service_.move_construct(impl, other_impl);
64 void move_assign(implementation_type& impl,
65 win_iocp_serial_port_service& other_service,
66 implementation_type& other_impl)
68 handle_service_.move_assign(impl,
69 other_service.handle_service_, other_impl);
73 void destroy(implementation_type& impl)
75 handle_service_.destroy(impl);
86 return handle_service_.assign(impl, handle, ec);
90 bool is_open(
const implementation_type& impl)
const 92 return handle_service_.is_open(impl);
99 return handle_service_.close(impl, ec);
103 native_handle_type native_handle(implementation_type& impl)
105 return handle_service_.native_handle(impl);
112 return handle_service_.cancel(impl, ec);
116 template <
typename SettableSerialPortOption>
120 return do_set_option(impl,
121 &win_iocp_serial_port_service::store_option<SettableSerialPortOption>,
126 template <
typename GettableSerialPortOption>
130 return do_get_option(impl,
131 &win_iocp_serial_port_service::load_option<GettableSerialPortOption>,
144 template <
typename ConstBufferSequence>
145 size_t write_some(implementation_type& impl,
148 return handle_service_.write_some(impl, buffers, ec);
153 template <
typename ConstBufferSequence,
typename Handler>
154 void async_write_some(implementation_type& impl,
155 const ConstBufferSequence& buffers, Handler& handler)
157 handle_service_.async_write_some(impl, buffers, handler);
161 template <
typename MutableBufferSequence>
162 size_t read_some(implementation_type& impl,
165 return handle_service_.read_some(impl, buffers, ec);
170 template <
typename MutableBufferSequence,
typename Handler>
171 void async_read_some(implementation_type& impl,
172 const MutableBufferSequence& buffers, Handler& handler)
174 handle_service_.async_read_some(impl, buffers, handler);
183 template <
typename SettableSerialPortOption>
187 return static_cast<const SettableSerialPortOption*
>(option)->store(
193 implementation_type& impl, store_function_type store,
201 template <
typename GettableSerialPortOption>
205 return static_cast<GettableSerialPortOption*
>(option)->load(storage, ec);
210 const implementation_type& impl, load_function_type load,
214 win_iocp_handle_service handle_service_;
222 #if defined(ASIO_HEADER_ONLY) 224 #endif // defined(ASIO_HEADER_ONLY) 226 #endif // defined(ASIO_HAS_IOCP) && defined(ASIO_HAS_SERIAL_PORT) 228 #endif // ASIO_DETAIL_WIN_IOCP_SERIAL_PORT_SERVICE_HPP Provides core I/O functionality.
const MutableBufferSequence & buffers
Class to represent an error code value.
ASIO_DECL int close(int d, state_type &state, asio::error_code &ec)
ASIO_DECL int open(const char *path, int flags, asio::error_code &ec)