From f138311d2d2e0cc9ba0496d523bb46f2c1c9fb73 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Wed, 20 Sep 2023 23:58:58 -0700 Subject: Copy from the PlasticSCM repo, replace vendored glm wtih conan --- source/20-codegen-runtime/MetadataBase.hpp | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 source/20-codegen-runtime/MetadataBase.hpp (limited to 'source/20-codegen-runtime/MetadataBase.hpp') diff --git a/source/20-codegen-runtime/MetadataBase.hpp b/source/20-codegen-runtime/MetadataBase.hpp new file mode 100644 index 0000000..f84a152 --- /dev/null +++ b/source/20-codegen-runtime/MetadataBase.hpp @@ -0,0 +1,53 @@ +#pragma once + +#include +#include +#include +#include + +namespace Metadata { + +struct TypeId { + size_t id; +}; + +struct TypeInfo; + +struct TypePropertyInfo { + std::string_view name; + const TypeInfo* type; + std::string_view getterName; + std::string_view setterName; + + bool IsDirectAccess() const; +}; + +struct TypeMethodInfo { + std::string_view name; + // TODO +}; + +struct TypeInfo { + TypeId typeId; + std::string_view name; + std::span parents; + std::span properties; + std::span methods; + + /// Whether this object is registered at runtime or statically compiled + bool dynamic = false; +}; + +// NOTE: implemented by generating specializations; not-generated ones should generated an error in the linking phase +template +const TypeInfo* GetTypeInfo(); + +// NOTE: implemented by generating specializations +template +std::string_view EnumToString(TEnum value) = delete; + +// NOTE: implemented by generating specializations +template +std::optional EnumFromString(std::string_view str) = delete; + +} // namespace Metadata -- cgit v1.2.3-70-g09d2