15 #include <boost/asio/buffer.hpp> 32 template <
size_t MaxNumberOfBuffers>
34 :
public std::enable_shared_from_this<MessageTmpl<MaxNumberOfBuffers>>,
39 return MaxNumberOfBuffers;
46 template <
typename... Buffers>
57 template <
typename... Buffers>
60 static_assert(
sizeof...(Buffers) <
max_size(),
"Too many buffers!");
65 auto size() const noexcept {
84 std::array<Buffer, MaxNumberOfBuffers>
_buffers;
86 std::array<boost::asio::const_buffer, MaxNumberOfBuffers + 1u>
_buffer_views;
message_size_type _total_size
static constexpr size_t max_size()
auto size() const noexcept
Size in bytes of the message excluding the header.
auto GetBufferSequence() const
std::array< Buffer, MaxNumberOfBuffers > _buffers
std::array< boost::asio::const_buffer, MaxNumberOfBuffers+1u > _buffer_views
This file contains definitions of common data structures used in traffic manager. ...
uint32_t message_size_type
bool empty() const noexcept
message_size_type _number_of_buffers
Serialization of a set of buffers to be sent over a TCP socket as a single message.
MessageTmpl(Buffer &&buf, Buffers &&... buffers)
MessageTmpl(size_t size, Buffer &&buffer, Buffers &&... buffers)
Inherit (privately) to suppress copy/move construction and assignment.
static auto MakeListView(Iterator begin, Iterator end)