boost::asio::mutable_buffer

Holds a buffer that can be modified.

Synopsis

Declared in <boost/asio/buffer.hpp>

class mutable_buffer;

Member Functions

Name

Description

mutable_buffer [constructor]

Constructors

data

Get a pointer to the beginning of the memory range.

operator+=

Move the start of the buffer by the specified number of bytes.

size

Get the size of the memory range.

Non-Member Functions

Name

Description

buffer

Create a new modifiable buffer that represents the given POD array.

buffer

Create a new modifiable buffer that represents the given string.

buffer

Create a new modifiable buffer from an existing buffer.

buffer

Create a new modifiable buffer from a span.

buffer

Create a new modifiable buffer from a contiguous container.

buffer

Create a new modifiable buffer that represents the given POD array.

buffer

Create a new modifiable buffer from a contiguous container.

buffer

Create a new modifiable buffer that represents the given POD array.

buffer

Create a new modifiable buffer that represents the given POD array.

buffer

Create a new modifiable buffer that represents the given POD array.

buffer

Create a new modifiable buffer that represents the given POD vector.

buffer

Create a new modifiable buffer that represents the given POD vector.

buffer

Create a new modifiable buffer from a span.

buffer

Create a new modifiable buffer from an existing buffer.

buffer

Create a new modifiable buffer that represents the given POD array.

buffer

Create a new modifiable buffer that represents the given string.

buffer

Create a new modifiable buffer that represents the given memory range.

buffer_sequence_begin

Get an iterator to the first element in a buffer sequence.

buffer_sequence_begin

Get an iterator to the first element in a buffer sequence.

buffer_sequence_end

Get an iterator to one past the end element in a buffer sequence.

buffer_sequence_end

Get an iterator to one past the end element in a buffer sequence.

operator+

Create a new modifiable buffer that is offset from the start of another.

operator+

Create a new modifiable buffer that is offset from the start of another.

Description

The mutable_buffer class provides a safe representation of a buffer that can be modified. It does not own the underlying data, and so is cheap to copy or assign.

Accessing Buffer Contents

The contents of a buffer may be accessed using the data() and size() member functions:

boost::asio::mutable_buffer b1 = ...;
std::size_t s1 = b1.size();
unsigned char* p1 = static_cast<unsigned char*>(b1.data());

The data() member function permits violations of type safety, so uses of it in application code should be carefully considered.

Created with MrDocs