![]() |
Home | Libraries | People | FAQ | More |
A dynamic buffer providing buffer sequences of length one.
Defined in header <boost/beast/core/flat_buffer.hpp>
template< class Allocator> class basic_flat_buffer
Name |
Description |
---|---|
The type of allocator used. |
|
The ConstBufferSequence used to represent the readable bytes. |
|
The MutableBufferSequence used to represent the writable bytes. |
|
The MutableBufferSequence used to represent the readable bytes. |
Name |
Description |
---|---|
Constructor. Move Constructor. Copy 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 mutable buffer sequence representing the readable bytes. |
|
Returns a copy of the allocator used. |
|
Set the maximum allowed capacity. Return the maximum number of bytes, both readable and writable, that can ever be held. |
|
Move Assignment. Copy Assignment. Copy 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. |
|
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. Objects of this type meet the requirements of DynamicBuffer and have the following additional properties:
basic_flat_buffer::data
when this
is non-const.
std::length_error
.
basic_flat_buffer::data
and basic_flat_buffer::prepare
, will have length one.
Upon construction, a maximum size for the buffer may be specified. If this
limit is exceeded, the std::length_error
exception will be thrown.
This class is designed for use with algorithms that take dynamic buffers as parameters, and are optimized for the case where the input sequence or output sequence is stored in a single contiguous buffer.
Convenience header <boost/beast/core.hpp>