|
tin
1.5.9
|
#include <transport.h>

Static Public Member Functions | |
| template<std::size_t MaxBytes> | |
| static status | encode (typename Serializer::event_type const &event, serialized_event< MaxBytes > &record) |
| template<std::size_t MaxBytes> | |
| static status | decode (serialized_event< MaxBytes > const &record, typename Serializer::event_type &event) |
Serializer boundary for byte-oriented transports.
Serializer is application-owned and names the typed event it produces:
struct MySerializer { using event_type = MyMachine::SomeEvent; static constexpr std::uint32_t schema_version = 1; static constexpr std::uint16_t event_id = 42;
template<std::size_t N> static bool encode(event_type const& event, tsm::transport::serialized_event<N>& record);
template<std::size_t N> static bool decode(tsm::transport::serialized_event<N> const& record, event_type& event); };
Optional schema_version and event_id constants are checked before decode. The serializer owns payload interpretation and endian/layout decisions.
|
inlinestatic |
|
inlinestatic |