diff options
author | rtk0c <[email protected]> | 2022-05-30 15:56:29 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-05-30 15:56:29 -0700 |
commit | 80afa67d2b9f1c0605696a3fd69058544fe12fe4 (patch) | |
tree | 3dfe2a6f45e4f5ca8ad534baf06d76d9c558333b /source/Uid.hpp | |
parent | 0d92ecfdbfc875a099d9e83714b3a2209668fca5 (diff) | |
parent | 7d8bca09b3c4bf1418e758bd3bd0d6f85672153e (diff) |
Changeset: 53
Diffstat (limited to 'source/Uid.hpp')
-rw-r--r-- | source/Uid.hpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/source/Uid.hpp b/source/Uid.hpp deleted file mode 100644 index f58129c..0000000 --- a/source/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; - } -}; |