en	DynamicBuffer

en	A dynamic buffer encapsulates memory storage that may be automatically resized as required, where the memory is divided into an input sequence followed by an output sequence. These memory regions are internal to the dynamic buffer, but direct access to the elements is provided to permit them to be efficiently used with I/O operations, such as the send or receive operations of a socket. Data written to the output sequence of a dynamic buffer object is appended to the input sequence of the same object.

en	The interface to this concept is intended to permit the following implementation strategies:

en	* A single contiguous octet array, which is reallocated as necessary to

en	* A sequence of one or more octet arrays, where each array is of the same

en	* A sequence of one or more octet arrays of varying sizes. Additional octet

en	Associated With

en	* `boost::asio::is_dynamic_buffer` * __ConstBufferSequence__ * __MutableBufferSequence__

en	Requirements

en	* `D` denotes a dynamic buffer class. * `a` denotes a value of type `D`. * `c` denotes a (possibly const) value of type `D`. * `n` denotes a value of type `std::size_t`. * `T` denotes a type meeting the requirements for __ConstBufferSequence__. * `U` denotes a type meeting the requirements for __MutableBufferSequence__.

en	Valid expressions

en	Expression

en	Type

en	Semantics, Pre/Post-conditions

en	`D::const_buffers_type`

en	`T`

en	This type represents the memory associated with the input sequence.

en	`D::mutable_buffers_type`

en	`U`

en	This type represents the memory associated with the output sequence.

en	`c.size()`

en	`std::size_t`

en	Returns the size, in bytes, of the input sequence.

en	`c.max_size()`

en	Returns the permitted maximum of the sum of the sizes of the input sequence and output sequence.

en	`c.capacity()`

en	Returns the maximum sum of the sizes of the input sequence and output sequence that the dynamic buffer can hold without requiring reallocation.

en	`c.data()`

en	Returns a constant buffer sequence u that represents the memory associated with the input sequence, and where `buffer_size(u) == size()`.

en	`a.prepare(n)`

en	Returns a mutable buffer sequence u representing the output sequence, and where `buffer_size(u) == n`. The dynamic buffer reallocates memory as required. All constant or mutable buffer sequences previously obtained using `data()` or `prepare()` are invalidated. Throws: `length_error` if `size() + n` exceeds `max_size()`.

en	`a.commit(n)`

en	Appends `n` bytes from the start of the output sequence to the end of the input sequence. The remainder of the output sequence is discarded. If `n` is greater than the size of the output sequence, the entire output sequence is appended to the input sequence. All constant or mutable buffer sequences previously obtained using `data()` or `prepare()` are invalidated.

en	`a.consume(n)`

en	Removes `n` bytes from beginning of the input sequence. If `n` is greater than the size of the input sequence, the entire input sequence is removed. All constant or mutable buffer sequences previously obtained using `data()` or `prepare()` are invalidated.

en	Models

en	* [link beast.ref.boost__beast__basic_flat_buffer `basic_flat_buffer`] * [link beast.ref.boost__beast__basic_multi_buffer `basic_multi_buffer`] * [link beast.ref.boost__beast__flat_buffer `flat_buffer`] * [link beast.ref.boost__beast__flat_static_buffer `flat_static_buffer`] * [link beast.ref.boost__beast__flat_static_buffer_base `flat_static_buffer_base`] * [link beast.ref.boost__beast__static_buffer `static_buffer`] * [link beast.ref.boost__beast__static_buffer_base `static_buffer_base`] * [link beast.ref.boost__beast__multi_buffer `multi_buffer`]