Joedb 9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Header.h
Go to the documentation of this file.
1#ifndef joedb_Header_declared
2#define joedb_Header_declared
3
4#include <stdint.h>
5#include <cstddef>
6#include <array>
7
8namespace joedb
9{
10 // @ingroup journal
11 struct Header
12 {
13 std::array<int64_t, 4> checkpoint;
14 uint32_t version;
15 std::array<char, 5> signature;
16
17 static constexpr std::array<char, 5> joedb{'j', 'o', 'e', 'd', 'b'};
18 static constexpr int64_t ssize = 41;
19 static constexpr size_t size = ssize;
20 };
21
22 static_assert(offsetof(Header, checkpoint) == 0);
23 static_assert(offsetof(Header, version) == 32);
24 static_assert(offsetof(Header, signature) == 36);
25 static_assert(sizeof(std::array<char, 5>) == 5);
26}
27
28#endif
Definition Blob.h:7
static constexpr int64_t ssize
Definition Header.h:18
static constexpr size_t size
Definition Header.h:19
std::array< char, 5 > signature
Definition Header.h:15
uint32_t version
Definition Header.h:14
std::array< int64_t, 4 > checkpoint
Definition Header.h:13