#pragma once #include #include class BaseObjectType { public: explicit BaseObjectType(const std::type_info &type_info) noexcept; bool operator==(const BaseObjectType &object_type) const noexcept; [[nodiscard]] std::size_t hash() const noexcept; [[nodiscard]] std::string_view name() const noexcept; private: const std::type_info &_type_info; }; template class ObjectType : public BaseObjectType { public: ObjectType() : BaseObjectType(typeid(Object)) {} }; class IObjectTypeHasher { public: virtual std::size_t operator()(const BaseObjectType &object_type) const = 0; }; class ObjectTypeHasher : public IObjectTypeHasher { public: std::size_t operator()(const BaseObjectType &object_type) const override; };