16 #include <boost/asio/buffer.hpp> 33 template <
size_t MaxNumberOfBuffers>
35 :
public std::enable_shared_from_this<MessageTmpl<MaxNumberOfBuffers>>,
40 return MaxNumberOfBuffers;
47 template <
typename... Buffers>
58 template <
typename... Buffers>
60 :
MessageTmpl(sizeof...(Buffers) + 1u, buf, buffers...) {
61 static_assert(
sizeof...(Buffers) <
max_size(),
"Too many buffers!");
66 auto size() const noexcept {
85 std::array<SharedBufferView, MaxNumberOfBuffers>
_buffers;
87 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< SharedBufferView, 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(size_t size, SharedBufferView buffer, Buffers... buffers)
std::shared_ptr< BufferView > SharedBufferView
Inherit (privately) to suppress copy/move construction and assignment.
MessageTmpl(SharedBufferView buf, Buffers... buffers)
static auto MakeListView(Iterator begin, Iterator end)