Holds a buffer that cannot be modified. More...
#include <buffer.hpp>
Public Member Functions | |
const_buffer () | |
Construct an empty buffer. | |
const_buffer (const void *data, std::size_t size) | |
Construct a buffer to represent a given memory range. | |
const_buffer (const mutable_buffer &b) | |
Construct a non-modifiable buffer from a modifiable one. | |
Private Attributes | |
const void * | data_ |
std::size_t | size_ |
Friends | |
const void * | asio::detail::buffer_cast_helper (const const_buffer &b) |
std::size_t | asio::detail::buffer_size_helper (const const_buffer &b) |
Related Functions | |
(Note that these are not member functions.) | |
template<typename PointerToPodType > | |
PointerToPodType | buffer_cast (const const_buffer &b) |
Cast a non-modifiable buffer to a specified pointer to POD type. | |
std::size_t | buffer_size (const const_buffer &b) |
Get the number of bytes in a non-modifiable buffer. | |
const_buffer | operator+ (const const_buffer &b, std::size_t start) |
Create a new non-modifiable buffer that is offset from the start of another. | |
const_buffer | operator+ (std::size_t start, const const_buffer &b) |
Create a new non-modifiable buffer that is offset from the start of another. |
Holds a buffer that cannot be modified.
The const_buffer class provides a safe representation of a buffer that cannot be modified. It does not own the underlying data, and so is cheap to copy or assign.
Definition at line 229 of file buffer.hpp.
asio::const_buffer::const_buffer | ( | ) | [inline] |
Construct an empty buffer.
Definition at line 233 of file buffer.hpp.
asio::const_buffer::const_buffer | ( | const void * | data, |
std::size_t | size | ||
) | [inline] |
Construct a buffer to represent a given memory range.
Definition at line 240 of file buffer.hpp.
asio::const_buffer::const_buffer | ( | const mutable_buffer & | b | ) | [inline] |
Construct a non-modifiable buffer from a modifiable one.
Definition at line 247 of file buffer.hpp.
const void* asio::detail::buffer_cast_helper | ( | const const_buffer & | b | ) | [friend] |
std::size_t asio::detail::buffer_size_helper | ( | const const_buffer & | b | ) | [friend] |
PointerToPodType buffer_cast | ( | const const_buffer & | b | ) | [related] |
Cast a non-modifiable buffer to a specified pointer to POD type.
Definition at line 308 of file buffer.hpp.
std::size_t buffer_size | ( | const const_buffer & | b | ) | [related] |
Get the number of bytes in a non-modifiable buffer.
Definition at line 317 of file buffer.hpp.
const_buffer operator+ | ( | const const_buffer & | b, |
std::size_t | start | ||
) | [related] |
Create a new non-modifiable buffer that is offset from the start of another.
Definition at line 326 of file buffer.hpp.
const_buffer operator+ | ( | std::size_t | start, |
const const_buffer & | b | ||
) | [related] |
Create a new non-modifiable buffer that is offset from the start of another.
Definition at line 343 of file buffer.hpp.
const void* asio::const_buffer::data_ [private] |
Definition at line 277 of file buffer.hpp.
std::size_t asio::const_buffer::size_ [private] |
Definition at line 278 of file buffer.hpp.