aboutsummaryrefslogtreecommitdiff
path: root/source/10-common/Uid.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2023-10-19 22:50:07 -0700
committerrtk0c <[email protected]>2023-10-19 22:50:07 -0700
commit2c92e07f337e42cf58970443f9de678f85a9b2a4 (patch)
tree075d5407e1e12a9d35cbee6e4c20ad34e0765c42 /source/10-common/Uid.hpp
parent615809c036f604bce4582cea8ad49c64693f4f45 (diff)
The great renaming: switch to "module style"
Diffstat (limited to 'source/10-common/Uid.hpp')
-rw-r--r--source/10-common/Uid.hpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/source/10-common/Uid.hpp b/source/10-common/Uid.hpp
deleted file mode 100644
index a691911..0000000
--- a/source/10-common/Uid.hpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#pragma once
-
-#include "Utils.hpp"
-
-#include <rapidjson/fwd.h>
-#include <cinttypes>
-#include <functional>
-#include <string>
-#include <string_view>
-
-#define BRUSSEL_Uid_SCAN_STR "%" PRIx64 "-%" PRIx64
-#define BRUSSEL_Uid_SCAN_EXPAND(uid) &((uid).upper), &((uid).upper)
-#define BRUSSEL_Uid_FORMAT_STR "%016" PRIx64 "-%016" PRIx64
-#define BRUSSEL_Uid_FORMAT_EXPAND(uid) (uid).upper, (uid).lower
-
-// Serialize Uid object as an array with two elements, instead of the simple string format
-#define BRUSSEL_Uid_WRITE_USE_ARRAY 0
-
-struct Uid {
- uint64_t upper = 0;
- uint64_t lower = 0;
-
- // Generate a random Uid
- static Uid Create();
-
- bool IsNull() const;
-
- void ReadString(std::string_view str);
- std::string WriteString();
-
- void Read(const rapidjson::Value& value);
- void WriteInto(rapidjson::Value& value, rapidjson::Document& root) const;
- rapidjson::Value Write(rapidjson::Document& root) const;
-
- auto operator<=>(const Uid&) const = default;
-};
-
-template <>
-struct std::hash<Uid> {
- size_t operator()(const Uid& uid) const {
- size_t hash = 0;
- Utils::HashCombine(hash, uid.upper);
- Utils::HashCombine(hash, uid.lower);
- return hash;
- }
-};