33 template <
typename T >
35 { T::endianess } -> std::convertible_to< std::endian >;
37 requires convertible< typename T::size_type >;
38 requires convertible< typename T::checksum_type >;
41 template <
typename Def,
typename Payload >
44 std::decay_t< decltype( Def::prefix ) >,
46 typename Def::checksum_type >;
48 template < packet_def Def,
typename Payload >
54 static constexpr
auto prefix = Def::prefix;
71 static_assert( fixedly_sized< size_type > );
78 static constexpr
auto prefix = Def::prefix;
81 static constexpr std::size_t
get_size(
auto const& buffer )
83 std::array< std::byte, size_size > tmp;
85 auto iter = std::begin( buffer );
87 std::copy_n( iter,
size_size, tmp.begin() );
97 return Def::get_checksum( mview );
Definition: sequencer.h:42
Generic class to represent view of some container.
Definition: view.h:41
MIT License.
Definition: multiplexer.h:33
concept packet_def
Definition: packet.h:34
requires(std::is_enum_v< T >) struct serializer< T
bounded< std::size_t, max_size, max_size > size_type
Definition: serializer.h:74
static constexpr std::size_t max_size
Definition: serializer.h:73
Each definition of item provided to protocol library should have specialization of 'proto_traits' str...
Definition: traits.h:44
Creates a segment starting with counter defined by CounterDef, this counter limits how many bytes are...
Definition: base.h:104
std::variant< int64_t, float, bool, string_buffer > value_type
Definition: base.h:51
constexpr bool is_std_array_v
Definition: base.h:160
typename base::message_type message_type
Definition: packet.h:75
static constexpr std::size_t get_size(auto const &buffer)
Definition: packet.h:81
static constexpr std::size_t fixed_size
Definition: packet.h:79
static constexpr auto prefix
Definition: packet.h:78
typename payload_traits::value_type value_type
Definition: packet.h:66
typename Def::size_type size_type
Definition: packet.h:61
static constexpr checksum_type get_checksum(view< std::byte const * > const mview)
Definition: packet.h:95
static constexpr std::size_t prefix_size
Definition: packet.h:59
static constexpr auto prefix
Definition: packet.h:54
static constexpr std::size_t size_size
Definition: packet.h:63
std::decay_t< decltype(prefix) > prefix_type
Definition: packet.h:57
Payload payload_type
Definition: packet.h:51
typename Def::checksum_type checksum_type
Definition: packet.h:68
static constexpr auto endianess
Definition: packet.h:55
Definition: serializer.h:38
static constexpr T deserialize(std::span< std::byte const, max_size > const &buffer)
Definition: serializer.h:56
tuple is high levle alternative to use just 'std::tuple' that is more friendly for standalone protoco...
Definition: tuple.h:43
message< max_size > message_type
Definition: tuple.h:58