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

static_buffer_base

A circular DynamicBuffer with a fixed size internal buffer.

Synopsis

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

class 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

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.

max_size

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

mutable_data

Get a mutable list of buffers that represent the input sequence.

prepare

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

size

Return the size of the input sequence.

static_buffer_base

Constructor.

Protected Member Functions

Name

Description

reset

Reset the pointed-to buffer.

static_buffer_base

Constructor.

Description

This implements a circular dynamic buffer. Calls to static_buffer::prepare never require moving memory. The buffer sequences returned may be up to length two. Ownership of the underlying storage belongs to the derived class.

Remarks

Variables are usually declared using the template class 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 static_buffer_base.

When used with static_buffer this implements a dynamic buffer using no memory allocations.

See Also

static_buffer

Convenience header <boost/beast/core.hpp>


PrevUpHomeNext