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 for the latest Boost documentation.
PrevUpHomeNext

buffers_adapter

Adapts a MutableBufferSequence into a DynamicBuffer.

Synopsis

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

template<
    class MutableBufferSequence>
class buffers_adapter
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

buffers_adapter

Move constructor.

Copy constructor.

Construct a buffers adapter.

capacity

Returns the maximum sum of the sizes of the input sequence and output sequence the buffer can hold without requiring reallocation.

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 represents the input sequence.

max_size

Returns the largest size output sequence possible.

operator=

Move assignment.

Copy assignment.

prepare

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

size

Get the size of the input sequence.

Description

This class wraps a MutableBufferSequence to meet the requirements of DynamicBuffer. Upon construction the input and output sequences are empty. A copy of the mutable buffer sequence object is stored; however, ownership of the underlying memory is not transferred. The caller is responsible for making sure that referenced memory remains valid for the duration of any operations.

The size of the mutable buffer sequence determines the maximum number of bytes which may be prepared and committed.

Template Parameters

Type

Description

MutableBufferSequence

The type of mutable buffer sequence to wrap.

Convenience header <boost/beast/core.hpp>


PrevUpHomeNext