34 UUID(std::array<unsigned char, 16> bytes) {
m_Bytes = bytes; }
39 [[nodiscard]]
const char*
ToString()
const;
49 friend std::ostream&
operator<<(std::ostream& os,
const UUID& obj);
55 static const size_t FNV_PRIME = 1099511628211ULL;
56 static const size_t FNV_OFFSET_BASIS = 14695981039346656037ULL;
57 size_t hash = FNV_OFFSET_BASIS;
58 for (
size_t i = 0; i < 16; ++i) {
59 hash ^=
static_cast<size_t>(uuid.
m_Bytes[i]);
87 for (
int i = 0; i < 16; ++i) {
97 for (
int i = 0; i < 16; ++i) {
Represents a single 16-byte opaque uuid-like unique identifier.
Definition UUID.h:31
friend std::ostream & operator<<(std::ostream &os, const UUID &obj)
Streams the UUID in its string form.
Definition UUID.cc:11
bool operator<=(const UUID &other) const
Returns true when this UUID sorts before or equal to another.
Definition UUID.h:75
const char * ToString() const
Converts the UUID into its string form.
Definition UUID.cc:15
std::array< unsigned char, 16 > Bytes()
Returns the raw 16-byte UUID payload.
Definition UUID.h:37
static UUID FromString(const char *str)
Parses a UUID from a string representation.
Definition UUID.cc:50
bool operator!=(const UUID &other) const
Compares two UUID values for inequality.
Definition UUID.cc:28
static UUID Gen()
Generates a new UUID value.
Definition UUID.cc:34
std::array< unsigned char, 16 > m_Bytes
Definition UUID.h:104
UUID operator+(const UUID &other) const
Combines two UUID values with byte-wise XOR.
Definition UUID.h:85
bool operator<(const UUID &other) const
Orders UUID values lexicographically by raw bytes.
Definition UUID.h:66
bool operator==(const UUID &other) const
Compares two UUID values for equality.
Definition UUID.cc:31
UUID(std::array< unsigned char, 16 > bytes)
Constructs a UUID from raw bytes.
Definition UUID.h:34
UUID()
Definition UUID.h:35
bool operator>=(const UUID &other) const
Returns true when this UUID sorts after or equal to another.
Definition UUID.h:80
bool operator>(const UUID &other) const
Orders UUID values lexicographically by raw bytes.
Definition UUID.h:70
UUID operator-(const UUID &other) const
Subtracts UUID bytes pairwise.
Definition UUID.h:95
The FuncDoodle C++ namespace.
Definition Common.h:12
Hash functor for using UUID as an associative-container key.
Definition UUID.h:52
size_t operator()(const UUID &uuid) const
Computes a stable hash for a UUID value.
Definition UUID.h:54