LkEngine 0.1.2
 
Loading...
Searching...
No Matches
UUID.h
1#pragma once
2
3#include <stdint.h>
4
5namespace LkEngine {
6
12 struct LUUID
13 {
14 using SizeType = uint64_t;
15
16 LUUID();
17 LUUID(const SizeType InUUID);
18 LUUID(const LUUID&) = default;
19
20 operator uint64_t() const { return UUID; }
21
22 private:
23 uint64_t UUID = 0;
24 };
25
26 static_assert(std::disjunction_v<
27 std::is_same<LUUID::SizeType, uint64_t>,
28 std::is_same<LUUID::SizeType, uint32_t>
29 >, "LUUID::SizeType is not valid");
30}
31
32namespace std
33{
34 template<typename T>
35 struct hash;
36
37 template<>
39 {
40 std::size_t operator()(const ::LkEngine::LUUID& uuid) const
41 {
42 return (uint64_t)uuid;
43 }
44 };
45}
Definition Asset.h:11
Definition UUID.h:33
Definition UUID.h:13
Definition UUID.h:35