Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

flat_static_buffer

A DynamicBuffer with a fixed size internal buffer.

Synopsis

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

template<
    std::size_t N>
class flat_static_buffer :
    public flat_static_buffer_base
Types

Name

Description

const_buffers_type

The type used to represent the input sequence as a list of buffers.

mutable_buffers_type

The type used to represent the output sequence as a list of buffers.

Member Functions

Name

Description

base

Returns the flat_static_buffer_base portion of this object.

capacity

Return the maximum sum of input and output sizes that can be held without an allocation.

commit

Move bytes from the output sequence to the input sequence.

consume

Remove bytes from the input sequence.

data

Get a list of buffers that represent the input sequence.

flat_static_buffer

Constructor.

max_size

Return the maximum sum of the input and output sequence sizes.

operator=

Assignment.

prepare

Get a list of buffers that represent the output sequence, with the given size.

reset

Set the input and output sequences to size 0.

size

Return the size of the input sequence.

Protected Member Functions

Name

Description

reset

Reset the pointed-to buffer.

Description

Buffer sequences returned by flat_static_buffer::data and flat_static_buffer::prepare will always be of length one. This implements a dynamic buffer using no memory allocations.

Template Parameters

Type

Description

N

The number of bytes in the internal buffer.

Remarks

To reduce the number of template instantiations when passing objects of this type in a deduced context, the signature of the receiving function should use flat_static_buffer_base instead.

See Also

flat_static_buffer_base

Convenience header <boost/beast/core.hpp>


PrevUpHomeNext