10 #ifndef BOOST_BEAST_FLAT_BUFFER_HPP 11 #define BOOST_BEAST_FLAT_BUFFER_HPP 16 #include <boost/asio/buffer.hpp> 44 template<
class Allocator>
46 #if ! BOOST_BEAST_DOXYGEN
48 typename detail::allocator_traits<Allocator>::
49 template rebind_alloc<char>>
57 template<
class OtherAlloc>
60 using base_alloc_type =
typename 62 template rebind_alloc<char>;
70 dist(
char const* first,
char const* last)
72 return static_cast<std::size_t
>(last - first);
128 std::size_t limit, Allocator
const& alloc);
166 Allocator
const& alloc);
172 template<
class OtherAlloc>
182 template<
class OtherAlloc>
185 Allocator
const& alloc);
213 template<
class OtherAlloc>
228 return dist(in_, out_);
242 return dist(begin_, end_);
249 return {in_, dist(in_, out_)};
274 out_ += (std::min)(n, dist(out_, last_));
297 template<
class Alloc>
308 template<
class DynamicBuffer>
310 copy_from(DynamicBuffer
const& other);
~basic_flat_buffer()
Destructor.
Definition: flat_buffer.ipp:27
allocator_type get_allocator() const
Returns a copy of the associated allocator.
Definition: flat_buffer.hpp:219
mutable_buffers_type prepare(std::size_t n)
Definition: flat_buffer.ipp:240
Definition: async_result.hpp:20
void shrink_to_fit()
Definition: flat_buffer.ipp:304
basic_flat_buffer()
Definition: flat_buffer.ipp:36
std::size_t size() const
Returns the size of the input sequence.
Definition: flat_buffer.hpp:226
Definition: flat_buffer.hpp:45
friend void swap(basic_flat_buffer< Alloc > &lhs, basic_flat_buffer< Alloc > &rhs)
Exchange two flat buffers.
boost::asio::mutable_buffers_1 mutable_buffers_type
The type used to represent the output sequence as a list of buffers.
Definition: flat_buffer.hpp:90
basic_flat_buffer & operator=(basic_flat_buffer &&other)
Definition: flat_buffer.ipp:201
const_buffers_type data() const
Get a list of buffers that represent the input sequence.
Definition: flat_buffer.hpp:247
boost::asio::mutable_buffers_1 const_buffers_type
The type used to represent the input sequence as a list of buffers.
Definition: flat_buffer.hpp:87
void commit(std::size_t n)
Definition: flat_buffer.hpp:272
std::size_t max_size() const
Return the maximum sum of the input and output sequence sizes.
Definition: flat_buffer.hpp:233
std::allocator_traits< Alloc > allocator_traits
Definition: allocator.hpp:34
Allocator allocator_type
The type of allocator used.
Definition: flat_buffer.hpp:84
Definition: empty_base_optimization.hpp:35
detail::allocator_traits< Allocator >::template rebind_alloc< char > & member() noexcept
Definition: empty_base_optimization.hpp:48
std::size_t capacity() const
Return the maximum sum of input and output sizes that can be held without an allocation.
Definition: flat_buffer.hpp:240
void consume(std::size_t n)
Definition: flat_buffer.ipp:290