CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
Hash.hpp File Reference
#include "CeresEngine/DataTypes.hpp"
#include "CeresEngine/Foundation/String.hpp"
#include <functional>
#include <utility>
#include <string>

Go to the source code of this file.

Classes

struct  CeresEngine::Hasher< T >
 A reflection pre-processor that creates a hash for an object. More...
 

Namespaces

namespace  CeresEngine
 

Macros

#define CE_REFLECT_HASH(T)
 

Functions

template<typename T >
constexpr size_t CeresEngine::hash (const T &v)
 Generates a hash for the provided type.
 
template<typename T >
constexpr void CeresEngine::combine (std::size_t &seed, const T &v)
 Generates a new hash for the provided type using the default standard hasher and combines it with a previous hash.
 
template<typename... Ts>
constexpr size_t CeresEngine::hash (const Ts &... values)
 Generates and combines a hash for all values.
 
template<typename T >
constexpr UInt32 CeresEngine::staticHash32 (BasicStringView< T > string, const UInt32 value=0x811c9dc5) noexcept
 
template<typename T >
constexpr UInt64 CeresEngine::staticHash64 (BasicStringView< T > string, const UInt64 value=0xcbf29ce484222325) noexcept
 

Macro Definition Documentation

◆ CE_REFLECT_HASH

#define CE_REFLECT_HASH (   T)
Value:
template<> struct std::hash<T> { \
inline constexpr size_t operator()(const T& object) const noexcept { \
::CeresEngine::Hasher hasher{object}; \
T::reflect(hasher); \
return hasher.hash; \
} \
}
A reflection pre-processor that creates a hash for an object.
Definition Hash.hpp:48