ゴミ箱
|
#include <consuming_buffers.hpp>
Classes | |
class | const_iterator |
Public Types | |
using | value_type = typename std::conditional< std::is_convertible< typename std::iterator_traits< iter_type >::value_type, boost::asio::mutable_buffer >::value, boost::asio::mutable_buffer, boost::asio::const_buffer >::type |
Public Member Functions | |
consuming_buffers () | |
Constructor. More... | |
consuming_buffers (consuming_buffers &&) | |
Constructor. More... | |
consuming_buffers (consuming_buffers const &) | |
Constructor. More... | |
consuming_buffers (BufferSequence const &buffers) | |
template<class... Args> | |
consuming_buffers (boost::in_place_init_t, Args &&...args) | |
consuming_buffers & | operator= (consuming_buffers &&) |
Assignment. More... | |
consuming_buffers & | operator= (consuming_buffers const &) |
Assignment. More... | |
BufferSequence const & | get () const |
Returns the underlying buffers, without modification. More... | |
const_iterator | begin () const |
Get a bidirectional iterator to the first element. More... | |
const_iterator | end () const |
Get a bidirectional iterator to one past the last element. More... | |
void | consume (std::size_t amount) |
Adapter to trim the front of a BufferSequence
.
This adapter wraps a buffer sequence to create a new sequence which may be incrementally consumed. Bytes consumed are removed from the front of the buffer. The underlying memory is not changed, instead the adapter efficiently iterates through a subset of the buffers wrapped.
The wrapped buffer is not modified, a copy is made instead. Ownership of the underlying memory is not transferred, the application is still responsible for managing its lifetime.
BufferSequence | The buffer sequence to wrap. |
using boost::beast::consuming_buffers< BufferSequence >::value_type = typename std::conditional< std::is_convertible<typename std::iterator_traits<iter_type>::value_type, boost::asio::mutable_buffer>::value, boost::asio::mutable_buffer, boost::asio::const_buffer>::type |
The type for each element in the list of buffers.
If the buffers in the underlying sequence are convertible to boost::asio::mutable_buffer
, then this type will be boost::asio::mutable_buffer
, else this type will be boost::asio::const_buffer
.
boost::beast::consuming_buffers< Buffers >::consuming_buffers | ( | ) |
Constructor.
boost::beast::consuming_buffers< Buffers >::consuming_buffers | ( | consuming_buffers< BufferSequence > && | other | ) |
Constructor.
boost::beast::consuming_buffers< Buffers >::consuming_buffers | ( | consuming_buffers< BufferSequence > const & | other | ) |
Constructor.
|
explicit |
Constructor
A copy of the buffer sequence is made. Ownership of the underlying memory is not transferred or copied.
boost::beast::consuming_buffers< Buffers >::consuming_buffers | ( | boost::in_place_init_t | , |
Args &&... | args | ||
) |
Constructor
This constructs the buffer sequence in-place from a list of arguments.
args | Arguments forwarded to the buffers constructor. |
|
inline |
Get a bidirectional iterator to the first element.
void boost::beast::consuming_buffers< Buffers >::consume | ( | std::size_t | amount | ) |
Remove bytes from the beginning of the sequence.
amount | The number of bytes to remove. If this is larger than the number of bytes remaining, all the bytes remaining are removed. |
|
inline |
Get a bidirectional iterator to one past the last element.
|
inline |
Returns the underlying buffers, without modification.
auto boost::beast::consuming_buffers< Buffers >::operator= | ( | consuming_buffers< BufferSequence > && | other | ) |
Assignment.
auto boost::beast::consuming_buffers< Buffers >::operator= | ( | consuming_buffers< BufferSequence > const & | other | ) |
Assignment.