Corium 1.1.0
High-Performance Zero-Heap C++20 MPSC Application Runtime
Loading...
Searching...
No Matches
corium::wire::WireSerializer Class Reference

Zero-heap type-safe serializer and deserializer for Corium event variants over binary wire streams. More...

#include <Serializer.hpp>

+ Collaboration diagram for corium::wire::WireSerializer:

Static Public Member Functions

template<typename EventVariant , size_t MaxPayload = 64, typename Sink >
static bool deserializeAndPush (const WirePacket< MaxPayload > &packet, Sink &sink, EventPriority priority=EventPriority::Normal) noexcept
 Deserialize a validated binary WirePacket directly into an event sink.
 
template<typename Event , typename EventVariant , size_t MaxPayload = 64>
static WirePacket< MaxPayload > serialize (const Event &event) noexcept
 Serialize a trivially-copyable concrete event into a fixed-size binary WirePacket.
 

Detailed Description

Zero-heap type-safe serializer and deserializer for Corium event variants over binary wire streams.

Member Function Documentation

◆ deserializeAndPush()

template<typename EventVariant , size_t MaxPayload = 64, typename Sink >
static bool corium::wire::WireSerializer::deserializeAndPush ( const WirePacket< MaxPayload > &  packet,
Sink &  sink,
EventPriority  priority = EventPriority::Normal 
)
inlinestaticnoexcept

Deserialize a validated binary WirePacket directly into an event sink.

Template Parameters
EventVariantVariant list of all supported events.
MaxPayloadPayload size limit.
SinkTarget EventSink or EventBus.
Parameters
packetIncoming packet to validate and deserialize.
sinkEvent sink to receive the deserialized event.
priorityPriority to assign to the deserialized event.
Returns
true if packet was valid and successfully dispatched into sink; false on validation/type error.

◆ serialize()

template<typename Event , typename EventVariant , size_t MaxPayload = 64>
static WirePacket< MaxPayload > corium::wire::WireSerializer::serialize ( const Event event)
inlinestaticnoexcept

Serialize a trivially-copyable concrete event into a fixed-size binary WirePacket.

Template Parameters
EventConcrete event type to serialize.
EventVariantTarget variant list to determine type index.
MaxPayloadPayload size limit.
Parameters
eventEvent instance to serialize.
Returns
Serialized and CRC-validated WirePacket.
+ Here is the call graph for this function:

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