11 #ifndef ASIO_POSIX_BASIC_DESCRIPTOR_HPP 12 #define ASIO_POSIX_BASIC_DESCRIPTOR_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) 42 template <
typename DescriptorService>
43 class basic_descriptor
44 :
public basic_io_object<DescriptorService>,
45 public descriptor_base
50 typedef typename DescriptorService::native_handle_type native_type;
53 typedef typename DescriptorService::native_handle_type native_handle_type;
56 typedef basic_descriptor<DescriptorService> lowest_layer_type;
67 : basic_io_object<DescriptorService>(io_service)
85 const native_handle_type& native_descriptor)
86 : basic_io_object<DescriptorService>(io_service)
89 this->get_service().assign(this->get_implementation(),
90 native_descriptor, ec);
94 #if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) 105 basic_descriptor(basic_descriptor&& other)
106 : basic_io_object<DescriptorService>(
121 basic_descriptor& operator=(basic_descriptor&& other)
123 basic_io_object<DescriptorService>::operator=(
127 #endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION) 138 lowest_layer_type& lowest_layer()
152 const lowest_layer_type& lowest_layer()
const 165 void assign(
const native_handle_type& native_descriptor)
168 this->get_service().assign(this->get_implementation(),
169 native_descriptor, ec);
184 return this->get_service().assign(
185 this->get_implementation(), native_descriptor, ec);
191 return this->get_service().is_open(this->implementation);
206 this->get_service().close(this->get_implementation(), ec);
221 return this->get_service().close(this->get_implementation(), ec);
233 return this->get_service().native_handle(this->implementation);
242 native_handle_type native_handle()
244 return this->get_service().native_handle(this->implementation);
257 native_handle_type release()
259 return this->get_service().release(this->implementation);
273 this->get_service().cancel(this->get_implementation(), ec);
287 return this->get_service().cancel(this->get_implementation(), ec);
312 template <
typename IoControlCommand>
313 void io_control(IoControlCommand& command)
316 this->get_service().io_control(this->get_implementation(), command, ec);
347 template <
typename IoControlCommand>
351 return this->get_service().io_control(
352 this->get_implementation(), command, ec);
368 return this->get_service().non_blocking(this->implementation);
387 this->get_service().non_blocking(this->get_implementation(), mode, ec);
407 return this->get_service().non_blocking(
408 this->get_implementation(), mode, ec);
425 bool native_non_blocking()
const 427 return this->get_service().native_non_blocking(this->implementation);
445 void native_non_blocking(
bool mode)
448 this->get_service().native_non_blocking(
449 this->get_implementation(), mode, ec);
471 return this->get_service().native_non_blocking(
472 this->get_implementation(), mode, ec);
487 #endif // defined(ASIO_HAS_POSIX_STREAM_DESCRIPTOR) 490 #endif // ASIO_POSIX_BASIC_DESCRIPTOR_HPP void throw_error(const asio::error_code &err)
Provides core I/O functionality.
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)