...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A dynamic buffer encapsulates memory storage that may be automatically resized
as required, where the memory is divided into an input sequence followed
by an output sequence. These memory regions are internal to the dynamic buffer
sequence, but direct access to the elements is provided to permit them to
be efficiently used with I/O operations, such as the send
or
receive
operations of a socket. Data written to the output sequence
of a dynamic buffer sequence object is appended to the input sequence of
the same object.
A dynamic buffer type X
shall satisfy the requirements of MoveConstructible
(C++ Std, [moveconstructible]) types in addition to those listed below.
In the table below, X
denotes a dynamic buffer class, x
denotes a value of type X&
, x1
denotes values
of type const X&
, and n
denotes a value of
type size_t
, and u
denotes an identifier.
Table 12. DynamicBuffer_v1 requirements
expression |
type |
assertion/note |
---|---|---|
|
type meeting ConstBufferSequence requirements. |
This type represents the memory associated with the input sequence. |
|
type meeting MutableBufferSequence requirements. |
This type represents the memory associated with the output sequence. |
|
|
Returns the size, in bytes, of the input sequence. |
|
|
Returns the permitted maximum of the sum of the sizes of the input sequence and output sequence. |
|
|
Returns the maximum sum of the sizes of the input sequence and output sequence that the dynamic buffer can hold without requiring reallocation. |
|
|
Returns a constant buffer sequence |
|
|
Requires: |
|
Appends |
|
|
Removes |