$search

asio Namespace Reference

Namespaces

namespace  detail
namespace  error
namespace  ip
namespace  local
namespace  placeholders
namespace  posix
namespace  ssl
namespace  windows

Classes

class  basic_datagram_socket
 Provides datagram-oriented socket functionality. More...
class  basic_deadline_timer
 Provides waitable timer functionality. More...
class  basic_io_object
 Base class for all I/O objects. More...
class  basic_raw_socket
 Provides raw-oriented socket functionality. More...
class  basic_socket
 Provides socket functionality. More...
class  basic_socket_acceptor
 Provides the ability to accept new connections. More...
class  basic_socket_iostream
 Iostream interface for a socket. More...
class  basic_socket_streambuf
 Iostream streambuf for a socket. More...
class  basic_stream_socket
 Provides stream-oriented socket functionality. More...
class  basic_streambuf
 Automatically resizable buffer class based on std::streambuf. More...
class  buffered_read_stream
 Adds buffering to the read-related operations of a stream. More...
class  buffered_stream
 Adds buffering to the read- and write-related operations of a stream. More...
class  buffered_write_stream
 Adds buffering to the write-related operations of a stream. More...
class  buffers_iterator
 A random access iterator over the bytes in a buffer sequence. More...
class  const_buffer
 Holds a buffer that cannot be modified. More...
class  const_buffers_1
class  datagram_socket_service
 Default service implementation for a datagram socket. More...
class  deadline_timer_service
 Default service implementation for a timer. More...
class  error_code
 Class to represent an error code value. More...
class  invalid_service_owner
class  io_service
 Provides core I/O functionality. More...
struct  is_match_condition
class  is_read_buffered
class  is_write_buffered
class  mutable_buffer
 Holds a buffer that can be modified. More...
class  mutable_buffers_1
class  null_buffers
class  raw_socket_service
 Default service implementation for a raw socket. More...
class  serial_port_base
class  serial_port_service
 Default service implementation for a serial port. More...
class  service_already_exists
 Exception thrown when trying to add a duplicate service to an io_service. More...
class  socket_acceptor_service
 Default service implementation for a socket acceptor. More...
class  socket_base
class  stream_socket_service
 Default service implementation for a stream socket. More...
class  system_error
class  thread
 A simple abstraction for starting threads. More...
struct  time_traits< boost::posix_time::ptime >
 Time traits specialised for posix_time. More...

Typedefs

typedef basic_deadline_timer
< boost::posix_time::ptime > 
deadline_timer
 Typedef for the typical usage of timer.
typedef asio::error::error_category error_category
 Bring error category type into the asio namespace.
typedef asio::io_service::strand strand
 Typedef for backwards compatibility.
typedef basic_streambuf streambuf
 Typedef for the typical usage of basic_streambuf.

Functions

template<typename Service >
void add_service (io_service &ios, Service *svc)
void * asio_handler_allocate (std::size_t size,...)
 Default allocation function for handlers.
void asio_handler_deallocate (void *pointer, std::size_t size,...)
 Default deallocation function for handlers.
template<typename Function >
void asio_handler_invoke (Function function,...)
 Default invoke function for handlers.
template<typename AsyncReadStream , typename Allocator , typename CompletionCondition , typename ReadHandler >
void async_read (AsyncReadStream &s, basic_streambuf< Allocator > &b, CompletionCondition completion_condition, ReadHandler handler)
template<typename AsyncReadStream , typename Allocator , typename ReadHandler >
void async_read (AsyncReadStream &s, basic_streambuf< Allocator > &b, ReadHandler handler)
template<typename AsyncReadStream , typename MutableBufferSequence , typename CompletionCondition , typename ReadHandler >
void async_read (AsyncReadStream &s, const MutableBufferSequence &buffers, CompletionCondition completion_condition, ReadHandler handler)
template<typename AsyncReadStream , typename MutableBufferSequence , typename ReadHandler >
void async_read (AsyncReadStream &s, const MutableBufferSequence &buffers, ReadHandler handler)
template<typename AsyncRandomAccessReadDevice , typename Allocator , typename CompletionCondition , typename ReadHandler >
void async_read_at (AsyncRandomAccessReadDevice &d, boost::uint64_t offset, basic_streambuf< Allocator > &b, CompletionCondition completion_condition, ReadHandler handler)
template<typename AsyncRandomAccessReadDevice , typename Allocator , typename ReadHandler >
void async_read_at (AsyncRandomAccessReadDevice &d, boost::uint64_t offset, basic_streambuf< Allocator > &b, ReadHandler handler)
template<typename AsyncRandomAccessReadDevice , typename MutableBufferSequence , typename CompletionCondition , typename ReadHandler >
void async_read_at (AsyncRandomAccessReadDevice &d, boost::uint64_t offset, const MutableBufferSequence &buffers, CompletionCondition completion_condition, ReadHandler handler)
template<typename AsyncRandomAccessReadDevice , typename MutableBufferSequence , typename ReadHandler >
void async_read_at (AsyncRandomAccessReadDevice &d, boost::uint64_t offset, const MutableBufferSequence &buffers, ReadHandler handler)
template<typename AsyncReadStream , typename Allocator , typename MatchCondition , typename ReadHandler >
void async_read_until (AsyncReadStream &s, asio::basic_streambuf< Allocator > &b, MatchCondition match_condition, ReadHandler handler, typename boost::enable_if< is_match_condition< MatchCondition > >::type *=0)
template<typename AsyncReadStream , typename Allocator , typename ReadHandler >
void async_read_until (AsyncReadStream &s, asio::basic_streambuf< Allocator > &b, const boost::regex &expr, ReadHandler handler)
template<typename AsyncReadStream , typename Allocator , typename ReadHandler >
void async_read_until (AsyncReadStream &s, asio::basic_streambuf< Allocator > &b, const std::string &delim, ReadHandler handler)
template<typename AsyncReadStream , typename Allocator , typename ReadHandler >
void async_read_until (AsyncReadStream &s, asio::basic_streambuf< Allocator > &b, char delim, ReadHandler handler)
template<typename AsyncWriteStream , typename Allocator , typename CompletionCondition , typename WriteHandler >
void async_write (AsyncWriteStream &s, basic_streambuf< Allocator > &b, CompletionCondition completion_condition, WriteHandler handler)
template<typename AsyncWriteStream , typename Allocator , typename WriteHandler >
void async_write (AsyncWriteStream &s, basic_streambuf< Allocator > &b, WriteHandler handler)
template<typename AsyncWriteStream , typename ConstBufferSequence , typename CompletionCondition , typename WriteHandler >
void async_write (AsyncWriteStream &s, const ConstBufferSequence &buffers, CompletionCondition completion_condition, WriteHandler handler)
template<typename AsyncWriteStream , typename ConstBufferSequence , typename WriteHandler >
void async_write (AsyncWriteStream &s, const ConstBufferSequence &buffers, WriteHandler handler)
template<typename AsyncRandomAccessWriteDevice , typename Allocator , typename CompletionCondition , typename WriteHandler >
void async_write_at (AsyncRandomAccessWriteDevice &d, boost::uint64_t offset, basic_streambuf< Allocator > &b, CompletionCondition completion_condition, WriteHandler handler)
template<typename AsyncRandomAccessWriteDevice , typename Allocator , typename WriteHandler >
void async_write_at (AsyncRandomAccessWriteDevice &d, boost::uint64_t offset, basic_streambuf< Allocator > &b, WriteHandler handler)
template<typename AsyncRandomAccessWriteDevice , typename ConstBufferSequence , typename CompletionCondition , typename WriteHandler >
void async_write_at (AsyncRandomAccessWriteDevice &d, boost::uint64_t offset, const ConstBufferSequence &buffers, CompletionCondition completion_condition, WriteHandler handler)
template<typename AsyncRandomAccessWriteDevice , typename ConstBufferSequence , typename WriteHandler >
void async_write_at (AsyncRandomAccessWriteDevice &d, boost::uint64_t offset, const ConstBufferSequence &buffers, WriteHandler handler)
const_buffers_1 buffer (const std::string &data, std::size_t max_size_in_bytes)
 Create a new non-modifiable buffer that represents the given string.
const_buffers_1 buffer (const std::string &data)
 Create a new non-modifiable buffer that represents the given string.
template<typename PodType , typename Allocator >
const_buffers_1 buffer (const std::vector< PodType, Allocator > &data, std::size_t max_size_in_bytes)
 Create a new non-modifiable buffer that represents the given POD vector.
template<typename PodType , typename Allocator >
const_buffers_1 buffer (const std::vector< PodType, Allocator > &data)
 Create a new non-modifiable buffer that represents the given POD vector.
template<typename PodType , typename Allocator >
mutable_buffers_1 buffer (std::vector< PodType, Allocator > &data, std::size_t max_size_in_bytes)
 Create a new modifiable buffer that represents the given POD vector.
template<typename PodType , typename Allocator >
mutable_buffers_1 buffer (std::vector< PodType, Allocator > &data)
 Create a new modifiable buffer that represents the given POD vector.
template<typename PodType , std::size_t N>
const_buffers_1 buffer (boost::array< const PodType, N > &data, std::size_t max_size_in_bytes)
 Create a new non-modifiable buffer that represents the given POD array.
template<typename PodType , std::size_t N>
const_buffers_1 buffer (boost::array< const PodType, N > &data)
 Create a new non-modifiable buffer that represents the given POD array.
template<typename PodType , std::size_t N>
mutable_buffers_1 buffer (boost::array< PodType, N > &data, std::size_t max_size_in_bytes)
 Create a new modifiable buffer that represents the given POD array.
template<typename PodType , std::size_t N>
mutable_buffers_1 buffer (boost::array< PodType, N > &data)
 Create a new modifiable buffer that represents the given POD array.
template<typename PodType , std::size_t N>
const_buffers_1 buffer (const PodType(&data)[N], std::size_t max_size_in_bytes)
 Create a new non-modifiable buffer that represents the given POD array.
template<typename PodType , std::size_t N>
const_buffers_1 buffer (const PodType(&data)[N])
 Create a new non-modifiable buffer that represents the given POD array.
template<typename PodType , std::size_t N>
mutable_buffers_1 buffer (PodType(&data)[N], std::size_t max_size_in_bytes)
 Create a new modifiable buffer that represents the given POD array.
template<typename PodType , std::size_t N>
mutable_buffers_1 buffer (PodType(&data)[N])
 Create a new modifiable buffer that represents the given POD array.
const_buffers_1 buffer (const void *data, std::size_t size_in_bytes)
 Create a new non-modifiable buffer that represents the given memory range.
mutable_buffers_1 buffer (void *data, std::size_t size_in_bytes)
 Create a new modifiable buffer that represents the given memory range.
const_buffers_1 buffer (const const_buffer &b, std::size_t max_size_in_bytes)
 Create a new non-modifiable buffer from an existing buffer.
const_buffers_1 buffer (const const_buffer &b)
 Create a new non-modifiable buffer from an existing buffer.
mutable_buffers_1 buffer (const mutable_buffer &b, std::size_t max_size_in_bytes)
 Create a new modifiable buffer from an existing buffer.
mutable_buffers_1 buffer (const mutable_buffer &b)
 Create a new modifiable buffer from an existing buffer.
template<typename BufferSequence >
buffers_iterator< BufferSequence > buffers_begin (const BufferSequence &buffers)
 Construct an iterator representing the beginning of the buffers' data.
template<typename BufferSequence >
buffers_iterator< BufferSequence > buffers_end (const BufferSequence &buffers)
 Construct an iterator representing the end of the buffers' data.
template<typename Service >
bool has_service (io_service &ios)
template<typename SyncReadStream , typename Allocator , typename CompletionCondition >
std::size_t read (SyncReadStream &s, basic_streambuf< Allocator > &b, CompletionCondition completion_condition, asio::error_code &ec)
 Attempt to read a certain amount of data from a stream before returning.
template<typename SyncReadStream , typename Allocator , typename CompletionCondition >
std::size_t read (SyncReadStream &s, basic_streambuf< Allocator > &b, CompletionCondition completion_condition)
 Attempt to read a certain amount of data from a stream before returning.
template<typename SyncReadStream , typename Allocator >
std::size_t read (SyncReadStream &s, basic_streambuf< Allocator > &b)
 Attempt to read a certain amount of data from a stream before returning.
template<typename SyncReadStream , typename MutableBufferSequence , typename CompletionCondition >
std::size_t read (SyncReadStream &s, const MutableBufferSequence &buffers, CompletionCondition completion_condition, asio::error_code &ec)
 Attempt to read a certain amount of data from a stream before returning.
template<typename SyncReadStream , typename MutableBufferSequence , typename CompletionCondition >
std::size_t read (SyncReadStream &s, const MutableBufferSequence &buffers, CompletionCondition completion_condition)
 Attempt to read a certain amount of data from a stream before returning.
template<typename SyncReadStream , typename MutableBufferSequence >
std::size_t read (SyncReadStream &s, const MutableBufferSequence &buffers)
 Attempt to read a certain amount of data from a stream before returning.
template<typename SyncRandomAccessReadDevice , typename Allocator , typename CompletionCondition >
std::size_t read_at (SyncRandomAccessReadDevice &d, boost::uint64_t offset, basic_streambuf< Allocator > &b, CompletionCondition completion_condition, asio::error_code &ec)
template<typename SyncRandomAccessReadDevice , typename Allocator , typename CompletionCondition >
std::size_t read_at (SyncRandomAccessReadDevice &d, boost::uint64_t offset, basic_streambuf< Allocator > &b, CompletionCondition completion_condition)
template<typename SyncRandomAccessReadDevice , typename Allocator >
std::size_t read_at (SyncRandomAccessReadDevice &d, boost::uint64_t offset, basic_streambuf< Allocator > &b)
template<typename SyncRandomAccessReadDevice , typename MutableBufferSequence , typename CompletionCondition >
std::size_t read_at (SyncRandomAccessReadDevice &d, boost::uint64_t offset, const MutableBufferSequence &buffers, CompletionCondition completion_condition, asio::error_code &ec)
template<typename SyncRandomAccessReadDevice , typename MutableBufferSequence , typename CompletionCondition >
std::size_t read_at (SyncRandomAccessReadDevice &d, boost::uint64_t offset, const MutableBufferSequence &buffers, CompletionCondition completion_condition)
template<typename SyncRandomAccessReadDevice , typename MutableBufferSequence >
std::size_t read_at (SyncRandomAccessReadDevice &d, boost::uint64_t offset, const MutableBufferSequence &buffers)
template<typename SyncReadStream , typename Allocator , typename MatchCondition >
std::size_t read_until (SyncReadStream &s, asio::basic_streambuf< Allocator > &b, MatchCondition match_condition, asio::error_code &ec, typename boost::enable_if< is_match_condition< MatchCondition > >::type *=0)
 Read data into a streambuf until a function object indicates a match.
template<typename SyncReadStream , typename Allocator , typename MatchCondition >
std::size_t read_until (SyncReadStream &s, asio::basic_streambuf< Allocator > &b, MatchCondition match_condition, typename boost::enable_if< is_match_condition< MatchCondition > >::type *=0)
 Read data into a streambuf until a function object indicates a match.
template<typename SyncReadStream , typename Allocator >
std::size_t read_until (SyncReadStream &s, asio::basic_streambuf< Allocator > &b, const boost::regex &expr, asio::error_code &ec)
template<typename SyncReadStream , typename Allocator >
std::size_t read_until (SyncReadStream &s, asio::basic_streambuf< Allocator > &b, const boost::regex &expr)
template<typename SyncReadStream , typename Allocator >
std::size_t read_until (SyncReadStream &s, asio::basic_streambuf< Allocator > &b, const std::string &delim, asio::error_code &ec)
 Read data into a streambuf until it contains a specified delimiter.
template<typename SyncReadStream , typename Allocator >
std::size_t read_until (SyncReadStream &s, asio::basic_streambuf< Allocator > &b, const std::string &delim)
 Read data into a streambuf until it contains a specified delimiter.
template<typename SyncReadStream , typename Allocator >
std::size_t read_until (SyncReadStream &s, asio::basic_streambuf< Allocator > &b, char delim, asio::error_code &ec)
 Read data into a streambuf until it contains a specified delimiter.
template<typename SyncReadStream , typename Allocator >
std::size_t read_until (SyncReadStream &s, asio::basic_streambuf< Allocator > &b, char delim)
 Read data into a streambuf until it contains a specified delimiter.
detail::transfer_all_t transfer_all ()
detail::transfer_at_least_t transfer_at_least (std::size_t minimum)
template<typename Service >
Service & use_service (io_service &ios)
template<typename SyncWriteStream , typename Allocator , typename CompletionCondition >
std::size_t write (SyncWriteStream &s, basic_streambuf< Allocator > &b, CompletionCondition completion_condition, asio::error_code &ec)
 Write a certain amount of data to a stream before returning.
template<typename SyncWriteStream , typename Allocator , typename CompletionCondition >
std::size_t write (SyncWriteStream &s, basic_streambuf< Allocator > &b, CompletionCondition completion_condition)
 Write a certain amount of data to a stream before returning.
template<typename SyncWriteStream , typename Allocator >
std::size_t write (SyncWriteStream &s, basic_streambuf< Allocator > &b)
 Write all of the supplied data to a stream before returning.
template<typename SyncWriteStream , typename ConstBufferSequence , typename CompletionCondition >
std::size_t write (SyncWriteStream &s, const ConstBufferSequence &buffers, CompletionCondition completion_condition, asio::error_code &ec)
 Write a certain amount of data to a stream before returning.
template<typename SyncWriteStream , typename ConstBufferSequence , typename CompletionCondition >
std::size_t write (SyncWriteStream &s, const ConstBufferSequence &buffers, CompletionCondition completion_condition)
 Write a certain amount of data to a stream before returning.
template<typename SyncWriteStream , typename ConstBufferSequence >
std::size_t write (SyncWriteStream &s, const ConstBufferSequence &buffers)
 Write all of the supplied data to a stream before returning.
template<typename SyncRandomAccessWriteDevice , typename Allocator , typename CompletionCondition >
std::size_t write_at (SyncRandomAccessWriteDevice &d, boost::uint64_t offset, basic_streambuf< Allocator > &b, CompletionCondition completion_condition, asio::error_code &ec)
 Write a certain amount of data at a specified offset before returning.
template<typename SyncRandomAccessWriteDevice , typename Allocator , typename CompletionCondition >
std::size_t write_at (SyncRandomAccessWriteDevice &d, boost::uint64_t offset, basic_streambuf< Allocator > &b, CompletionCondition completion_condition)
 Write a certain amount of data at a specified offset before returning.
template<typename SyncRandomAccessWriteDevice , typename Allocator >
std::size_t write_at (SyncRandomAccessWriteDevice &d, boost::uint64_t offset, basic_streambuf< Allocator > &b)
 Write all of the supplied data at the specified offset before returning.
template<typename SyncRandomAccessWriteDevice , typename ConstBufferSequence , typename CompletionCondition >
std::size_t write_at (SyncRandomAccessWriteDevice &d, boost::uint64_t offset, const ConstBufferSequence &buffers, CompletionCondition completion_condition, asio::error_code &ec)
 Write a certain amount of data at a specified offset before returning.
template<typename SyncRandomAccessWriteDevice , typename ConstBufferSequence , typename CompletionCondition >
std::size_t write_at (SyncRandomAccessWriteDevice &d, boost::uint64_t offset, const ConstBufferSequence &buffers, CompletionCondition completion_condition)
 Write a certain amount of data at a specified offset before returning.
template<typename SyncRandomAccessWriteDevice , typename ConstBufferSequence >
std::size_t write_at (SyncRandomAccessWriteDevice &d, boost::uint64_t offset, const ConstBufferSequence &buffers)
 Write all of the supplied data at the specified offset before returning.

Typedef Documentation

typedef basic_deadline_timer<boost::posix_time::ptime> asio::deadline_timer

Typedef for the typical usage of timer.

Definition at line 31 of file deadline_timer.hpp.

Bring error category type into the asio namespace.

Definition at line 66 of file error_code.hpp.

Typedef for backwards compatibility.

Definition at line 180 of file strand.hpp.

Typedef for the typical usage of basic_streambuf.

Definition at line 25 of file streambuf.hpp.


Function Documentation

template<typename Service >
void asio::add_service ( io_service &  ios,
Service *  svc 
) [inline]

This function is used to add a service to the io_service.

Parameters:
ios The io_service object that owns the service.
svc The service object. On success, ownership of the service object is transferred to the io_service. When the io_service object is destroyed, it will destroy the service object by performing:

 delete static_cast<io_service::service*>(svc) 
Exceptions:
asio::service_already_exists Thrown if a service of the given type is already present in the io_service.
asio::invalid_service_owner Thrown if the service's owning io_service is not the io_service object specified by the ios parameter.
void* asio::asio_handler_allocate ( std::size_t  size,
  ... 
) [inline]

Default allocation function for handlers.

Asynchronous operations may need to allocate temporary objects. Since asynchronous operations have a handler function object, these temporary objects can be said to be associated with the handler.

Implement asio_handler_allocate and asio_handler_deallocate for your own handlers to provide custom allocation for these temporary objects.

This default implementation is simply:

 return ::operator new(size);
Note:
All temporary objects associated with a handler will be deallocated before the upcall to the handler is performed. This allows the same memory to be reused for a subsequent asynchronous operation initiated by the handler.
Example
 class my_handler;

 void* asio_handler_allocate(std::size_t size, my_handler* context)
 {
   return ::operator new(size);
 }

 void asio_handler_deallocate(void* pointer, std::size_t size,
     my_handler* context)
 {
   ::operator delete(pointer);
 }

Definition at line 61 of file handler_alloc_hook.hpp.

void asio::asio_handler_deallocate ( void *  pointer,
std::size_t  size,
  ... 
) [inline]

Default deallocation function for handlers.

Implement asio_handler_allocate and asio_handler_deallocate for your own handlers to provide custom allocation for the associated temporary objects.

This default implementation is simply:

 ::operator delete(pointer);
See also:
asio_handler_allocate.

Definition at line 78 of file handler_alloc_hook.hpp.

template<typename Function >
void asio::asio_handler_invoke ( Function  function,
  ... 
) [inline]

Default invoke function for handlers.

Completion handlers for asynchronous operations are invoked by the io_service associated with the corresponding object (e.g. a socket or deadline_timer). Certain guarantees are made on when the handler may be invoked, in particular that a handler can only be invoked from a thread that is currently calling asio::io_service::run() on the corresponding io_service object. Handlers may subsequently be invoked through other objects (such as asio::strand objects) that provide additional guarantees.

When asynchronous operations are composed from other asynchronous operations, all intermediate handlers should be invoked using the same method as the final handler. This is required to ensure that user-defined objects are not accessed in a way that may violate the guarantees. This hooking function ensures that the invoked method used for the final handler is accessible at each intermediate step.

Implement asio_handler_invoke for your own handlers to specify a custom invocation strategy.

This default implementation is simply:

 function();
Example
 class my_handler;

 template <typename Function>
 void asio_handler_invoke(Function function, my_handler* context)
 {
   context->strand_.dispatch(function);
 }

Definition at line 60 of file handler_invoke_hook.hpp.

template<typename BufferSequence >
buffers_iterator<BufferSequence> asio::buffers_begin ( const BufferSequence &  buffers  )  [inline]

Construct an iterator representing the beginning of the buffers' data.

Definition at line 300 of file buffers_iterator.hpp.

template<typename BufferSequence >
buffers_iterator<BufferSequence> asio::buffers_end ( const BufferSequence &  buffers  )  [inline]

Construct an iterator representing the end of the buffers' data.

Definition at line 308 of file buffers_iterator.hpp.

template<typename Service >
bool asio::has_service ( io_service &  ios  )  [inline]

This function is used to determine whether the io_service contains a service object corresponding to the given service type.

Parameters:
ios The io_service object that owns the service.
Returns:
A boolean indicating whether the io_service contains the service.
template<typename Service >
Service& asio::use_service ( io_service &  ios  )  [inline]

This function is used to locate a service object that corresponds to the given service type. If there is no existing implementation of the service, then the io_service will create a new instance of the service.

Parameters:
ios The io_service object that owns the service.
Returns:
The service interface implementing the specified service type. Ownership of the service interface is not transferred to the caller.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Castor
Author(s): Carpe Noctem
autogenerated on Fri Mar 1 14:41:40 2013