ゴミ箱
|
#include <buffers_adapter.hpp>
Classes | |
class | const_buffers_type |
class | mutable_buffers_type |
Public Member Functions | |
buffers_adapter (buffers_adapter &&other) | |
Move constructor. More... | |
buffers_adapter (buffers_adapter const &other) | |
Copy constructor. More... | |
buffers_adapter & | operator= (buffers_adapter &&other) |
Move assignment. More... | |
buffers_adapter & | operator= (buffers_adapter const &) |
Copy assignment. More... | |
buffers_adapter (MutableBufferSequence const &buffers) | |
std::size_t | max_size () const |
Returns the largest size output sequence possible. More... | |
std::size_t | size () const |
Get the size of the input sequence. More... | |
std::size_t | capacity () const |
Returns the maximum sum of the sizes of the input sequence and output sequence the buffer can hold without requiring reallocation. More... | |
mutable_buffers_type | prepare (std::size_t n) |
void | commit (std::size_t n) |
const_buffers_type | data () const |
void | consume (std::size_t n) |
Remove bytes from the input sequence. More... | |
Adapts a MutableBufferSequence into a DynamicBuffer.
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.
MutableBufferSequence | The type of mutable buffer sequence to wrap. |
boost::beast::buffers_adapter< MutableBufferSequence >::buffers_adapter | ( | buffers_adapter< MutableBufferSequence > && | other | ) |
Move constructor.
boost::beast::buffers_adapter< MutableBufferSequence >::buffers_adapter | ( | buffers_adapter< MutableBufferSequence > const & | other | ) |
Copy constructor.
|
explicit |
Construct a buffers adapter.
buffers | The mutable buffer sequence to wrap. A copy of the object will be made, but ownership of the memory is not transferred. |
|
inline |
Returns the maximum sum of the sizes of the input sequence and output sequence the buffer can hold without requiring reallocation.
void boost::beast::buffers_adapter< MutableBufferSequence >::commit | ( | std::size_t | n | ) |
Move bytes from the output sequence to the input sequence.
void boost::beast::buffers_adapter< MutableBufferSequence >::consume | ( | std::size_t | n | ) |
Remove bytes from the input sequence.
|
inline |
Get a list of buffers that represents the input sequence.
prepare
.
|
inline |
Returns the largest size output sequence possible.
auto boost::beast::buffers_adapter< MutableBufferSequence >::operator= | ( | buffers_adapter< MutableBufferSequence > && | other | ) |
Move assignment.
auto boost::beast::buffers_adapter< MutableBufferSequence >::operator= | ( | buffers_adapter< MutableBufferSequence > const & | other | ) |
Copy assignment.
auto boost::beast::buffers_adapter< MutableBufferSequence >::prepare | ( | std::size_t | n | ) |
Get a list of buffers that represents the output sequence, with the given size.
std::length_error | if the size would exceed the limit imposed by the underlying mutable buffer sequence. |
|
inline |
Get the size of the input sequence.