Boost.AFIO    Boost C++ Libraries
Functions
Overloadable free functions converting the types passed to io_req<> into an asio buffer sequence for read() and write().

Functions

std::vector< asio::mutable_buffer > boost::afio::to_asio_buffers (asio::mutable_buffer &v)
 Passing through asio::mutable_buffer.
std::vector< asio::const_buffer > boost::afio::to_asio_buffers (asio::const_buffer &v)
 Passing through asio::const_buffer.
template<class T >
std::vector< asio::mutable_buffer > boost::afio::to_asio_buffers (T *v, size_t length)
 A buffer at v sized length*sizeof(T)
template<class T >
std::vector< asio::const_buffer > boost::afio::to_asio_buffers (const T *v, size_t length)
 A buffer at v sized length*sizeof(T)
std::vector< asio::mutable_buffer > boost::afio::to_asio_buffers (void *v, size_t length)
 A buffer at v sized length.
std::vector< asio::const_buffer > boost::afio::to_asio_buffers (const void *v, size_t length)
 A buffer at v sized length.
template<class T >
std::vector< asio::mutable_buffer > boost::afio::to_asio_buffers (T &v)
 Any trivial type T or STL container.
template<class T >
std::vector< asio::const_buffer > boost::afio::to_asio_buffers (const T &v)
 Any trivial type T or STL container.
template<class T , size_t N>
std::vector< asio::mutable_buffer > boost::afio::to_asio_buffers (T(&v)[N])
 A buffer at v sized N*sizeof(T)
template<class T , size_t N>
std::vector< asio::const_buffer > boost::afio::to_asio_buffers (const T(&v)[N])
 A buffer at v sized N*sizeof(T)

Detailed Description

You can add your own free function overloads to tell AFIO how to convert your custom types into ASIO scatter gather buffers. Note that const types must convert into asio::const_buffer, and non-const types must convert into asio::mutable_buffer. It is entirely acceptable for types to allow writing (const) only and not reading.

Default overloads provided are as follows:


Function Documentation

std::vector<asio::mutable_buffer> boost::afio::to_asio_buffers ( asio::mutable_buffer &  v)

Passing through asio::mutable_buffer.

Returns:
A vector of ASIO buffers

Definition at line 2859 of file afio.hpp.

std::vector<asio::const_buffer> boost::afio::to_asio_buffers ( asio::const_buffer &  v)

Passing through asio::const_buffer.

Returns:
A vector of ASIO buffers

Definition at line 2869 of file afio.hpp.

template<class T >
std::vector<asio::mutable_buffer> boost::afio::to_asio_buffers ( T *  v,
size_t  length 
)

A buffer at v sized length*sizeof(T)

Template Parameters:
class TAny trivial type T
Returns:
A vector of ASIO buffers

Definition at line 2880 of file afio.hpp.

template<class T >
std::vector<asio::const_buffer> boost::afio::to_asio_buffers ( const T *  v,
size_t  length 
)

A buffer at v sized length*sizeof(T)

Template Parameters:
class TAny trivial type T
Returns:
A vector of ASIO buffers

Definition at line 2892 of file afio.hpp.

std::vector<asio::mutable_buffer> boost::afio::to_asio_buffers ( void *  v,
size_t  length 
)

A buffer at v sized length.

Returns:
A vector of ASIO buffers

Definition at line 2903 of file afio.hpp.

std::vector<asio::const_buffer> boost::afio::to_asio_buffers ( const void *  v,
size_t  length 
)

A buffer at v sized length.

Returns:
A vector of ASIO buffers

Definition at line 2913 of file afio.hpp.

template<class T >
std::vector< asio::mutable_buffer > boost::afio::to_asio_buffers ( T &  v)

Any trivial type T or STL container.

Trivial types turn into a buffer of &v sized sizeof(T). Container types have their value type deduced and to_asio_buffers() called on that value_type. Additional specialisations are provided for string, vector and array to collapse the scatter gather buffers into a single one for contiguous storage.

Template Parameters:
class TAny trivial type T or STL container
Returns:
A vector of ASIO buffers

Definition at line 3044 of file afio.hpp.

template<class T >
std::vector< asio::const_buffer > boost::afio::to_asio_buffers ( const T &  v)

Any trivial type T or STL container.

Trivial types turn into a buffer of &v sized sizeof(T). Container types have their value type deduced and to_asio_buffers() called on that value_type. Additional specialisations are provided for string, vector and array to collapse the scatter gather buffers into a single one for contiguous storage.

Template Parameters:
class TAny trivial type T or STL container
Returns:
A vector of ASIO buffers

Definition at line 3061 of file afio.hpp.

template<class T , size_t N>
std::vector< asio::mutable_buffer > boost::afio::to_asio_buffers ( T(&)  v[N])

A buffer at v sized N*sizeof(T)

Template Parameters:
class TAny trivial type T
Returns:
A vector of ASIO buffers

Definition at line 3073 of file afio.hpp.

template<class T , size_t N>
std::vector< asio::const_buffer > boost::afio::to_asio_buffers ( const T(&)  v[N])

A buffer at v sized N*sizeof(T)

Template Parameters:
class TAny trivial type T
Returns:
A vector of ASIO buffers

Definition at line 3084 of file afio.hpp.


January, 2014

Copyright © 2013-2014 Niall Douglas, Cork, Ireland
Copyright © 2013 Paul Kirth, California
Documentation is generated by Doxygen