EntropyEngine::Core::TypeSystem::TypeID
EntropyEngine::Core::TypeSystem::TypeID
Section titled “EntropyEngine::Core::TypeSystem::TypeID”A cross-platform type identifier with stable hashing and comparison. More…
#include <TypeID.h>
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| std::string | prettyName() const Get the human-readable type name. |
| bool | operator==(const TypeID & other) const Equality comparison operator. |
| auto | operator<=>(const TypeID & other) const Three-way comparison operator for ordering TypeIDs. |
Public Attributes
Section titled “Public Attributes”| Name | |
|---|---|
| std::string | name Human-readable name of the type. |
| uint64_t | id 64-bit canonical hash identifier for the type |
Detailed Description
Section titled “Detailed Description”struct EntropyEngine::Core::TypeSystem::TypeID;A cross-platform type identifier with stable hashing and comparison.
Note: TypeID objects are immutable and safe to use across thread boundaries
TypeID provides a consistent way to identify types at runtime across different platforms and compilers. It uses boost::type_index internally to generate stable hash codes and human-readable type names.
Features:
- Stable hash codes across compilation units
- Human-readable type names with template parameters (optionally compiled in)
- Supports comparison operations
- Compatible with standard containers (via std::hash specialization)
Example usage:
auto intTypeId = createTypeId<int>();auto floatTypeId = createTypeId<float>();
if (intTypeId == floatTypeId) { // Never executed - different types}Public Functions Documentation
Section titled “Public Functions Documentation”function prettyName
Section titled “function prettyName”inline std::string prettyName() constGet the human-readable type name.
Return: The pretty-printed name of the type with template parameters
This method returns the same value as the [name](/api/EntropyEngine/Core/TypeSystem/TypeID/#variable-name) member but provides a method-based interface for consistency with other APIs.
function operator==
Section titled “function operator==”inline bool operator==( const TypeID & other) constEquality comparison operator.
Parameters:
- other The TypeID to compare against
Return: true if both TypeIDs represent the same type
function operator<=>
Section titled “function operator<=>”inline auto operator<=>( const TypeID & other) constThree-way comparison operator for ordering TypeIDs.
Parameters:
- other The TypeID to compare against
Return: std::strong_ordering result based on hash comparison
Public Attributes Documentation
Section titled “Public Attributes Documentation”variable name
Section titled “variable name”std::string name;Human-readable name of the type.
Contains the canonical type name including template parameters. For example: “glm::vec<3, float>” or “std::vector
variable id
Section titled “variable id”uint64_t id;64-bit canonical hash identifier for the type
Derived from boost::type_index::hash_code() and normalized to uint64_t for cross-ABI stability within a build.
Updated on 2026-01-26 at 17:14:35 -0500