All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Protected Member Functions
asio::posix::basic_descriptor< DescriptorService > Class Template Reference

Provides POSIX descriptor functionality. More...

#include <basic_descriptor.hpp>

Inheritance diagram for asio::posix::basic_descriptor< DescriptorService >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef basic_descriptor
< DescriptorService > 
lowest_layer_type
 A basic_descriptor is always the lowest layer.
typedef
DescriptorService::native_type 
native_type
 The native representation of a descriptor.

Public Member Functions

void assign (const native_type &native_descriptor)
 Assign an existing native descriptor to the descriptor.
asio::error_code assign (const native_type &native_descriptor, asio::error_code &ec)
 Assign an existing native descriptor to the descriptor.
 basic_descriptor (asio::io_service &io_service)
 Construct a basic_descriptor without opening it.
 basic_descriptor (asio::io_service &io_service, const native_type &native_descriptor)
 Construct a basic_descriptor on an existing native descriptor.
void cancel ()
 Cancel all asynchronous operations associated with the descriptor.
asio::error_code cancel (asio::error_code &ec)
 Cancel all asynchronous operations associated with the descriptor.
void close ()
 Close the descriptor.
asio::error_code close (asio::error_code &ec)
 Close the descriptor.
template<typename IoControlCommand >
void io_control (IoControlCommand &command)
 Perform an IO control command on the descriptor.
template<typename IoControlCommand >
asio::error_code io_control (IoControlCommand &command, asio::error_code &ec)
 Perform an IO control command on the descriptor.
bool is_open () const
 Determine whether the descriptor is open.
lowest_layer_typelowest_layer ()
 Get a reference to the lowest layer.
native_type native ()
 Get the native descriptor representation.

Protected Member Functions

 ~basic_descriptor ()
 Protected destructor to prevent deletion through this type.

Detailed Description

template<typename DescriptorService>
class asio::posix::basic_descriptor< DescriptorService >

Provides POSIX descriptor functionality.

The posix::basic_descriptor class template provides the ability to wrap a POSIX descriptor.

Thread Safety
Distinct objects: Safe.
Shared objects: Unsafe.

Definition at line 42 of file basic_descriptor.hpp.


Member Typedef Documentation

template<typename DescriptorService >
typedef basic_descriptor<DescriptorService> asio::posix::basic_descriptor< DescriptorService >::lowest_layer_type

A basic_descriptor is always the lowest layer.

Definition at line 51 of file basic_descriptor.hpp.

template<typename DescriptorService >
typedef DescriptorService::native_type asio::posix::basic_descriptor< DescriptorService >::native_type

The native representation of a descriptor.

Definition at line 48 of file basic_descriptor.hpp.


Constructor & Destructor Documentation

template<typename DescriptorService >
asio::posix::basic_descriptor< DescriptorService >::basic_descriptor ( asio::io_service io_service) [inline, explicit]

Construct a basic_descriptor without opening it.

This constructor creates a descriptor without opening it.

Parameters:
io_serviceThe io_service object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.

Definition at line 61 of file basic_descriptor.hpp.

template<typename DescriptorService >
asio::posix::basic_descriptor< DescriptorService >::basic_descriptor ( asio::io_service io_service,
const native_type native_descriptor 
) [inline]

Construct a basic_descriptor on an existing native descriptor.

This constructor creates a descriptor object to hold an existing native descriptor.

Parameters:
io_serviceThe io_service object that the descriptor will use to dispatch handlers for any asynchronous operations performed on the descriptor.
native_descriptorA native descriptor.
Exceptions:
asio::system_errorThrown on failure.

Definition at line 79 of file basic_descriptor.hpp.

template<typename DescriptorService >
asio::posix::basic_descriptor< DescriptorService >::~basic_descriptor ( ) [inline, protected]

Protected destructor to prevent deletion through this type.

Definition at line 270 of file basic_descriptor.hpp.


Member Function Documentation

template<typename DescriptorService >
void asio::posix::basic_descriptor< DescriptorService >::assign ( const native_type native_descriptor) [inline]

Assign an existing native descriptor to the descriptor.

Definition at line 110 of file basic_descriptor.hpp.

template<typename DescriptorService >
asio::error_code asio::posix::basic_descriptor< DescriptorService >::assign ( const native_type native_descriptor,
asio::error_code ec 
) [inline]

Assign an existing native descriptor to the descriptor.

Definition at line 125 of file basic_descriptor.hpp.

template<typename DescriptorService >
void asio::posix::basic_descriptor< DescriptorService >::cancel ( ) [inline]

Cancel all asynchronous operations associated with the descriptor.

This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the asio::error::operation_aborted error.

Exceptions:
asio::system_errorThrown on failure.

Definition at line 184 of file basic_descriptor.hpp.

template<typename DescriptorService >
asio::error_code asio::posix::basic_descriptor< DescriptorService >::cancel ( asio::error_code ec) [inline]

Cancel all asynchronous operations associated with the descriptor.

This function causes all outstanding asynchronous read or write operations to finish immediately, and the handlers for cancelled operations will be passed the asio::error::operation_aborted error.

Parameters:
ecSet to indicate what error occurred, if any.

Definition at line 199 of file basic_descriptor.hpp.

template<typename DescriptorService >
void asio::posix::basic_descriptor< DescriptorService >::close ( ) [inline]

Close the descriptor.

This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the asio::error::operation_aborted error.

Exceptions:
asio::system_errorThrown on failure.

Definition at line 145 of file basic_descriptor.hpp.

template<typename DescriptorService >
asio::error_code asio::posix::basic_descriptor< DescriptorService >::close ( asio::error_code ec) [inline]

Close the descriptor.

This function is used to close the descriptor. Any asynchronous read or write operations will be cancelled immediately, and will complete with the asio::error::operation_aborted error.

Parameters:
ecSet to indicate what error occurred, if any.

Definition at line 160 of file basic_descriptor.hpp.

template<typename DescriptorService >
template<typename IoControlCommand >
void asio::posix::basic_descriptor< DescriptorService >::io_control ( IoControlCommand &  command) [inline]

Perform an IO control command on the descriptor.

This function is used to execute an IO control command on the descriptor.

Parameters:
commandThe IO control command to be performed on the descriptor.
Exceptions:
asio::system_errorThrown on failure.
See also:
IoControlCommand
asio::posix::descriptor_base::bytes_readable
asio::posix::descriptor_base::non_blocking_io
Example
Getting the number of bytes ready to read:
 asio::posix::stream_descriptor descriptor(io_service);
 ...
 asio::posix::stream_descriptor::bytes_readable command;
 descriptor.io_control(command);
 std::size_t bytes_readable = command.get();

Definition at line 227 of file basic_descriptor.hpp.

template<typename DescriptorService >
template<typename IoControlCommand >
asio::error_code asio::posix::basic_descriptor< DescriptorService >::io_control ( IoControlCommand &  command,
asio::error_code ec 
) [inline]

Perform an IO control command on the descriptor.

This function is used to execute an IO control command on the descriptor.

Parameters:
commandThe IO control command to be performed on the descriptor.
ecSet to indicate what error occurred, if any.
See also:
IoControlCommand
asio::posix::descriptor_base::bytes_readable
asio::posix::descriptor_base::non_blocking_io
Example
Getting the number of bytes ready to read:
 asio::posix::stream_descriptor descriptor(io_service);
 ...
 asio::posix::stream_descriptor::bytes_readable command;
 asio::error_code ec;
 descriptor.io_control(command, ec);
 if (ec)
 {
   // An error occurred.
 }
 std::size_t bytes_readable = command.get();

Definition at line 262 of file basic_descriptor.hpp.

template<typename DescriptorService >
bool asio::posix::basic_descriptor< DescriptorService >::is_open ( ) const [inline]

Determine whether the descriptor is open.

Definition at line 132 of file basic_descriptor.hpp.

template<typename DescriptorService >
lowest_layer_type& asio::posix::basic_descriptor< DescriptorService >::lowest_layer ( ) [inline]

Get a reference to the lowest layer.

This function returns a reference to the lowest layer in a stack of layers. Since a basic_descriptor cannot contain any further layers, it simply returns a reference to itself.

Returns:
A reference to the lowest layer in the stack of layers. Ownership is not transferred to the caller.

Definition at line 97 of file basic_descriptor.hpp.

template<typename DescriptorService >
native_type asio::posix::basic_descriptor< DescriptorService >::native ( ) [inline]

Get the native descriptor representation.

This function may be used to obtain the underlying representation of the descriptor. This is intended to allow access to native descriptor functionality that is not otherwise provided.

Definition at line 171 of file basic_descriptor.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Castor
Author(s): Carpe Noctem
autogenerated on Fri Nov 8 2013 11:05:41