diff options
author | rtk0c <[email protected]> | 2022-06-03 23:30:01 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-06-03 23:30:01 -0700 |
commit | 791b3f354b378769bffe623b05f1305c91b77101 (patch) | |
tree | 5409b311e6232eb4a6d3f8259b780d76b8ee1c59 /source/Common/Uid.hpp | |
parent | 60ccc62f4934e44ad5b905fdbcf458302b8d8a09 (diff) |
Changeset: 64 [WIP] Rename directoriesmaster-switch-to-build2
Diffstat (limited to 'source/Common/Uid.hpp')
-rw-r--r-- | source/Common/Uid.hpp | 42 |
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; - } -}; |