11 #ifndef ASIO_POSIX_STREAM_DESCRIPTOR_SERVICE_HPP 12 #define ASIO_POSIX_STREAM_DESCRIPTOR_SERVICE_HPP 14 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 20 #if defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) \ 21 || defined(GENERATING_DOCUMENTATION) 35 class stream_descriptor_service
36 #if defined(GENERATING_DOCUMENTATION)
43 #if defined(GENERATING_DOCUMENTATION) 50 typedef detail::reactive_descriptor_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_descriptor_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_descriptor_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);
112 const native_handle_type& native_descriptor,
115 return service_impl_.assign(impl, native_descriptor, ec);
119 bool is_open(
const implementation_type& impl)
const 121 return service_impl_.is_open(impl);
128 return service_impl_.close(impl, ec);
133 native_type native(implementation_type& impl)
135 return service_impl_.native_handle(impl);
139 native_handle_type native_handle(implementation_type& impl)
141 return service_impl_.native_handle(impl);
145 native_handle_type release(implementation_type& impl)
147 return service_impl_.release(impl);
154 return service_impl_.cancel(impl, ec);
158 template <
typename IoControlCommand>
162 return service_impl_.io_control(impl, command, ec);
166 bool non_blocking(
const implementation_type& impl)
const 168 return service_impl_.non_blocking(impl);
175 return service_impl_.non_blocking(impl, mode, ec);
179 bool native_non_blocking(
const implementation_type& impl)
const 181 return service_impl_.native_non_blocking(impl);
188 return service_impl_.native_non_blocking(impl, mode, ec);
192 template <
typename ConstBufferSequence>
193 std::size_t write_some(implementation_type& impl,
196 return service_impl_.write_some(impl, buffers, ec);
200 template <
typename ConstBufferSequence,
typename WriteHandler>
203 async_write_some(implementation_type& impl,
204 const ConstBufferSequence& buffers,
211 service_impl_.async_write_some(impl, buffers,
init.handler);
213 return init.result.get();
217 template <
typename MutableBufferSequence>
218 std::size_t read_some(implementation_type& impl,
221 return service_impl_.read_some(impl, buffers, ec);
225 template <
typename MutableBufferSequence,
typename ReadHandler>
228 async_read_some(implementation_type& impl,
229 const MutableBufferSequence& buffers,
236 service_impl_.async_read_some(impl, buffers,
init.handler);
238 return init.result.get();
243 void shutdown_service()
245 service_impl_.shutdown_service();
249 service_impl_type service_impl_;
257 #endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) 260 #endif // ASIO_POSIX_STREAM_DESCRIPTOR_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.