Goddess of Justice DB, the database used for storage on IzaroDFS
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

33 rader
803 B

5 år sedan
5 år sedan
5 år sedan
  1. #pragma once
  2. #include "endian.hpp"
  3. #include "database.hpp"
  4. enum class db_op : uint32_t {
  5. version = 0,
  6. read = 1,
  7. write = 2,
  8. remove = 3,
  9. stats = 4
  10. };
  11. struct [[gnu::packed]] received_data {
  12. bitops::regulated<db_op> op = db_op::version;
  13. bitops::regulated<uint64_t> rep_id = 0;
  14. record_identifier identifier = record_identifier{};
  15. db_page page = {0};
  16. };
  17. struct [[gnu::packed]] sending_data {
  18. bitops::regulated<uint64_t> rep_id = 0;
  19. record_identifier identifier = record_identifier{};
  20. db_page page = {0};
  21. };
  22. struct [[gnu::packed]] stats_data {
  23. bitops::regulated<uint64_t> free;
  24. bitops::regulated<uint64_t> free_deleted;
  25. bitops::regulated<uint64_t> total_pages;
  26. bitops::regulated<uint64_t> total_records;
  27. bitops::regulated<uint64_t> total_delete;
  28. bitops::regulated<uint64_t> cow_full;
  29. };