...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A dynamic buffer providing sequences of variable length.
Defined in header <boost/beast/core/multi_buffer.hpp>
template< class Allocator> class basic_multi_buffer
Name |
Description |
---|---|
The type of allocator used. |
|
The ConstBufferSequence used to represent the readable bytes. |
|
The MutableBufferSequence used to represent the writable bytes. |
Name |
Description |
---|---|
basic_multi_buffer [constructor] |
Constructor. |
Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation. |
|
Returns a constant buffer sequence representing the readable bytes. |
|
Set the size of the readable and writable bytes to zero. |
|
Append writable bytes to the readable bytes. |
|
Remove bytes from beginning of the readable bytes. |
|
Returns a constant buffer sequence representing the readable bytes.
|
|
Returns a copy of the allocator used. |
|
Set the maximum allowed capacity. |
|
Move Assignment. |
|
Returns a mutable buffer sequence representing writable bytes. |
|
Guarantee a minimum capacity. |
|
Reallocate the buffer to fit the readable bytes exactly. |
|
Returns the number of readable bytes. |
|
~basic_multi_buffer [destructor] |
Destructor. |
Name |
Description |
---|---|
Exchange two dynamic buffers. |
A dynamic buffer encapsulates memory storage that may be automatically resized
as required, where the memory is divided into two regions: readable bytes
followed by writable bytes. 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. The implementation uses a sequence
of one or more byte arrays of varying sizes to represent the readable and
writable bytes. Additional byte array objects are appended to the sequence
to accommodate changes in the desired size. The behavior and implementation
of this container is most similar to std::deque
.
Objects of this type meet the requirements of DynamicBuffer
and have the following additional properties:
data
when this
is non-const.
data
and prepare
, may have length greater
than one.
prepare
that would exceed this
size will throw std::length_error
.
data
remain valid after calls
to prepare
or commit
.
Type |
Description |
---|---|
|
The allocator to use for managing memory. |