17#ifndef SIMPLE_VARIABLE_LEN_MSG_FRAME_HPP_INCLUDED
18#define SIMPLE_VARIABLE_LEN_MSG_FRAME_HPP_INCLUDED
20#include "asio/buffer.hpp"
61 hdr_decoder_func m_hdr_decoder_func;
65 m_hdr_decoder_func(func), m_hdr_processed(
false) { }
67 std::size_t operator() (asio::mutable_buffer buf)
noexcept {
68 if (!m_hdr_processed) {
69 auto sz = m_hdr_decoder_func(
static_cast<const std::byte*
>(buf.data()), buf.size());
70 m_hdr_processed = (sz != 0u);
73 m_hdr_processed =
false;
std::size_t(*)(const std::byte *ptr, std::size_t sz) hdr_decoder_func
Signature for a variable length message header decoder function, used in one of the basic_io_interfac...
Definition simple_variable_len_msg_frame.hpp:51
Function object class used in the basic_io_interface start_io methods, implements a common message fr...
Definition simple_variable_len_msg_frame.hpp:59