Skip to content

EntropyCanvas::Schema::TypeID

A cross-platform type identifier with stable hashing and comparison. More…

#include <TypeID.h>

Name
std::stringprettyName() const
Get the human-readable type name.
booloperator==(const TypeID & other) const
Equality comparison operator.
autooperator<=>(const TypeID & other) const
Three-way comparison operator for ordering TypeIDs.
Name
std::stringname
Human-readable name of the type.
uint64_tid
64-bit canonical hash identifier for the type
struct EntropyCanvas::Schema::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
}
inline std::string prettyName() const

Get 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.

inline bool operator==(
const TypeID & other
) const

Equality comparison operator.

Parameters:

  • other The TypeID to compare against

Return: true if both TypeIDs represent the same type

inline auto operator<=>(
const TypeID & other
) const

Three-way comparison operator for ordering TypeIDs.

Parameters:

  • other The TypeID to compare against

Return: std::strong_ordering result based on hash comparison

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”.

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