This commit is contained in:
ouczbs 2024-10-30 15:14:40 +08:00
parent 9b22a5980a
commit efb590c2cd
2 changed files with 3 additions and 27 deletions

View File

@ -8,16 +8,8 @@ namespace refl{
using Impl = gen::MetaImpl<T, string_hash("Meta")>;
{%- endif %}
{%- if IsMultyMeta %}
{%- for Meta in MetaList %}
static const UClass* get_{{Meta}}();
{%- endfor %}
static const UClass* GetMeta(Name name) {
{%- for Meta in MetaList %}
if (name == string_hash("{{Meta}}")) {
return get_{{Meta}}();
}
{%- endfor %}
return nullptr;
consteval static auto MetaList() {
return std::array{ {% for Meta in MetaList %}string_hash("{{Meta}}"){% unless forloop.last %}, {% endunless %}{% endfor %} };
}
{%- endif %}
};

View File

@ -23,19 +23,3 @@ namespace gen{
};
};
}
{%- if MetaType == 1 %}
namespace refl{
const UClass* Meta<{{FullName}}>::get_{{ MetaName }}()
{
static const UClass_Meta<T, gen::MetaImpl<T, string_hash("{{ MetaName }}")>> s_cls{};
return &s_cls;
};
}
{%- elsif MetaType == 2 %}
namespace refl{
inline const UClass* Meta<{{FullName}}>::get_{{ MetaName }}()
{
return &TypeInfo<T>::StaticClass;
};
}
{%- endif %}