Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
TypeRegistry.hpp
1#pragma once
2
3#include <Infinity/api.h>
4#include <Infinity/Types/Core/Base.hpp>
5
6namespace Infinity::Types
7{
51 class INFINITY_API_PUBLIC TypeRegistry
52 {
53 public:
78 static Core::Base* create(const TypeID& type);
79
101 static const TypeID& findID(TypeHash hash);
102
123 static const TypeID& findID(std::string_view name);
124
147 static const TypeID& emptyID();
148
149 private:
156 TypeRegistry();
157
164 ~TypeRegistry() = delete;
165 };
166
167}
Abstract base class for all Infinity Engine data types.
Definition Base.hpp:43
Global registry for runtime type information and factory functions.
Definition TypeRegistry.hpp:52
static const TypeID & findID(TypeHash hash)
Finds a TypeID by its hash value.
static const TypeID & emptyID()
Gets the sentinel TypeID representing an empty/invalid type.
static const TypeID & findID(std::string_view name)
Finds a TypeID by its string name.
static Core::Base * create(const TypeID &type)
Creates a default-constructed instance of the specified type.
Definition Array.hpp:25
uint64_t TypeHash
64-bit hash value computed from a type's name.
Definition TypeID.hpp:30
Runtime type identifier for the Infinity type system.
Definition TypeID.hpp:71