diff --git a/src/entt/meta/factory.hpp b/src/entt/meta/factory.hpp index e34675696..d6b0e02b8 100644 --- a/src/entt/meta/factory.hpp +++ b/src/entt/meta/factory.hpp @@ -216,7 +216,6 @@ struct meta_factory { auto * const type = internal::meta_info::resolve(); static internal::meta_base_node node{ - type, nullptr, internal::meta_info::resolve(), [](const void *instance) ENTT_NOEXCEPT -> const void * { @@ -250,7 +249,6 @@ struct meta_factory { auto * const type = internal::meta_info::resolve(); static internal::meta_conv_node node{ - type, nullptr, internal::meta_info::resolve(), [](const void *instance) -> meta_any { @@ -273,7 +271,6 @@ struct meta_factory { auto * const type = internal::meta_info::resolve(); static internal::meta_conv_node node{ - type, nullptr, internal::meta_info::resolve(), [](const void *instance) -> meta_any { @@ -304,7 +301,6 @@ struct meta_factory { auto * const type = internal::meta_info::resolve(); static internal::meta_conv_node node{ - type, nullptr, internal::meta_info::resolve(), [](const void *instance) -> meta_any { @@ -340,7 +336,6 @@ struct meta_factory { auto * const type = internal::meta_info::resolve(); static internal::meta_ctor_node node{ - type, nullptr, nullptr, descriptor::args_type::size, @@ -372,7 +367,6 @@ struct meta_factory { auto * const type = internal::meta_info::resolve(); static internal::meta_ctor_node node{ - type, nullptr, nullptr, descriptor::args_type::size, @@ -439,7 +433,6 @@ struct meta_factory { static internal::meta_data_node node{ {}, - type, nullptr, nullptr, std::is_same_v || std::is_const_v, @@ -488,7 +481,6 @@ struct meta_factory { static internal::meta_data_node node{ {}, - type, nullptr, nullptr, std::is_same_v || (std::is_member_object_pointer_v && std::is_const_v), @@ -529,7 +521,6 @@ struct meta_factory { static internal::meta_func_node node{ {}, - type, nullptr, nullptr, descriptor::args_type::size, diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index aa609a5fa..9d425df87 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -730,12 +730,6 @@ struct meta_ctor { : node{curr} {} - /** - * @brief Returns the type to which an object belongs. - * @return The type to which the object belongs. - */ - [[nodiscard]] inline meta_type parent() const ENTT_NOEXCEPT; - /** * @brief Returns the number of arguments accepted by a constructor. * @return The number of arguments accepted by the constructor. @@ -831,9 +825,6 @@ struct meta_data { return node->id; } - /*! @copydoc meta_ctor::parent */ - [[nodiscard]] inline meta_type parent() const ENTT_NOEXCEPT; - /** * @brief Indicates whether a data member is constant or not. * @return True if the data member is constant, false otherwise. @@ -935,9 +926,6 @@ struct meta_func { return node->id; } - /*! @copydoc meta_ctor::parent */ - [[nodiscard]] inline meta_type parent() const ENTT_NOEXCEPT; - /** * @brief Returns the number of arguments accepted by a member function. * @return The number of arguments accepted by the member function. @@ -1682,31 +1670,16 @@ inline bool meta_any::allow_cast(const meta_type &type) { } -[[nodiscard]] inline meta_type meta_ctor::parent() const ENTT_NOEXCEPT { - return node->parent; -} - - [[nodiscard]] inline meta_type meta_ctor::arg(const size_type index) const ENTT_NOEXCEPT { return index < arity() ? node->arg(index) : meta_type{}; } -[[nodiscard]] inline meta_type meta_data::parent() const ENTT_NOEXCEPT { - return node->parent; -} - - [[nodiscard]] inline meta_type meta_data::type() const ENTT_NOEXCEPT { return node->type; } -[[nodiscard]] inline meta_type meta_func::parent() const ENTT_NOEXCEPT { - return node->parent; -} - - [[nodiscard]] inline meta_type meta_func::ret() const ENTT_NOEXCEPT { return node->ret; } diff --git a/src/entt/meta/node.hpp b/src/entt/meta/node.hpp index 1c18f39d1..a581950eb 100644 --- a/src/entt/meta/node.hpp +++ b/src/entt/meta/node.hpp @@ -41,7 +41,6 @@ struct meta_prop_node { struct meta_base_node { - meta_type_node * const parent; meta_base_node * next; meta_type_node * const type; const void *(* const cast)(const void *) ENTT_NOEXCEPT; @@ -49,7 +48,6 @@ struct meta_base_node { struct meta_conv_node { - meta_type_node * const parent; meta_conv_node * next; meta_type_node * const type; meta_any(* const conv)(const void *); @@ -58,7 +56,6 @@ struct meta_conv_node { struct meta_ctor_node { using size_type = std::size_t; - meta_type_node * const parent; meta_ctor_node * next; meta_prop_node * prop; const size_type arity; @@ -69,7 +66,6 @@ struct meta_ctor_node { struct meta_data_node { id_type id; - meta_type_node * const parent; meta_data_node * next; meta_prop_node * prop; const bool is_const; @@ -83,7 +79,6 @@ struct meta_data_node { struct meta_func_node { using size_type = std::size_t; id_type id; - meta_type_node * const parent; meta_func_node * next; meta_prop_node * prop; const size_type arity; @@ -156,7 +151,6 @@ class ENTT_API meta_node { [[nodiscard]] static meta_ctor_node * meta_default_constructor([[maybe_unused]] meta_type_node *type) ENTT_NOEXCEPT { if constexpr(std::is_default_constructible_v) { static meta_ctor_node node{ - type, nullptr, nullptr, 0u, diff --git a/test/entt/meta/meta_ctor.cpp b/test/entt/meta/meta_ctor.cpp index 639134279..b3b4f22df 100644 --- a/test/entt/meta/meta_ctor.cpp +++ b/test/entt/meta/meta_ctor.cpp @@ -67,7 +67,6 @@ TEST_F(MetaCtor, Functionalities) { auto ctor = entt::resolve().ctor(); ASSERT_TRUE(ctor); - ASSERT_EQ(ctor.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(ctor.arity(), 2u); ASSERT_EQ(ctor.arg(0u), entt::resolve()); ASSERT_EQ(ctor.arg(1u), entt::resolve()); @@ -102,7 +101,6 @@ TEST_F(MetaCtor, Func) { auto ctor = entt::resolve().ctor(); ASSERT_TRUE(ctor); - ASSERT_EQ(ctor.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(ctor.arity(), 1u); ASSERT_EQ(ctor.arg(0u), entt::resolve()); ASSERT_FALSE(ctor.arg(1u)); @@ -202,7 +200,6 @@ TEST_F(MetaCtor, ExternalMemberFunction) { auto ctor = entt::resolve().ctor(); ASSERT_TRUE(ctor); - ASSERT_EQ(ctor.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(ctor.arity(), 4u); ASSERT_EQ(ctor.arg(0u), entt::resolve()); ASSERT_EQ(ctor.arg(1u), entt::resolve()); diff --git a/test/entt/meta/meta_data.cpp b/test/entt/meta/meta_data.cpp index 4e94dc8dc..e577c6719 100644 --- a/test/entt/meta/meta_data.cpp +++ b/test/entt/meta/meta_data.cpp @@ -131,7 +131,6 @@ TEST_F(MetaData, Functionalities) { clazz_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "i"_hs); ASSERT_FALSE(data.is_const()); @@ -162,7 +161,6 @@ TEST_F(MetaData, Const) { clazz_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "j"_hs); ASSERT_TRUE(data.is_const()); @@ -192,7 +190,6 @@ TEST_F(MetaData, Static) { auto data = entt::resolve().data("h"_hs); ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "h"_hs); ASSERT_FALSE(data.is_const()); @@ -222,7 +219,6 @@ TEST_F(MetaData, ConstStatic) { auto data = entt::resolve().data("k"_hs); ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("clazz"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "k"_hs); ASSERT_TRUE(data.is_const()); @@ -343,7 +339,6 @@ TEST_F(MetaData, SetterGetterAsFreeFunctions) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "x"_hs); ASSERT_FALSE(data.is_const()); @@ -360,7 +355,6 @@ TEST_F(MetaData, SetterGetterAsMemberFunctions) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "y"_hs); ASSERT_FALSE(data.is_const()); @@ -377,7 +371,6 @@ TEST_F(MetaData, SetterGetterWithRefAsMemberFunctions) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "w"_hs); ASSERT_FALSE(data.is_const()); @@ -394,7 +387,6 @@ TEST_F(MetaData, SetterGetterMixed) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "z"_hs); ASSERT_FALSE(data.is_const()); @@ -411,7 +403,6 @@ TEST_F(MetaData, SetterGetterReadOnly) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "z_ro"_hs); ASSERT_TRUE(data.is_const()); @@ -428,7 +419,6 @@ TEST_F(MetaData, SetterGetterReadOnlyDataMember) { setter_getter_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("setter_getter"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "value"_hs); ASSERT_TRUE(data.is_const()); @@ -471,7 +461,6 @@ TEST_F(MetaData, ArrayStatic) { auto data = entt::resolve().data("global"_hs); ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("array"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "global"_hs); ASSERT_FALSE(data.is_const()); @@ -488,7 +477,6 @@ TEST_F(MetaData, Array) { array_t instance{}; ASSERT_TRUE(data); - ASSERT_EQ(data.parent(), entt::resolve("array"_hs)); ASSERT_EQ(data.type(), entt::resolve()); ASSERT_EQ(data.id(), "local"_hs); ASSERT_FALSE(data.is_const()); diff --git a/test/entt/meta/meta_func.cpp b/test/entt/meta/meta_func.cpp index 3b5be1588..01c72c49d 100644 --- a/test/entt/meta/meta_func.cpp +++ b/test/entt/meta/meta_func.cpp @@ -109,7 +109,6 @@ TEST_F(MetaFunc, Functionalities) { func_t instance{}; ASSERT_TRUE(func); - ASSERT_EQ(func.parent(), entt::resolve("func"_hs)); ASSERT_EQ(func.id(), "f2"_hs); ASSERT_EQ(func.arity(), 2u); ASSERT_FALSE(func.is_const()); @@ -150,7 +149,6 @@ TEST_F(MetaFunc, Const) { func_t instance{}; ASSERT_TRUE(func); - ASSERT_EQ(func.parent(), entt::resolve("func"_hs)); ASSERT_EQ(func.id(), "f1"_hs); ASSERT_EQ(func.arity(), 1u); ASSERT_TRUE(func.is_const()); @@ -189,7 +187,6 @@ TEST_F(MetaFunc, RetVoid) { func_t instance{}; ASSERT_TRUE(func); - ASSERT_EQ(func.parent(), entt::resolve("func"_hs)); ASSERT_EQ(func.id(), "g"_hs); ASSERT_EQ(func.arity(), 1u); ASSERT_FALSE(func.is_const()); @@ -226,7 +223,6 @@ TEST_F(MetaFunc, Static) { func_t::value = 2; ASSERT_TRUE(func); - ASSERT_EQ(func.parent(), entt::resolve("func"_hs)); ASSERT_EQ(func.id(), "h"_hs); ASSERT_EQ(func.arity(), 1u); ASSERT_FALSE(func.is_const()); @@ -264,7 +260,6 @@ TEST_F(MetaFunc, StaticRetVoid) { auto func = entt::resolve().func("k"_hs); ASSERT_TRUE(func); - ASSERT_EQ(func.parent(), entt::resolve("func"_hs)); ASSERT_EQ(func.id(), "k"_hs); ASSERT_EQ(func.arity(), 1u); ASSERT_FALSE(func.is_const()); @@ -405,7 +400,6 @@ TEST_F(MetaFunc, FromBase) { derived_t instance{}; ASSERT_TRUE(type.func("func"_hs)); - ASSERT_EQ(type.func("func"_hs).parent(), entt::resolve()); ASSERT_EQ(instance.value, 3); type.func("func"_hs).invoke(instance, 42); @@ -419,7 +413,6 @@ TEST_F(MetaFunc, ExternalMemberFunction) { auto func = entt::resolve().func("emplace"_hs); ASSERT_TRUE(func); - ASSERT_EQ(func.parent(), entt::resolve("func"_hs)); ASSERT_EQ(func.id(), "emplace"_hs); ASSERT_EQ(func.arity(), 2u); ASSERT_FALSE(func.is_const());