The header a façade writes ahead of the application's body: what it derives from frames before the round's cut.
More...
#include <org/limitless/seqeron/protocol/Snapshot.hpp>
|
| static std::int32_t | version (const std::uint8_t *in, const std::size_t length) |
| | Reads the headerVersion a snapshot starts with.
|
| |
| static std::optional< SnapshotHeader > | decode (const std::uint8_t *in, const std::size_t length) |
| | Reads a header written by encode.
|
| |
The header a façade writes ahead of the application's body: what it derives from frames before the round's cut.
Little-endian and packed; the layout is in the Java twin, SnapshotHeader. Every instance of a source writes the same header (A-6).
◆ decode()
| static std::optional< SnapshotHeader > org::limitless::seqeron::protocol::SnapshotHeader::decode |
( |
const std::uint8_t * |
in, |
|
|
const std::size_t |
length |
|
) |
| |
|
inlinestatic |
Reads a header written by encode.
- Parameters
-
| in | the snapshot's first byte |
| length | the snapshot's bytes |
- Returns
- the header, or empty if it is not a VERSION header or does not fit length
◆ encode()
| std::size_t org::limitless::seqeron::protocol::SnapshotHeader::encode |
( |
std::uint8_t * |
out | ) |
const |
|
inline |
Writes the header.
- Parameters
-
- Returns
- the bytes written
◆ encodedLength()
| std::size_t org::limitless::seqeron::protocol::SnapshotHeader::encodedLength |
( |
| ) |
const |
|
inline |
◆ operator==()
| bool org::limitless::seqeron::protocol::SnapshotHeader::operator== |
( |
const SnapshotHeader & |
| ) |
const |
|
default |
◆ version()
| static std::int32_t org::limitless::seqeron::protocol::SnapshotHeader::version |
( |
const std::uint8_t * |
in, |
|
|
const std::size_t |
length |
|
) |
| |
|
inlinestatic |
Reads the headerVersion a snapshot starts with.
- Parameters
-
| in | the snapshot's first byte |
| length | the snapshot's bytes |
- Returns
- the version, or -1 if length cannot hold one
◆ FIXED_LENGTH
| constexpr std::size_t org::limitless::seqeron::protocol::SnapshotHeader::FIXED_LENGTH = 19 |
|
staticconstexpr |
◆ gateway
empty for an application's header
◆ GATEWAY_FIXED_LENGTH
| constexpr std::size_t org::limitless::seqeron::protocol::SnapshotHeader::GATEWAY_FIXED_LENGTH = 14 |
|
staticconstexpr |
◆ GATEWAY_ROW_LENGTH
| constexpr std::size_t org::limitless::seqeron::protocol::SnapshotHeader::GATEWAY_ROW_LENGTH = 5 + NAME_LENGTH |
|
staticconstexpr |
◆ GROUP_LENGTH
| constexpr std::size_t org::limitless::seqeron::protocol::SnapshotHeader::GROUP_LENGTH = 1 + NAME_LENGTH |
|
staticconstexpr |
◆ groups
| std::vector<SnapshotGroup> org::limitless::seqeron::protocol::SnapshotHeader::groups |
the active groups before the cut, in ascending groupId
◆ leaderMemberId
| std::int32_t org::limitless::seqeron::protocol::SnapshotHeader::leaderMemberId |
◆ leadershipTermId
| std::int64_t org::limitless::seqeron::protocol::SnapshotHeader::leadershipTermId |
◆ NAME_LENGTH
| constexpr std::size_t org::limitless::seqeron::protocol::SnapshotHeader::NAME_LENGTH = 32 |
|
staticconstexpr |
◆ NO_GATEWAY
| constexpr std::int32_t org::limitless::seqeron::protocol::SnapshotHeader::NO_GATEWAY = -1 |
|
staticconstexpr |
◆ VERSION
| constexpr std::uint16_t org::limitless::seqeron::protocol::SnapshotHeader::VERSION = 2 |
|
staticconstexpr |
The documentation for this struct was generated from the following file: