Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
environment.hpp
Go to the documentation of this file.
1#pragma once
3#include <iomanip>
5namespace chainbase {
7constexpr size_t header_size = 1024;
8constexpr uint64_t header_id = 0x3242444f49534f45ULL; //"SYSIODB2" little endian
12 strncpy(compiler, __VERSION__, sizeof(compiler)-1);
13 }
14
15 enum os_t : unsigned char {
20 };
27
28 bool debug =
29#ifndef NDEBUG
30 true;
31#else
32 false;
33#endif
35#if defined(__linux__)
37#elif defined(__APPLE__)
39#elif defined(_WIN32)
41#else
43#endif
45#if defined(__x86_64__)
47#elif defined(__aarch64__)
49#elif defined(__riscv__)
51#else
53#endif
54
55 unsigned boost_version = BOOST_VERSION;
56 uint8_t reserved[512] = {};
57 char compiler[256] = {};
58
59 bool operator==(const environment& other) {
60 return !memcmp(this, &other, sizeof(environment));
61 }
62 bool operator!=(const environment& other) {
63 return !(*this == other);
64 }
65} __attribute__ ((packed));
66
67struct db_header {
69 bool dirty = false;
71} __attribute__ ((packed));
72
73constexpr size_t header_dirty_bit_offset = offsetof(db_header, dirty);
74
75static_assert(sizeof(db_header) <= header_size, "DB header struct too large");
76
77std::ostream& operator<<(std::ostream& os, const chainbase::environment& dt);
78
79}
os_t os
constexpr size_t header_dirty_bit_offset
DataStream & operator<<(DataStream &ds, const oid< OidType > &oid)
constexpr size_t header_size
constexpr uint64_t header_id
struct chainbase::environment __attribute__((packed))
unsigned char uint8_t
Definition stdint.h:124
unsigned __int64 uint64_t
Definition stdint.h:136
bool operator==(const environment &other)
bool operator!=(const environment &other)