/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Foundation/Algorithm/HashableStruct.h
30 строк
1 KB
Sanakan8472
# Rendering Setup Refactor (#1541)
27 апр 2025, 23:09
Не верифицирован
27 апр 2025, 23:09
715f6e5
Код
Авторство
О чём код?
#pragma once #include <Foundation/Basics.h> /// \brief This class provides a base class for hashable structs (e.g. descriptor objects). /// /// To help with this there are two parts: /// 1) memclear on initialization. /// 2) a CalculateHash() function calculating the 32 bit hash of the object. /// /// You can make your own struct hashable by deriving from ezHashableStruct providing the type of /// your class / struct as the template parameter. template <typename DERIVED> class ezHashableStruct { public: ezHashableStruct(); // [tested] ezHashableStruct(const ezHashableStruct<DERIVED>& other); // [tested] void operator=(const ezHashableStruct<DERIVED>& other); // [tested] bool operator==(const ezHashableStruct<DERIVED>& other) const; bool operator!=(const ezHashableStruct<DERIVED>& other) const; bool operator<(const ezHashableStruct<DERIVED>& other) const; /// \brief Calculates the 32 bit hash of the struct and returns it ezUInt32 CalculateHash() const; // [tested] }; #include <Foundation/Algorithm/Implementation/HashableStruct_inl.h>