Skip to content

Engine → Core

type_id.h

Type identifiers.

Structs

File Description
reflect::type_id Identity of a reflected type: the FNV-1a 64 hash of its registered name. The null id (0) means "no type".
std::formatter<conjure::core::reflect::type_id>
std::hash<conjure::core::reflect::type_id>

Concepts

reflect::has_kind_override

template <typename T> concept has_kind_override = requires { { reflect_kind_override<std::remove_cvref_t<T>>::NAME } -> std::convertible_to<std::string_view>; };

True when reflect_kind_override is specialised for T with a NAME.

reflect::has_reflect_name

template <typename T> concept has_reflect_name = requires { { reflect_traits<std::remove_cvref_t<T>>::NAME } -> std::convertible_to<std::string_view>; };

True when reflect_traits is specialised for T with a NAME.

reflect::reflect_named

template <typename T> concept reflect_named = has_reflect_name<T> || has_kind_override<T>;

True when a registered name is known for T through either customisation point.

Forward Declarations

reflect::reflect_kind_override

template <typename T> struct reflect_kind_override;

Customisation point for handle types owned by other modules: specialise it with static constexpr field_kind KIND (ENTITY or ASSET_REF) and static constexpr std::string_view NAME and the type becomes a reflectable field of that kind without core knowing the type.

reflect::reflect_traits

template <typename T> struct reflect_traits;

Compile-time description of a reflected type. Specialisations provide at least static constexpr std::string_view NAME and static constexpr field_kind KIND; structs and enums described with the reflect.h macros also provide describe().

Functions

Public

reflect::reflect_name_of

template <reflect_named T> [[nodiscard]] constexpr std::string_view reflect_name_of() noexcept;

The registered name of T. The kind override wins so a module may rename a type it reflects.

reflect::type_id_of

template <reflect_named T> [[nodiscard]] constexpr type_id type_id_of() noexcept;

The type_id of T, computed at compile time from its registered name.