diff options
author | rtk0c <[email protected]> | 2023-10-19 22:50:07 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2025-08-16 11:31:16 -0700 |
commit | 297232d21594b138bb368a42b5b0d085ff9ed6aa (patch) | |
tree | 075d5407e1e12a9d35cbee6e4c20ad34e0765c42 /src/brussel.codegen.rt/MetadataBase.hpp | |
parent | d5cd34ff69f7fd134d5450696f298af1a864afbc (diff) |
The great renaming: switch to "module style"
Diffstat (limited to 'src/brussel.codegen.rt/MetadataBase.hpp')
-rw-r--r-- | src/brussel.codegen.rt/MetadataBase.hpp | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/brussel.codegen.rt/MetadataBase.hpp b/src/brussel.codegen.rt/MetadataBase.hpp new file mode 100644 index 0000000..f84a152 --- /dev/null +++ b/src/brussel.codegen.rt/MetadataBase.hpp @@ -0,0 +1,53 @@ +#pragma once + +#include <cstddef> +#include <optional> +#include <span> +#include <string_view> + +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<const TypeInfo* const> parents; + std::span<const TypePropertyInfo> properties; + std::span<const TypeMethodInfo> 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 <typename T> +const TypeInfo* GetTypeInfo(); + +// NOTE: implemented by generating specializations +template <typename TEnum> +std::string_view EnumToString(TEnum value) = delete; + +// NOTE: implemented by generating specializations +template <typename TEnum> +std::optional<TEnum> EnumFromString(std::string_view str) = delete; + +} // namespace Metadata |