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

PrevUpHomeNext

buffers_adaptor

Adapts a MutableBufferSequence into a DynamicBuffer.

Synopsis

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

template<
    class MutableBufferSequence>
class buffers_adaptor
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.

value_type

The type of the underlying mutable buffer sequence.

Member Functions

Name

Description

buffers_adaptor [constructor]

Construct a buffers adaptor.

Constructor.

Copy Constructor.

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.

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.

max_size

Return the maximum number of bytes, both readable and writable, that can ever be held.

operator=

Copy Assignment.

prepare

Returns a mutable buffer sequence representing writable bytes.

size

Returns the number of readable bytes.

value

Returns the original mutable buffer 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 adapt.


PrevUpHomeNext