17#ifndef _FGE_REG_MANAGER_HPP_INCLUDED
18#define _FGE_REG_MANAGER_HPP_INCLUDED
20#include "FastEngine/fge_extern.hpp"
22#include "FastEngine/object/C_object.hpp"
26#define FGE_REG_BADCLASSID std::numeric_limits<fge::reg::ClassId>::max()
31using ClassId = uint16_t;
39 [[nodiscard]]
virtual fge::Object* createNew()
const = 0;
42 [[nodiscard]] std::string
const& getClassName()
const {
return this->g_className; }
45 std::string g_className;
54 this->g_className = obj.getClassName();
57 [[nodiscard]]
fge::Object* createNew()
const final {
return new T(); }
60 return new T(*
reinterpret_cast<T const*
>(obj));
64FGE_API
void ClearAll();
66FGE_API
bool RegisterNewClass(std::unique_ptr<fge::reg::BaseStamp>&& newStamp);
68inline bool RegisterNewClass()
73FGE_API
bool Check(std::string_view className);
74FGE_API
bool Check(fge::reg::ClassId classId);
78FGE_API
bool Replace(std::string_view className, std::unique_ptr<fge::reg::BaseStamp>&& newStamp);
79FGE_API
bool Replace(fge::reg::ClassId classId, std::unique_ptr<fge::reg::BaseStamp>&& newStamp);
81FGE_API std::size_t GetRegisterSize();
83FGE_API
fge::Object* GetNewClassOf(std::string_view className);
84FGE_API
fge::Object* GetNewClassOf(fge::reg::ClassId classId);
86FGE_API fge::reg::ClassId GetClassId(std::string_view className);
87FGE_API std::string GetClassName(fge::reg::ClassId classId);
The Object class is the base class for all objects in the engine.
Definition C_object.hpp:102
Definition reg_manager.hpp:34
Definition reg_manager.hpp:49