Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
Loading...
Searching...
No Matches
corium::wire::WirePacket< MaxPayloadSize > Struct Template Reference

Statically-sized zero-heap binary wire packet. More...

#include <WirePacket.hpp>

+ Collaboration diagram for corium::wire::WirePacket< MaxPayloadSize >:

Public Member Functions

void finalize (uint8_t typeIdx, uint16_t length, uint8_t flags=0, uint8_t version=CORIUM_WIRE_VERSION) noexcept
 Finalize packet header, set payload length and calculate CRC16 checksum.
 
bool isValid () const noexcept
 Validate packet magic identifier, schema version, payload length bounds, and CRC16 checksum.
 
constexpr size_t totalWireSize () const noexcept
 Total serialized wire size in bytes (header + payload length).
 
constexpr WirePacket ()=default
 

Public Attributes

WireHeader header {}
 
std::array< uint8_t, MaxPayloadSize > payload {}
 

Detailed Description

template<size_t MaxPayloadSize = 64>
struct corium::wire::WirePacket< MaxPayloadSize >

Statically-sized zero-heap binary wire packet.

Template Parameters
MaxPayloadSizeMaximum payload capacity in bytes (default: 64).

Constructor & Destructor Documentation

◆ WirePacket()

template<size_t MaxPayloadSize = 64>
constexpr corium::wire::WirePacket< MaxPayloadSize >::WirePacket ( )
constexprdefault

Member Function Documentation

◆ finalize()

template<size_t MaxPayloadSize = 64>
void corium::wire::WirePacket< MaxPayloadSize >::finalize ( uint8_t  typeIdx,
uint16_t  length,
uint8_t  flags = 0,
uint8_t  version = CORIUM_WIRE_VERSION 
)
inlinenoexcept

Finalize packet header, set payload length and calculate CRC16 checksum.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isValid()

template<size_t MaxPayloadSize = 64>
bool corium::wire::WirePacket< MaxPayloadSize >::isValid ( ) const
inlinenoexcept

Validate packet magic identifier, schema version, payload length bounds, and CRC16 checksum.

+ Here is the call graph for this function:

◆ totalWireSize()

template<size_t MaxPayloadSize = 64>
constexpr size_t corium::wire::WirePacket< MaxPayloadSize >::totalWireSize ( ) const
inlineconstexprnoexcept

Total serialized wire size in bytes (header + payload length).

Member Data Documentation

◆ header

template<size_t MaxPayloadSize = 64>
WireHeader corium::wire::WirePacket< MaxPayloadSize >::header {}

◆ payload

template<size_t MaxPayloadSize = 64>
std::array<uint8_t, MaxPayloadSize> corium::wire::WirePacket< MaxPayloadSize >::payload {}

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