28 lines
818 B
C++
28 lines
818 B
C++
#include "MetaCoreFoundation/MetaCoreReflection.h"
|
|
|
|
#include "MetaCoreFoundation/MetaCoreHash.h"
|
|
|
|
namespace MetaCore {
|
|
|
|
const MetaCoreStructDescriptor* MetaCoreTypeRegistry::FindStructByName(std::string_view name) const {
|
|
const auto nameIterator = StructNames_.find(std::string(name));
|
|
if (nameIterator == StructNames_.end()) {
|
|
return nullptr;
|
|
}
|
|
|
|
const auto descriptorIterator = StructsByRuntimeType_.find(nameIterator->second);
|
|
return descriptorIterator == StructsByRuntimeType_.end() ? nullptr : &descriptorIterator->second;
|
|
}
|
|
|
|
void MetaCoreTypeRegistry::Clear() {
|
|
StructsByRuntimeType_.clear();
|
|
StructNames_.clear();
|
|
EnumsByRuntimeType_.clear();
|
|
}
|
|
|
|
MetaCoreTypeId MetaCoreMakeTypeId(std::string_view value) {
|
|
return MetaCoreHashString(value);
|
|
}
|
|
|
|
} // namespace MetaCore
|