![]() |
XII Release 0.1.0
|
This class provides a base class for hashable structs (e.g. descriptor objects). More...
#include <HashableStruct.h>
Public Member Functions | |
xiiHashableStruct (const xiiHashableStruct< DERIVED > &other) | |
void | operator= (const xiiHashableStruct< DERIVED > &other) |
XII_ALWAYS_INLINE constexpr bool | operator== (const xiiHashableStruct< DERIVED > &rhs) const =default |
xiiUInt32 | CalculateHash () const |
Calculates the 32 bit hash of the struct and returns it. | |
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 xiiHashableStruct providing the type of your class / struct as the template parameter.