66 lines
3.2 KiB
Plaintext
66 lines
3.2 KiB
Plaintext
{{ Indent }}template<> struct _Static<{{FullName}},{{MetaName}}> {
|
|
{{ Indent }} using T = {{FullName}};
|
|
{{ Indent }} consteval static auto __MakeStaticFields() {
|
|
{{ Indent }} return std::array{
|
|
{{ Indent }} {%- for field in FieldList %}
|
|
{{ Indent }} {%- if field.Type == 1 %}
|
|
{{ Indent }} refl::StaticMemberField(&T::{{field.Name}}, FName("{{field.Name}}"), {{field.Meta}}),
|
|
{{ Indent }} {%- elsif field.Type == 2 %}
|
|
{{ Indent }} refl::StaticCtorField((T::{{field.Ref}})nullptr,{{field.Meta}}),
|
|
{{ Indent }} {%- elsif field.Type == 3 %}
|
|
{{ Indent }} refl::StaticMethodField(&T::{{field.Name}}, FName("{{field.Name}}"), {{field.Meta}}),
|
|
{{ Indent }} {%- else %}
|
|
{{ Indent }} refl::StaticMethodField((T::{{field.Ref}})&T::{{field.Name}}, FName("{{field.Name}}"), {{field.Meta}}),
|
|
{{ Indent }} {%- endif %}
|
|
{{ Indent }} {%- endfor %}
|
|
{{ Indent }} };
|
|
{{ Indent }} };
|
|
{{ Indent }}
|
|
{{ Indent }} consteval static int Size() {
|
|
{{ Indent }} return refl::fetch_meta_size<_Static<T,{{MetaName}}>>();
|
|
{{ Indent }} };
|
|
{{ Indent }} consteval static int MemberCount() {
|
|
{{ Indent }} return {{MemberCount}};
|
|
{{ Indent }} };
|
|
{{ Indent }} consteval static int CtorCount() {
|
|
{{ Indent }} return {{CtorCount}};
|
|
{{ Indent }} };
|
|
{{ Indent }}};
|
|
{{ Indent }}
|
|
{{ Indent }}template<> struct _Meta<{{FullName}},{{MetaName}}> : public refl::MetaHelp {
|
|
{{ Indent }} using T = {{FullName}};
|
|
{{ Indent }} using MyParent = {{ ParentName }};
|
|
{{ Indent }} using MyStatic = _Static<T,{{MetaName}}>;
|
|
{{ Indent }}{%-if IsMultyMeta %}
|
|
{{ Indent }} using MyMetas = class _Multy<T>;
|
|
{{ Indent }}{%- endif %}
|
|
{{ Indent }} inline static char s_data[MyStatic::Size()]{};
|
|
{{ Indent }} static auto __MakeFields() {
|
|
{{ Indent }} char* memory = &s_data[0];
|
|
{{ Indent }} return std::array{
|
|
{{ Indent }} {%- for field in FieldList %}
|
|
{{ Indent }} {%- if field.Type == 1 %}
|
|
{{ Indent }} MemberField(&T::{{field.Name}}, FName("{{field.Name}}"), memory, {{field.Meta}}),
|
|
{{ Indent }} {%- elsif field.Type == 2 %}
|
|
{{ Indent }} CtorField((T::{{field.Ref}})nullptr, memory, {{field.Meta}}),
|
|
{{ Indent }} {%- elsif field.Type == 3 %}
|
|
{{ Indent }} MethodField(&T::{{field.Name}}, FName("{{field.Name}}"), memory, {{field.Meta}}),
|
|
{{ Indent }} {%- else %}
|
|
{{ Indent }} MethodField((T::{{field.Ref}})&T::{{field.Name}}, FName("{{field.Name}}"), memory, {{field.Meta}}),
|
|
{{ Indent }} {%- endif %}
|
|
{{ Indent }} {%- endfor %}
|
|
{{ Indent }} };
|
|
{{ Indent }} };
|
|
{{ Indent }}};
|
|
{{ Indent }}{%- if MetaType == 1 %}
|
|
{{ Indent }}const refl::UClass* _Multy<{{FullName}}>::get_{{ MetaName }}()
|
|
{{ Indent }}{
|
|
{{ Indent }} static const auto s_cls = refl::UClass_Meta<T, _Meta<T,{{ MetaName }}>>();
|
|
{{ Indent }} return &s_cls;
|
|
{{ Indent }}};
|
|
{{ Indent }}{%- elsif MetaType == 2 %}
|
|
{{ Indent }}inline const refl::UClass* _Multy<{{FullName}}>::get_{{ MetaName }}()
|
|
{{ Indent }}{
|
|
{{ Indent }} return &refl::TypeInfo<T>::StaticClass;
|
|
{{ Indent }}};
|
|
{{ Indent }}{%- endif %} |