Skip to content

Engine → Core

reflect.h

Umbrella header of the reflect area plus the description macros.

Functions

Public

reflect::detail::build_enum_description

template <typename EnumType> [[nodiscard]] enum_info build_enum_description( std::string_view name, bool isFlags, std::initializer_list<std::pair<std::string, i64>> values );

Assembles the enum_info of a macro-described enumeration.

reflect::detail::build_struct_description

template <typename StructType> [[nodiscard]] type_info build_struct_description(std::string_view name, std::initializer_list<field_info> fields);

Assembles the type_info of a macro-described struct.

reflect::detail::describe_value_type

template <typename ValueType> void describe_value_type(field_info &field, bool asElement);

Fills kind, type and the struct/enum description pointer for one value type. asElement targets elementKind instead of kind (array elements).

reflect::detail::fill_default_values

CONJURE_API void fill_default_values(type_info &info, const void *defaults);

Serialises every field of defaults (an instance of the described type) into field_info::defaultValueJson.

reflect::detail::finish_struct_description

CONJURE_API void finish_struct_description(type_info &info);

Validates a macro-built description; an inconsistent layout is a programming error and asserts.

reflect::detail::make_field

template <typename MemberType> [[nodiscard]] field_info make_field(std::string_view name, usize offset, field_attributes attributes);

Builds the description of one member from its declared type, name and offset.