Crunch
A Message Definition Language for Getting Things Right
Loading...
Searching...
No Matches
Crunch::Buffer< Message, Integrity, Serdes, N > Struct Template Reference

A lightweight wrapper around a std::array for serializing/deserializing messages. More...

#include <crunch.hpp>

Public Types

using MessageType = Message
 
using IntegrityType = Integrity
 
using SerdesType = Serdes
 

Public Member Functions

constexpr auto span () noexcept
 
constexpr auto span () const noexcept
 
constexpr auto serialized_message_span () const noexcept
 

Public Attributes

std::array< std::byte, N > data
 
std::size_t used_bytes {0}
 

Static Public Attributes

static constexpr std::size_t Size = N
 

Detailed Description

template<typename Message, typename Integrity, typename Serdes, std::size_t N>
struct Crunch::Buffer< Message, Integrity, Serdes, N >

A lightweight wrapper around a std::array for serializing/deserializing messages.

Encodes the Message, Integrity, and Serdes types, and provides a span interface to the underlying data.

Template Parameters
MessageThe CrunchMessage type this buffer is for.
IntegrityThe IntegrityPolicy used.
SerdesThe SerdesPolicy used.
NThe size of the buffer in bytes.

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