emlabcpp
modern opinionated embedded C++ library
emlabcpp::protocol::sequencer< Def > Class Template Reference

#include <sequencer.h>

Public Types

using message_type = typename Def::message_type
 

Public Member Functions

template<typename Container >
void insert (Container &&dview)
 
std::variant< sequencer_read_request, message_typeget_message ()
 

Static Public Attributes

static constexpr auto prefix = Def::prefix
 
static constexpr std::size_t fixed_size = Def::fixed_size
 

Member Typedef Documentation

◆ message_type

template<typename Def >
using emlabcpp::protocol::sequencer< Def >::message_type = typename Def::message_type

Member Function Documentation

◆ get_message()

template<typename Def >
std::variant< sequencer_read_request, message_type > emlabcpp::protocol::sequencer< Def >::get_message ( )
inline

not match, remove one byte from buffer

partial match - more bytes could be matched

partial match - matched maximum bytes available

This is implied by the fact that we should have full match at the start of buffer

clean up only the matched message

References emlabcpp::static_circular_buffer< T, N >::begin(), emlabcpp::copy(), EMLABCPP_ASSERT, emlabcpp::static_circular_buffer< T, N >::empty(), emlabcpp::static_circular_buffer< T, N >::end(), emlabcpp::protocol::sequencer< Def >::fixed_size, emlabcpp::static_circular_buffer< T, N >::pop_front(), emlabcpp::protocol::sequencer< Def >::prefix, emlabcpp::res, emlabcpp::static_circular_buffer< T, N >::size(), and emlabcpp::view_n().

◆ insert()

template<typename Def >
template<typename Container >
void emlabcpp::protocol::sequencer< Def >::insert ( Container &&  dview)
inline

References emlabcpp::copy().

Member Data Documentation

◆ fixed_size

template<typename Def >
constexpr std::size_t emlabcpp::protocol::sequencer< Def >::fixed_size = Def::fixed_size
staticconstexpr

◆ prefix

template<typename Def >
constexpr auto emlabcpp::protocol::sequencer< Def >::prefix = Def::prefix
staticconstexpr

The documentation for this class was generated from the following file: