class dynamic_buffer#
-
template<typename Container>
class dynamic_buffer# An adapter that turns
Containerinto a type that satisfiesnet::DynamicBufferconcept.- DESCRIPTION
An adapter that turns
Containerinto a type that satisfiesnet::DynamicBufferconcept. Note thatContainermust use contiguous storage.readable writable |-----------|-----------|-----------|-----------|-----------| 0 roffset woffset c.size() c.capacity() limit
Public Functions
-
inline dynamic_buffer()#
Construct a
dynamic_bufferwith maximum capacity ofContainer::max_size().
-
inline dynamic_buffer(std::size_t limit)#
Construct a
dynamic_bufferwith maximum capacity ofstd::size_t limit.
-
inline auto cdata() const -> const_buffers_type#
Get a constant buffer sequence representing readable bytes.
-
inline auto data() const -> const_buffers_type#
Get a constant buffer sequence representing readable bytes.
-
inline auto data() -> mutable_buffers_type#
Get a mutable buffer sequence representing readable bytes.
-
inline void consume(std::size_t n)#
Remove bytes starting from the beginning of readable bytes.
-
inline auto prepare(std::size_t n) -> mutable_buffers_type#
Get a mutable buffer sequence representing writable bytes.
-
inline void commit(std::size_t n)#
Convert writable bytes into readable bytes.
-
inline auto size() const noexcept -> std::size_t#
Get the number of readable bytes.
-
inline auto max_size() const noexcept -> std::size_t#
Get the maximum allowed of the capacity.
-
inline auto capacity() const noexcept -> std::size_t#
Get the capacity.