Pioneer
TypeId.h
Go to the documentation of this file.
1 // Copyright © 2008-2023 Pioneer Developers. See AUTHORS.txt for details
2 // Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3 
4 #pragma once
5 
6 #include "core/FNV1a.h"
7 
8 #ifdef _MSC_VER
9 #define FUNC_SOURCE __FUNCSIG__
10 #else
11 #define FUNC_SOURCE __PRETTY_FUNCTION__
12 #endif
13 
21 template <typename T>
22 class TypeId {
23 public:
24  inline static constexpr size_t Get()
25  {
27  }
28 
29  inline static constexpr uint32_t Get32()
30  {
32  }
33 
34 private:
35  template <size_t N>
36  inline static constexpr size_t Len(char const (&s)[N]) { return N; }
37 };
38 
39 #undef FUNC_SOURCE
constexpr uint32_t hash_32_fnv1a(const char *const data, size_t len)
Definition: FNV1a.h:13
constexpr uint64_t hash_64_fnv1a(const char *const data, size_t len)
Definition: FNV1a.h:29
#define FUNC_SOURCE
Definition: TypeId.h:11
Definition: TypeId.h:22
static constexpr size_t Get()
Definition: TypeId.h:24
static constexpr uint32_t Get32()
Definition: TypeId.h:29