aboutsummaryrefslogtreecommitdiff
path: root/source-common/Uid.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-05-30 17:03:20 -0700
committerrtk0c <[email protected]>2022-05-30 17:03:20 -0700
commite66286ebe30afc9acc4531fc2bea29b7fb924f93 (patch)
treefa6b76554c3eb88bc8f088fbab68e20c40118ca7 /source-common/Uid.hpp
parent366ef5a5450c6e0e680c924c3454943a9ae9814d (diff)
Changeset: 56 Buildsystem cleanup: change to layered structure for different targets
Diffstat (limited to 'source-common/Uid.hpp')
-rw-r--r--source-common/Uid.hpp42
1 files changed, 0 insertions, 42 deletions
diff --git a/source-common/Uid.hpp b/source-common/Uid.hpp
deleted file mode 100644
index f58129c..0000000
--- a/source-common/Uid.hpp
+++ /dev/null
@@ -1,42 +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
-
-struct Uid {
- uint64_t upper = 0;
- uint64_t lower = 0;
-
- 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);
- rapidjson::Value Write(rapidjson::Document& root);
-
- 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;
- }
-};