BitStream
Loading...
Searching...
No Matches
bitstream::serialize_traits< checksum< Version > > Struct Template Reference

A trait used to serialize a checksum of the Version and the rest of the buffer as the first 32 bits. This should be called both first and last when reading and writing to a buffer. More...

#include <checksum_trait.h>

Static Public Member Functions

template<typename Stream >
static utility::is_writing_t< Stream > serialize (Stream &writer) noexcept
 
template<typename Stream >
static utility::is_reading_t< Stream > serialize (Stream &reader) noexcept
 

Static Public Attributes

static constexpr uint32_t protocol_version = utility::to_big_endian32_const(Version)
 
static constexpr uint32_t protocol_size = sizeof(uint32_t)
 

Detailed Description

template<uint32_t Version>
struct bitstream::serialize_traits< checksum< Version > >

A trait used to serialize a checksum of the Version and the rest of the buffer as the first 32 bits. This should be called both first and last when reading and writing to a buffer.

Template Parameters
VersionA unique version number

Member Function Documentation

◆ serialize() [1/2]

template<uint32_t Version>
template<typename Stream >
static utility::is_reading_t< Stream > bitstream::serialize_traits< checksum< Version > >::serialize ( Stream &  reader)
inlinestaticnoexcept

◆ serialize() [2/2]

template<uint32_t Version>
template<typename Stream >
static utility::is_writing_t< Stream > bitstream::serialize_traits< checksum< Version > >::serialize ( Stream &  writer)
inlinestaticnoexcept

Member Data Documentation

◆ protocol_size

template<uint32_t Version>
constexpr uint32_t bitstream::serialize_traits< checksum< Version > >::protocol_size = sizeof(uint32_t)
staticconstexpr

◆ protocol_version

template<uint32_t Version>
constexpr uint32_t bitstream::serialize_traits< checksum< Version > >::protocol_version = utility::to_big_endian32_const(Version)
staticconstexpr

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