Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
database_header_object.hpp
Go to the documentation of this file.
1#pragma once
3
5
6namespace sysio { namespace chain {
16 class database_header_object : public chainbase::object<database_header_object_type, database_header_object>
17 {
19
20
29 static constexpr uint32_t current_version = 2;
30 static constexpr uint32_t minimum_version = 2;
31
32 id_type id;
33 uint32_t version = current_version;
34
35 void validate() const {
36 SYS_ASSERT(std::clamp(version, minimum_version, current_version) == version, bad_database_version_exception,
37 "state database version is incompatible, please restore from a compatible snapshot or replay!",
38 ("version", version)("minimum_version", minimum_version)("maximum_version", current_version));
39 }
40 };
41
42 struct by_block_id;
45 indexed_by<
46 ordered_unique<tag<by_id>, BOOST_MULTI_INDEX_MEMBER(database_header_object, database_header_object::id_type, id)>
47 >
48 >;
49
50 } }
51
53
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
#define OBJECT_CTOR(...)
Definition types.hpp:39
#define CHAINBASE_SET_INDEX_TYPE(OBJECT_TYPE, INDEX_TYPE)
tracks the version of the application data stored in the database
boost::multi_index_container< Object, Args..., chainbase::node_allocator< Object > > shared_multi_index_container
chainbase::shared_multi_index_container< database_header_object, indexed_by< ordered_unique< tag< by_id >, BOOST_MULTI_INDEX_MEMBER(database_header_object, database_header_object::id_type, id)> > > database_header_multi_index
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
unsigned int uint32_t
Definition stdint.h:126