#include <flat_static_buffer.hpp>
A flat DynamicBuffer with a fixed size internal buffer.
Buffer sequences returned by data and prepare will always be of length one. Ownership of the underlying storage belongs to the derived class.
- Note
- Variables are usually declared using the template class flat_static_buffer; however, to reduce the number of instantiations of template functions receiving static stream buffer arguments in a deduced context, the signature of the receiving function should use flat_static_buffer_base.
When used with flat_static_buffer this implements a dynamic buffer using no memory allocations.
- See also
- flat_static_buffer
The type used to represent the input sequence as a list of buffers.
This buffer sequence is guaranteed to have length 1.
The type used to represent the output sequence as a list of buffers.
This buffer sequence is guaranteed to have length 1.
boost::beast::flat_static_buffer_base::flat_static_buffer_base |
( |
void * |
p, |
|
|
std::size_t |
n |
|
) |
| |
|
inline |
Constructor
This creates a dynamic buffer using the provided storage area.
- Parameters
-
p | A pointer to valid storage of at least n bytes. |
n | The number of valid bytes pointed to by p . |
boost::beast::flat_static_buffer_base::flat_static_buffer_base |
( |
| ) |
|
|
protecteddefault |
Constructor
The buffer will be in an undefined state. It is necessary for the derived class to call reset with a pointer and size in order to initialize the object.
std::size_t boost::beast::flat_static_buffer_base::capacity |
( |
| ) |
const |
|
inline |
Return the maximum sum of input and output sizes that can be held without an allocation.
void boost::beast::flat_static_buffer_base::commit |
( |
std::size_t |
n | ) |
|
|
inline |
Move bytes from the output sequence to the input sequence.
- Note
- Buffers representing the input sequence acquired prior to this call remain valid.
void boost::beast::flat_static_buffer_base::consume |
( |
std::size_t |
n | ) |
|
|
inline |
Remove bytes from the input sequence.
auto boost::beast::flat_static_buffer_base::data |
( |
| ) |
const |
|
inline |
Get a list of buffers that represent the input sequence.
- Note
- These buffers remain valid across subsequent calls to
prepare
.
std::size_t boost::beast::flat_static_buffer_base::max_size |
( |
| ) |
const |
|
inline |
Return the maximum sum of the input and output sequence sizes.
auto boost::beast::flat_static_buffer_base::prepare |
( |
std::size_t |
n | ) |
|
|
inline |
Get a list of buffers that represent the output sequence, with the given size.
- Exceptions
-
std::length_error | if the size would exceed the limit imposed by the underlying mutable buffer sequence. |
- Note
- Buffers representing the input sequence acquired prior to this call remain valid.
void boost::beast::flat_static_buffer_base::reset |
( |
| ) |
|
|
inline |
Set the input and output sequences to size 0.
void boost::beast::flat_static_buffer_base::reset |
( |
void * |
p, |
|
|
std::size_t |
n |
|
) |
| |
|
inlineprotected |
Reset the pointed-to buffer.
This function resets the internal state to the buffer provided. All input and output sequences are invalidated. This function allows the derived class to construct its members before initializing the static buffer.
- Parameters
-
p | A pointer to valid storage of at least n bytes. |
n | The number of valid bytes pointed to by p . |
std::size_t boost::beast::flat_static_buffer_base::size |
( |
| ) |
const |
|
inline |
Return the size of the input sequence.
The documentation for this class was generated from the following files: