...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
The buffer ref provides a wrapper around beast buffers to make them usable with asio dynamic_buffer v1.
Defined in header <boost/beast/core/buffer_ref.hpp>
template< typename Buffer> struct buffer_ref
Name |
Description |
---|---|
The type of the underlying buffer. |
|
The ConstBufferSequence used to represent the readable bytes. |
|
The MutableBufferSequence used to represent the writable bytes. |
Name |
Description |
---|---|
buffer_ref [constructor] |
Create a buffer reference around |
Return the maximum number of bytes, both readable and writable, that can be held without requiring an allocation. |
|
Move bytes from the output sequence to the input sequence. |
|
Remove |
|
Returns a constant buffer sequence representing the readable bytes. |
|
Return the maximum number of bytes, both readable and writable, that can ever be held. |
|
Get a list of buffers that represents the output sequence, with the given size. |
|
Returns the number of readable bytes. |
v2 is current not supported, so that BOOST_ASIO_NO_DYNAMIC_BUFFER_V1
mustn't be defined.
asio::tcp::socket sock; beast::flat_buffer fb; asio::read_until(sock, ref(fb) '\n' );
Type |
Description |
---|---|
|
The underlying buffer |