10 #ifndef BOOST_BEAST_MULTI_BUFFER_HPP 11 #define BOOST_BEAST_MULTI_BUFFER_HPP 16 #include <boost/asio/buffer.hpp> 17 #include <boost/intrusive/list.hpp> 21 #include <type_traits> 37 template<
class Allocator>
39 #if ! BOOST_BEAST_DOXYGEN
41 typename detail::allocator_traits<Allocator>::
42 template rebind_alloc<char>>
45 using base_alloc_type =
typename 47 template rebind_alloc<char>;
55 using list_type =
typename boost::intrusive::make_list<
element,
56 boost::intrusive::constant_time_size<true>>::type;
57 using iter =
typename list_type::iterator;
58 using const_iter =
typename list_type::const_iterator;
60 using size_type =
typename alloc_traits::size_type;
61 using const_buffer = boost::asio::const_buffer;
62 using mutable_buffer = boost::asio::mutable_buffer;
64 static_assert(std::is_base_of<std::bidirectional_iterator_tag,
65 typename std::iterator_traits<iter>::iterator_category>::value,
66 "BidirectionalIterator requirements not met");
68 static_assert(std::is_base_of<std::bidirectional_iterator_tag,
69 typename std::iterator_traits<const_iter>::iterator_category>::value,
70 "BidirectionalIterator requirements not met");
73 (std::numeric_limits<std::size_t>::max)();
76 size_type in_size_ = 0;
77 size_type in_pos_ = 0;
78 size_type out_pos_ = 0;
79 size_type out_end_ = 0;
85 #if BOOST_BEAST_DOXYGEN 129 std::size_t limit, Allocator
const& alloc);
152 Allocator
const& alloc);
167 Allocator
const& alloc);
173 template<
class OtherAlloc>
175 OtherAlloc>
const& other);
183 template<
class OtherAlloc>
212 template<
class OtherAlloc>
268 template<
class Alloc>
276 template<
class OtherAlloc>
285 template<
class DynamicBuffer>
287 copy_from(DynamicBuffer
const& other);
Definition: async_result.hpp:20
void consume(size_type n)
Remove bytes from the input sequence.
Definition: multi_buffer.ipp:776
basic_multi_buffer()
Definition: multi_buffer.ipp:426
Definition: multi_buffer.ipp:125
basic_multi_buffer & operator=(basic_multi_buffer &&other)
Definition: multi_buffer.ipp:565
size_type size() const
Returns the size of the input sequence.
Definition: multi_buffer.hpp:225
size_type max_size() const
Returns the permitted maximum sum of the sizes of the input and output sequence.
Definition: multi_buffer.hpp:232
friend void swap(basic_multi_buffer< Alloc > &lhs, basic_multi_buffer< Alloc > &rhs)
std::size_t capacity() const
Returns the maximum sum of the sizes of the input sequence and output sequence the buffer can hold wi...
Definition: multi_buffer.ipp:607
Definition: multi_buffer.ipp:158
void commit(size_type n)
Definition: multi_buffer.ipp:729
Definition: multi_buffer.hpp:38
~basic_multi_buffer()
Destructor.
Definition: multi_buffer.ipp:419
Definition: multi_buffer.ipp:90
mutable_buffers_type prepare(size_type n)
Definition: multi_buffer.ipp:630
allocator_type get_allocator() const
Returns a copy of the associated allocator.
Definition: multi_buffer.hpp:218
std::allocator_traits< Alloc > allocator_traits
Definition: allocator.hpp:34
Definition: empty_base_optimization.hpp:35
const_buffers_type data() const
Definition: multi_buffer.ipp:621
detail::allocator_traits< Allocator >::template rebind_alloc< char > & member() noexcept
Definition: empty_base_optimization.hpp:48
Allocator allocator_type
The type of allocator used.
Definition: multi_buffer.hpp:83