/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Foundation/Algorithm/Implementation/HashableStruct_inl.h
46 строк
1 KB
Sanakan8472
# Rendering Setup Refactor (#1541)
27 апр 2025, 23:09
Не верифицирован
27 апр 2025, 23:09
715f6e5
Код
Авторство
О чём код?
#include <Foundation/Algorithm/HashingUtils.h> #include <Foundation/Memory/MemoryUtils.h> template <typename T> EZ_ALWAYS_INLINE ezHashableStruct<T>::ezHashableStruct() { ezMemoryUtils::ZeroFill<T>(static_cast<T*>(this), 1); } template <typename T> EZ_ALWAYS_INLINE ezHashableStruct<T>::ezHashableStruct(const ezHashableStruct<T>& other) { ezMemoryUtils::RawByteCopy(this, &other, sizeof(T)); } template <typename T> EZ_ALWAYS_INLINE void ezHashableStruct<T>::operator=(const ezHashableStruct<T>& other) { if (this != &other) { ezMemoryUtils::RawByteCopy(this, &other, sizeof(T)); } } template <typename T> bool ezHashableStruct<T>::operator==(const ezHashableStruct<T>& other) const { return ezMemoryUtils::RawByteCompare(this, &other, sizeof(T)) == 0; } template <typename T> bool ezHashableStruct<T>::operator!=(const ezHashableStruct<T>& other) const { return ezMemoryUtils::RawByteCompare(this, &other, sizeof(T)) != 0; } template <typename T> bool ezHashableStruct<T>::operator<(const ezHashableStruct<T>& other) const { return ezMemoryUtils::RawByteCompare(this, &other, sizeof(T)) < 0; } template <typename T> EZ_ALWAYS_INLINE ezUInt32 ezHashableStruct<T>::CalculateHash() const { return ezHashingUtils::xxHash32(this, sizeof(T)); }