| Home | Libraries | People | FAQ | More

#### flat_static_buffer_base

A dynamic buffer using a fixed size internal buffer using no memory allocations.

##### Synopsis

Defined in header `<boost/beast/core/flat_static_buffer.hpp>`

    class flat_static_buffer_base

##### Types

Name | Description
--- | ---
const_buffers_type | The ConstBufferSequence used to represent the readable bytes.
mutable_buffers_type | The MutableBufferSequence used to represent the writable bytes.

##### Member Functions

Name | Description
--- | ---
capacity | Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation.
cdata | Returns a constant buffer sequence representing the readable bytes.
clear | Clear the readable and writable bytes to zero.
commit | Append writable bytes to the readable bytes.
consume | Remove bytes from beginning of the readable bytes.
data | Returns a constant buffer sequence representing the readable bytes. — Returns a mutable buffer sequence representing the readable bytes.
flat_static_buffer_base [constructor] | Constructor.
max_size | Return the maximum number of bytes, both readable and writable, that can ever be held.
prepare | Returns a mutable buffer sequence representing writable bytes.
size | Returns the number of readable bytes.

##### Protected Member Functions

Name | Description
--- | ---
flat_static_buffer_base [constructor] | Constructor.
reset | Reset the pointed-to buffer.

##### Description

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:

- A mutable buffer sequence representing the readable bytes is returned by `data` when `this` is non-const.
- Buffer sequences representing the readable and writable bytes, returned by `data` and `prepare`, will have a type of net::const_buffer or net::mutable_buffer.
- Ownership of the underlying storage belongs to the derived class.

##### Remarks

Variables are usually declared using the template class `flat_static_buffer`; however, to reduce the number of template instantiations, objects should be passed `flat_static_buffer_base`& .

##### See Also

`flat_static_buffer`