A deterministic, fixed-size binary serialization policy.
More...
#include <crunch_static_layout.hpp>
|
| static constexpr Crunch::Format | GetFormat () noexcept |
| | Gets the Crunch format corresponding to the alignment.
|
| |
| template<typename Message > |
| static constexpr std::size_t | Size () noexcept |
| | Calculates the serialized size of a message.
|
| |
| template<typename Message > |
| static constexpr std::size_t | Serialize (const Message &msg, std::span< std::byte > output) noexcept |
| | Serializes a message into the output buffer.
|
| |
| template<typename Message > |
| static constexpr auto | Deserialize (std::span< const std::byte > input, Message &msg) noexcept -> std::optional< Error > |
| | Deserializes a message from the input buffer.
|
| |
template<std::size_t Alignment = 1>
struct Crunch::serdes::StaticLayout< Alignment >
A deterministic, fixed-size binary serialization policy.
◆ Deserialize()
template<std::size_t Alignment = 1>
template<typename Message >
|
|
inlinestaticconstexprnoexcept |
Deserializes a message from the input buffer.
- Template Parameters
-
- Parameters
-
| input | The input buffer. |
| msg | The message object to populate. |
- Returns
- std::nullopt on success, or an Error on failure.
◆ GetFormat()
template<std::size_t Alignment = 1>
|
|
inlinestaticconstexprnoexcept |
Gets the Crunch format corresponding to the alignment.
- Returns
- The format enum.
◆ Serialize()
template<std::size_t Alignment = 1>
template<typename Message >
|
|
inlinestaticconstexprnoexcept |
Serializes a message into the output buffer.
- Template Parameters
-
- Parameters
-
| msg | The message to serialize. |
| output | The output buffer. |
- Returns
- The number of bytes written.
◆ Size()
template<std::size_t Alignment = 1>
template<typename Message >
|
|
inlinestaticconstexprnoexcept |
Calculates the serialized size of a message.
- Template Parameters
-
- Returns
- The size in bytes.
The documentation for this struct was generated from the following files: