Provides Windows handle functionality. More...
#include <basic_handle.hpp>
Public Types | |
typedef basic_handle < HandleService > | lowest_layer_type |
A basic_handle is always the lowest layer. | |
typedef HandleService::native_type | native_type |
The native representation of a handle. | |
Public Member Functions | |
void | assign (const native_type &native_handle) |
Assign an existing native handle to the handle. | |
asio::error_code | assign (const native_type &native_handle, asio::error_code &ec) |
Assign an existing native handle to the handle. | |
basic_handle (asio::io_service &io_service) | |
Construct a basic_handle without opening it. | |
basic_handle (asio::io_service &io_service, const native_type &native_handle) | |
Construct a basic_handle on an existing native handle. | |
void | cancel () |
Cancel all asynchronous operations associated with the handle. | |
asio::error_code | cancel (asio::error_code &ec) |
Cancel all asynchronous operations associated with the handle. | |
void | close () |
Close the handle. | |
asio::error_code | close (asio::error_code &ec) |
Close the handle. | |
bool | is_open () const |
Determine whether the handle is open. | |
lowest_layer_type & | lowest_layer () |
Get a reference to the lowest layer. | |
native_type | native () |
Get the native handle representation. | |
Protected Member Functions | |
~basic_handle () | |
Protected destructor to prevent deletion through this type. |
Provides Windows handle functionality.
The windows::basic_handle class template provides the ability to wrap a Windows handle.
Definition at line 41 of file basic_handle.hpp.
typedef basic_handle<HandleService> asio::windows::basic_handle< HandleService >::lowest_layer_type |
A basic_handle is always the lowest layer.
Definition at line 49 of file basic_handle.hpp.
typedef HandleService::native_type asio::windows::basic_handle< HandleService >::native_type |
The native representation of a handle.
Definition at line 46 of file basic_handle.hpp.
asio::windows::basic_handle< HandleService >::basic_handle | ( | asio::io_service & | io_service | ) | [inline, explicit] |
Construct a basic_handle without opening it.
This constructor creates a handle without opening it.
io_service | The io_service object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle. |
Definition at line 58 of file basic_handle.hpp.
asio::windows::basic_handle< HandleService >::basic_handle | ( | asio::io_service & | io_service, |
const native_type & | native_handle | ||
) | [inline] |
Construct a basic_handle on an existing native handle.
This constructor creates a handle object to hold an existing native handle.
io_service | The io_service object that the handle will use to dispatch handlers for any asynchronous operations performed on the handle. |
native_handle | A native handle. |
asio::system_error | Thrown on failure. |
Definition at line 74 of file basic_handle.hpp.
asio::windows::basic_handle< HandleService >::~basic_handle | ( | ) | [inline, protected] |
Protected destructor to prevent deletion through this type.
Definition at line 201 of file basic_handle.hpp.
void asio::windows::basic_handle< HandleService >::assign | ( | const native_type & | native_handle | ) | [inline] |
Assign an existing native handle to the handle.
Definition at line 105 of file basic_handle.hpp.
asio::error_code asio::windows::basic_handle< HandleService >::assign | ( | const native_type & | native_handle, |
asio::error_code & | ec | ||
) | [inline] |
Assign an existing native handle to the handle.
Definition at line 120 of file basic_handle.hpp.
void asio::windows::basic_handle< HandleService >::cancel | ( | ) | [inline] |
Cancel all asynchronous operations associated with the handle.
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.
asio::system_error | Thrown on failure. |
Definition at line 179 of file basic_handle.hpp.
asio::error_code asio::windows::basic_handle< HandleService >::cancel | ( | asio::error_code & | ec | ) | [inline] |
Cancel all asynchronous operations associated with the handle.
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.
ec | Set to indicate what error occurred, if any. |
Definition at line 194 of file basic_handle.hpp.
void asio::windows::basic_handle< HandleService >::close | ( | ) | [inline] |
Close the handle.
This function is used to close the handle. Any asynchronous read or write operations will be cancelled immediately, and will complete with the asio::error::operation_aborted error.
asio::system_error | Thrown on failure. |
Definition at line 140 of file basic_handle.hpp.
asio::error_code asio::windows::basic_handle< HandleService >::close | ( | asio::error_code & | ec | ) | [inline] |
Close the handle.
This function is used to close the handle. Any asynchronous read or write operations will be cancelled immediately, and will complete with the asio::error::operation_aborted error.
ec | Set to indicate what error occurred, if any. |
Definition at line 155 of file basic_handle.hpp.
bool asio::windows::basic_handle< HandleService >::is_open | ( | ) | const [inline] |
Determine whether the handle is open.
Definition at line 127 of file basic_handle.hpp.
lowest_layer_type& asio::windows::basic_handle< HandleService >::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_handle cannot contain any further layers, it simply returns a reference to itself.
Definition at line 92 of file basic_handle.hpp.
native_type asio::windows::basic_handle< HandleService >::native | ( | ) | [inline] |
Get the native handle representation.
This function may be used to obtain the underlying representation of the handle. This is intended to allow access to native handle functionality that is not otherwise provided.
Definition at line 166 of file basic_handle.hpp.