From eea1e7b1f8055b6461a3f62bf51de16bb01a6cc0 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Thu, 15 Sep 2022 14:09:44 +0200 Subject: [PATCH] meta: further reduce the number of instantiations and allocations --- src/entt/meta/factory.hpp | 222 +++++++++++++++++++------------------- src/entt/meta/meta.hpp | 161 ++++++++++++++------------- src/entt/meta/node.hpp | 11 +- 3 files changed, 192 insertions(+), 202 deletions(-) diff --git a/src/entt/meta/factory.hpp b/src/entt/meta/factory.hpp index f29941940..7d47eb9b0 100644 --- a/src/entt/meta/factory.hpp +++ b/src/entt/meta/factory.hpp @@ -28,28 +28,36 @@ namespace entt { namespace internal { -inline internal::meta_base_node &meta_extend(internal::meta_type_node &owner, const id_type id, internal::meta_base_node node) { - return owner.details->base.insert_or_assign(id, std::move(node)).first->second; +inline decltype(auto) owner(const type_info &info) { + auto &&context = meta_context::from(locator::value_or()).value; + ENTT_ASSERT(context.contains(info.hash()), "Type not available"); + return context[info.hash()]; } -inline internal::meta_conv_node &meta_extend(internal::meta_type_node &owner, const id_type id, internal::meta_conv_node node) { - return owner.details->conv.insert_or_assign(id, std::move(node)).first->second; +inline meta_base_node &meta_extend(const type_info &info, const id_type id, meta_base_node node) { + return owner(info).details->base.insert_or_assign(id, std::move(node)).first->second; } -inline internal::meta_ctor_node &meta_extend(internal::meta_type_node &owner, const id_type id, internal::meta_ctor_node node) { - return owner.details->ctor.insert_or_assign(id, std::move(node)).first->second; +inline meta_conv_node &meta_extend(const type_info &info, const id_type id, meta_conv_node node) { + return owner(info).details->conv.insert_or_assign(id, std::move(node)).first->second; } -inline internal::meta_dtor_node &meta_extend(internal::meta_type_node &owner, internal::meta_dtor_node node) { - return (owner.dtor = std::move(node)); +inline meta_ctor_node &meta_extend(const type_info &info, const id_type id, meta_ctor_node node) { + return owner(info).details->ctor.insert_or_assign(id, std::move(node)).first->second; } -inline internal::meta_data_node &meta_extend(internal::meta_type_node &owner, const id_type id, internal::meta_data_node node) { - return owner.details->data.insert_or_assign(id, std::move(node)).first->second; +inline meta_dtor_node &meta_extend(const type_info &info, meta_dtor_node node) { + return (owner(info).dtor = std::move(node)); } -inline internal::meta_func_node &meta_extend(internal::meta_type_node &owner, const id_type id, internal::meta_func_node node) { - if(auto it = owner.details->func.find(id); it != owner.details->func.end()) { +inline meta_data_node &meta_extend(const type_info &info, const id_type id, meta_data_node node) { + return owner(info).details->data.insert_or_assign(id, std::move(node)).first->second; +} + +inline meta_func_node &meta_extend(const type_info &info, const id_type id, meta_func_node node) { + auto &&elem = owner(info); + + if(auto it = elem.details->func.find(id); it != elem.details->func.end()) { for(auto *curr = &it->second; curr; curr = curr->next.get()) { if(curr->invoke == node.invoke) { node.next = std::move(curr->next); @@ -59,19 +67,14 @@ inline internal::meta_func_node &meta_extend(internal::meta_type_node &owner, co } // locally overloaded function - node.next = std::make_shared(std::move(owner.details->func[id])); + node.next = std::make_shared(std::move(elem.details->func[id])); } - return owner.details->func.insert_or_assign(id, std::move(node)).first->second; + return elem.details->func.insert_or_assign(id, std::move(node)).first->second; } -template -inline internal::meta_prop_node &meta_extend(Owner &owner, const id_type id, internal::meta_prop_node node) { - if(!owner.details) { - owner.details = std::make_shared(); - } - - return (owner.details->prop[id] = std::move(node)); +inline meta_prop_node &meta_extend(dense_map &prop, const id_type id, meta_prop_node node) { + return (prop[id] = std::move(node)); } } // namespace internal @@ -81,84 +84,20 @@ inline internal::meta_prop_node &meta_extend(Owner &owner, const id_type id, int * @endcond */ -/** - * @brief Meta factory to be used for reflection purposes. - * - * The meta factory is an utility class used to reflect types, data members and - * functions of all sorts. This class ensures that the underlying web of types - * is built correctly and performs some checks in debug mode to ensure that - * there are no subtle errors at runtime. - */ -template -class meta_factory; - -/** - * @brief Extended meta factory to be used for reflection purposes. - * @tparam Type Reflected type for which the factory was created. - * @tparam Node Node for which to create properties, if any. - */ -template -class meta_factory: public meta_factory { -public: - /** - * @brief Constructs an extended factory from a given node. - * @param target The node for which to store properties, if any. - */ - meta_factory(Node &target) noexcept - : parent{&target} {} - - /** - * @brief Assigns a property to the last meta object created. - * - * Both the key and the value (if any) must be at least copy constructible. - * - * @tparam Value Optional type of the property value. - * @param id Property key. - * @param value Optional property value. - * @return An extended meta factory for the given type. - */ - template - meta_factory prop(id_type id, [[maybe_unused]] Value &&...value) { - if constexpr(sizeof...(Value) == 0u) { - internal::meta_extend( - *parent, - id, - internal::meta_prop_node{ - &internal::resolve}); - } else { - internal::meta_extend( - *parent, - id, - internal::meta_prop_node{ - &internal::resolve>..., - std::make_shared>(std::forward(value))...}); - } - - return *this; - } - -private: - Node *parent; -}; - /** * @brief Basic meta factory to be used for reflection purposes. * @tparam Type Reflected type for which the factory was created. */ template -class meta_factory { - decltype(auto) owner() { - return internal::meta_context::from(locator::value_or()).value[type_id().hash()]; - } - +class meta_factory { template - auto data(const id_type id, std::index_sequence) noexcept { + void data(const id_type id, std::index_sequence) noexcept { using data_type = std::invoke_result_t; using args_type = type_list)>::args_type...>; static_assert(Policy::template value, "Invalid return type for the given policy"); auto &&elem = internal::meta_extend( - owner(), + *info, id, internal::meta_data_node{ /* this is never static */ @@ -169,15 +108,21 @@ class meta_factory { +[](meta_handle instance, meta_any value) { return (meta_setter>(*instance.operator->(), value.as_ref()) || ...); }, &meta_getter}); - return meta_factory{elem}; + bucket = &elem.prop; } public: /*! @brief Default constructor. */ - meta_factory() noexcept { - if(const auto it = internal::meta_context::from(locator::value_or()).value.try_emplace(type_id().hash(), internal::resolve()).first; !it->second.details) { - it->second.details = std::make_shared(); + meta_factory() noexcept + : bucket{}, + info{&type_id()} { + auto &&elem = internal::owner(*info); + + if(!elem.details) { + elem.details = std::make_shared(); } + + bucket = &elem.details->prop; } /** @@ -186,10 +131,11 @@ public: * @return An extended meta factory for the given type. */ auto type(const id_type id) noexcept { - auto &&elem = owner(); + auto &&elem = internal::owner(*info); ENTT_ASSERT(elem.id == id || !resolve(id), "Duplicate identifier"); + bucket = &elem.details->prop; elem.id = id; - return meta_factory{elem}; + return *this; } /** @@ -205,7 +151,7 @@ public: static_assert(!std::is_same_v && std::is_base_of_v, "Invalid base type"); internal::meta_extend( - owner(), + *info, type_id().hash(), internal::meta_base_node{ &internal::resolve, @@ -213,6 +159,7 @@ public: return static_cast(static_cast(static_cast(instance))); }}); + bucket = nullptr; return *this; } @@ -233,13 +180,14 @@ public: using conv_type = std::remove_cv_t>>; internal::meta_extend( - owner(), + *info, type_id().hash(), internal::meta_conv_node{ +[](const void *instance) { return forward_as_meta(std::invoke(Candidate, *static_cast(instance))); }}); + bucket = nullptr; return *this; } @@ -257,13 +205,14 @@ public: using conv_type = std::remove_cv_t>; internal::meta_extend( - owner(), + *info, type_id().hash(), internal::meta_conv_node{ +[](const void *instance) { return forward_as_meta(static_cast(*static_cast(instance))); }}); + bucket = nullptr; return *this; } @@ -287,13 +236,14 @@ public: static_assert(std::is_same_v>, Type>, "The function doesn't return an object of the required type"); internal::meta_extend( - owner(), + *info, type_id().hash(), internal::meta_ctor_node{ descriptor::args_type::size, &meta_arg, &meta_construct}); + bucket = nullptr; return *this; } @@ -312,13 +262,14 @@ public: using descriptor = meta_function_helper_t; internal::meta_extend( - owner(), + *info, type_id().hash(), internal::meta_ctor_node{ descriptor::args_type::size, &meta_arg, &meta_construct}); + bucket = nullptr; return *this; } @@ -345,10 +296,11 @@ public: static_assert(std::is_invocable_v, "The function doesn't accept an object of the type provided"); internal::meta_extend( - owner(), + *info, internal::meta_dtor_node{ +[](void *instance) { std::invoke(Func, *static_cast(instance)); }}); + bucket = nullptr; return *this; } @@ -371,7 +323,7 @@ public: using data_type = std::remove_reference_t>; auto &&elem = internal::meta_extend( - owner(), + *info, id, internal::meta_data_node{ /* this is never static */ @@ -382,12 +334,12 @@ public: &meta_setter, &meta_getter}); - return meta_factory{elem}; + bucket = &elem.prop; } else { using data_type = std::remove_reference_t>; auto &&elem = internal::meta_extend( - owner(), + *info, id, internal::meta_data_node{ ((std::is_same_v> || std::is_const_v) ? internal::meta_traits::is_const : internal::meta_traits::is_none) | internal::meta_traits::is_static, @@ -397,8 +349,10 @@ public: &meta_setter, &meta_getter}); - return meta_factory{elem}; + bucket = &elem.prop; } + + return *this; } /** @@ -428,7 +382,7 @@ public: if constexpr(std::is_same_v) { auto &&elem = internal::meta_extend( - owner(), + *info, id, internal::meta_data_node{ /* this is never static */ @@ -439,12 +393,12 @@ public: &meta_setter, &meta_getter}); - return meta_factory{elem}; + bucket = &elem.prop; } else { using args_type = typename meta_function_helper_t::args_type; auto &&elem = internal::meta_extend( - owner(), + *info, id, internal::meta_data_node{ /* this is never static nor const */ @@ -455,8 +409,10 @@ public: &meta_setter, &meta_getter}); - return meta_factory{elem}; + bucket = &elem.prop; } + + return *this; } /** @@ -478,7 +434,8 @@ public: */ template auto data(const id_type id) noexcept { - return data(id, std::make_index_sequence{}); + data(id, std::make_index_sequence{}); + return *this; } /** @@ -500,7 +457,7 @@ public: static_assert(Policy::template value, "Invalid return type for the given policy"); auto &&elem = internal::meta_extend( - owner(), + *info, id, internal::meta_func_node{ (descriptor::is_const ? internal::meta_traits::is_const : internal::meta_traits::is_none) | (descriptor::is_static ? internal::meta_traits::is_static : internal::meta_traits::is_none), @@ -509,8 +466,45 @@ public: &meta_arg, &meta_invoke}); - return meta_factory{elem}; + bucket = &elem.prop; + return *this; } + + /** + * @brief Assigns a property to the last meta object created. + * + * Both the key and the value (if any) must be at least copy constructible. + * + * @tparam Value Optional type of the property value. + * @param id Property key. + * @param value Optional property value. + * @return An extended meta factory for the given type. + */ + template + meta_factory prop(id_type id, [[maybe_unused]] Value &&...value) { + ENTT_ASSERT(bucket != nullptr, "Meta object does not support properties"); + + if constexpr(sizeof...(Value) == 0u) { + internal::meta_extend( + *bucket, + id, + internal::meta_prop_node{ + &internal::resolve}); + } else { + internal::meta_extend( + *bucket, + id, + internal::meta_prop_node{ + &internal::resolve>..., + std::make_shared>(std::forward(value))...}); + } + + return *this; + } + +private: + dense_map *bucket; + const type_info *info; }; /** @@ -526,9 +520,9 @@ public: */ template [[nodiscard]] auto meta() noexcept { - auto res = internal::meta_context::from(locator::value_or()).value.try_emplace(type_id().hash(), internal::resolve()); - // extended meta factory to allow assigning properties to opaque meta types - return meta_factory{res.first->second}; + // make sure the type exists in the context before returning a factory + internal::meta_context::from(locator::value_or()).value.try_emplace(type_id().hash(), internal::resolve()); + return meta_factory{}; } /** diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index b25f621e8..7619aa432 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -644,19 +644,23 @@ struct meta_prop { /*! @brief Node type. */ using node_type = internal::meta_prop_node; + /*! @brief Default constructor. */ + meta_prop() noexcept + : node{} {} + /** * @brief Constructs an instance from a given node. * @param curr The underlying node with which to construct the instance. */ - meta_prop(const node_type &curr = {}) noexcept - : node{curr} {} + meta_prop(const node_type &curr) noexcept + : node{&curr} {} /** * @brief Returns the stored value by copy. * @return A wrapper containing the value stored with the property. */ [[nodiscard]] meta_any value() const { - return node.value ? node.type().from_void(nullptr, node.value.get()) : meta_any{}; + return node->value ? node->type().from_void(nullptr, node->value.get()) : meta_any{}; } /** @@ -664,63 +668,37 @@ struct meta_prop { * @return True if the object is valid, false otherwise. */ [[nodiscard]] explicit operator bool() const noexcept { - return !(node.type == nullptr); + return (node != nullptr); } private: - node_type node; + const node_type *node; }; -/** - * @cond TURN_OFF_DOXYGEN - * Internal details not to be documented. - */ - -namespace internal { - -struct meta_common { - template - [[nodiscard]] auto range(const std::shared_ptr &node) const noexcept { - using return_type = meta_range::const_iterator>; - return node ? return_type{((*node).*Member).cbegin(), ((*node).*Member).cend()} : return_type{}; - } - - template - [[nodiscard]] auto find(const std::shared_ptr &node, const id_type key) const { - if(node) { - if(const auto it = ((*node).*Member).find(key); it != ((*node).*Member).cend()) { - return Type{it->second}; - } - } - - return Type{}; - } -}; - -} // namespace internal - -/** - * Internal details not to be documented. - * @endcond - */ - /*! @brief Opaque wrapper for data members. */ -struct meta_data: private internal::meta_common { +struct meta_data { /*! @brief Node type. */ using node_type = internal::meta_data_node; /*! @brief Unsigned integer type. */ using size_type = typename node_type::size_type; - /*! @copydoc meta_prop::meta_prop */ - meta_data(const node_type &curr = {}) noexcept - : node{curr} {} + /*! @brief Default constructor. */ + meta_data() noexcept + : node{} {} + + /** + * @brief Constructs an instance from a given node. + * @param curr The underlying node with which to construct the instance. + */ + meta_data(const node_type &curr) noexcept + : node{&curr} {} /** * @brief Returns the number of setters available. * @return The number of setters available. */ [[nodiscard]] size_type arity() const noexcept { - return node.arity; + return node->arity; } /** @@ -728,7 +706,7 @@ struct meta_data: private internal::meta_common { * @return True if the data member is constant, false otherwise. */ [[nodiscard]] bool is_const() const noexcept { - return static_cast(node.traits & internal::meta_traits::is_const); + return static_cast(node->traits & internal::meta_traits::is_const); } /** @@ -736,7 +714,7 @@ struct meta_data: private internal::meta_common { * @return True if the data member is static, false otherwise. */ [[nodiscard]] bool is_static() const noexcept { - return static_cast(node.traits & internal::meta_traits::is_static); + return static_cast(node->traits & internal::meta_traits::is_static); } /*! @copydoc meta_any::type */ @@ -757,7 +735,7 @@ struct meta_data: private internal::meta_common { */ template bool set(meta_handle instance, Type &&value) const { - return node.set && node.set(std::move(instance), std::forward(value)); + return node->set && node->set(std::move(instance), std::forward(value)); } /** @@ -770,7 +748,7 @@ struct meta_data: private internal::meta_common { * @return A wrapper containing the value of the underlying variable. */ [[nodiscard]] meta_any get(meta_handle instance) const { - return node.get(std::move(instance)); + return node->get(std::move(instance)); } /** @@ -784,8 +762,8 @@ struct meta_data: private internal::meta_common { * @brief Returns a range to visit registered meta properties. * @return An iterable range to visit registered meta properties. */ - [[nodiscard]] meta_range prop() const noexcept { - return meta_common::range(node.details); + [[nodiscard]] meta_range prop() const noexcept { + return {node->prop.cbegin(), node->prop.cend()}; } /** @@ -794,7 +772,8 @@ struct meta_data: private internal::meta_common { * @return The registered meta property for the given key, if any. */ [[nodiscard]] meta_prop prop(const id_type key) const { - return meta_common::find(node.details, key); + const auto it = node->prop.find(key); + return it != node->prop.cend() ? meta_prop{it->second} : meta_prop{}; } /** @@ -802,30 +781,37 @@ struct meta_data: private internal::meta_common { * @return True if the object is valid, false otherwise. */ [[nodiscard]] explicit operator bool() const noexcept { - return !(node.type == nullptr); + return (node != nullptr); } private: - node_type node; + const node_type *node; }; /*! @brief Opaque wrapper for member functions. */ -struct meta_func: private internal::meta_common { +struct meta_func { /*! @brief Node type. */ using node_type = internal::meta_func_node; /*! @brief Unsigned integer type. */ using size_type = typename node_type::size_type; - /*! @copydoc meta_prop::meta_prop */ - meta_func(const node_type &curr = {}) noexcept - : node{curr} {} + /*! @brief Default constructor. */ + meta_func() noexcept + : node{} {} + + /** + * @brief Constructs an instance from a given node. + * @param curr The underlying node with which to construct the instance. + */ + meta_func(const node_type &curr) noexcept + : node{&curr} {} /** * @brief Returns the number of arguments accepted by a member function. * @return The number of arguments accepted by the member function. */ [[nodiscard]] size_type arity() const noexcept { - return node.arity; + return node->arity; } /** @@ -833,7 +819,7 @@ struct meta_func: private internal::meta_common { * @return True if the member function is constant, false otherwise. */ [[nodiscard]] bool is_const() const noexcept { - return static_cast(node.traits & internal::meta_traits::is_const); + return static_cast(node->traits & internal::meta_traits::is_const); } /** @@ -841,7 +827,7 @@ struct meta_func: private internal::meta_common { * @return True if the member function is static, false otherwise. */ [[nodiscard]] bool is_static() const noexcept { - return static_cast(node.traits & internal::meta_traits::is_static); + return static_cast(node->traits & internal::meta_traits::is_static); } /** @@ -872,7 +858,7 @@ struct meta_func: private internal::meta_common { * @return A wrapper containing the returned value, if any. */ meta_any invoke(meta_handle instance, meta_any *const args, const size_type sz) const { - return sz == arity() ? node.invoke(std::move(instance), args) : meta_any{}; + return sz == arity() ? node->invoke(std::move(instance), args) : meta_any{}; } /** @@ -892,8 +878,8 @@ struct meta_func: private internal::meta_common { } /*! @copydoc meta_data::prop */ - [[nodiscard]] meta_range prop() const noexcept { - return meta_common::range(node.details); + [[nodiscard]] meta_range prop() const noexcept { + return {node->prop.cbegin(), node->prop.cend()}; } /** @@ -902,7 +888,8 @@ struct meta_func: private internal::meta_common { * @return The registered meta property for the given key, if any. */ [[nodiscard]] meta_prop prop(const id_type key) const { - return meta_common::find(node.details, key); + const auto it = node->prop.find(key); + return it != node->prop.cend() ? meta_prop{it->second} : meta_prop{}; } /** @@ -910,7 +897,7 @@ struct meta_func: private internal::meta_common { * @return The next overload of the given function, if any. */ [[nodiscard]] meta_func next() const { - return node.next ? meta_func{*node.next} : meta_func{}; + return node->next ? meta_func{*node->next} : meta_func{}; } /** @@ -918,15 +905,15 @@ struct meta_func: private internal::meta_common { * @return True if the object is valid, false otherwise. */ [[nodiscard]] explicit operator bool() const noexcept { - return !(node.invoke == nullptr); + return (node != nullptr); } private: - node_type node; + const node_type *node; }; /*! @brief Opaque wrapper for types. */ -class meta_type: private internal::meta_common { +class meta_type { template [[nodiscard]] auto lookup(meta_any *const args, const typename internal::meta_type_node::size_type sz, Func next) const { decltype(next()) candidate = nullptr; @@ -984,7 +971,10 @@ public: /*! @brief Unsigned integer type. */ using size_type = typename node_type::size_type; - /*! @copydoc meta_prop::meta_prop */ + /** + * @brief Constructs an instance from a given node. + * @param curr The underlying node with which to construct the instance. + */ meta_type(const node_type &curr = {}) noexcept : node{curr} {} @@ -1153,7 +1143,8 @@ public: * @return An iterable range to visit registered top-level base meta types. */ [[nodiscard]] meta_range base() const noexcept { - return meta_common::range(node.details); + using range_type = meta_range; + return node.details ? range_type{node.details->base.cbegin(), node.details->base.cend()} : range_type{}; } /** @@ -1161,7 +1152,8 @@ public: * @return An iterable range to visit registered top-level meta data. */ [[nodiscard]] meta_range data() const noexcept { - return meta_common::range(node.details); + using range_type = meta_range; + return node.details ? range_type{node.details->data.cbegin(), node.details->data.cend()} : range_type{}; } /** @@ -1173,8 +1165,10 @@ public: * @return The registered meta data for the given identifier, if any. */ [[nodiscard]] meta_data data(const id_type id) const { - if(auto elem = meta_common::find(node.details, id)) { - return elem; + if(node.details) { + if(const auto it = node.details->data.find(id); it != node.details->data.cend()) { + return it->second; + } } return forward_to_bases([id](auto &&type) { return type.data(id); }); @@ -1200,8 +1194,10 @@ public: * @return The registered meta function for the given identifier, if any. */ [[nodiscard]] meta_func func(const id_type id) const { - if(auto elem = meta_common::find(node.details, id)) { - return elem; + if(node.details) { + if(const auto it = node.details->func.find(id); it != node.details->func.cend()) { + return it->second; + } } return forward_to_bases([id](auto &&type) { return type.func(id); }); @@ -1352,7 +1348,8 @@ public: * @return An iterable range to visit registered top-level meta properties. */ [[nodiscard]] meta_range prop() const noexcept { - return meta_common::range(node.details); + using range_type = meta_range; + return node.details ? range_type{node.details->prop.cbegin(), node.details->prop.cend()} : range_type{}; } /** @@ -1364,8 +1361,10 @@ public: * @return The registered meta property for the given key, if any. */ [[nodiscard]] meta_prop prop(const id_type key) const { - if(auto elem = meta_common::find(node.details, key)) { - return elem; + if(node.details) { + if(const auto it = node.details->prop.find(key); it != node.details->prop.cend()) { + return it->second; + } } return forward_to_bases([key](auto &&type) { return type.prop(key); }); @@ -1474,19 +1473,19 @@ inline bool meta_any::assign(meta_any &&other) { } [[nodiscard]] inline meta_type meta_data::type() const noexcept { - return node.type(); + return node->type(); } [[nodiscard]] inline meta_type meta_data::arg(const size_type index) const noexcept { - return index < arity() ? node.arg(index) : meta_type{}; + return index < arity() ? node->arg(index) : meta_type{}; } [[nodiscard]] inline meta_type meta_func::ret() const noexcept { - return node.ret(); + return node->ret(); } [[nodiscard]] inline meta_type meta_func::arg(const size_type index) const noexcept { - return index < arity() ? node.arg(index) : meta_type{}; + return index < arity() ? node->arg(index) : meta_type{}; } /** diff --git a/src/entt/meta/node.hpp b/src/entt/meta/node.hpp index 2bb8b3563..7a699cdc6 100644 --- a/src/entt/meta/node.hpp +++ b/src/entt/meta/node.hpp @@ -52,10 +52,6 @@ struct meta_prop_node { std::shared_ptr value{}; }; -struct meta_prop_map { - dense_map prop{}; -}; - struct meta_base_node { meta_type_node (*type)() noexcept {}; const void *(*cast)(const void *) noexcept {}; @@ -86,7 +82,7 @@ struct meta_data_node { meta_type (*arg)(const size_type) noexcept {}; bool (*set)(meta_handle, meta_any){}; meta_any (*get)(meta_handle){}; - std::shared_ptr details{}; + dense_map prop{}; }; struct meta_func_node { @@ -98,7 +94,7 @@ struct meta_func_node { meta_type (*arg)(const size_type) noexcept {}; meta_any (*invoke)(meta_handle, meta_any *const){}; std::shared_ptr next{}; - std::shared_ptr details{}; + dense_map prop{}; }; struct meta_template_node { @@ -109,12 +105,13 @@ struct meta_template_node { meta_type_node (*arg)(const size_type) noexcept {}; }; -struct meta_type_descriptor: meta_prop_map { +struct meta_type_descriptor { dense_map ctor{}; dense_map base{}; dense_map conv{}; dense_map data{}; dense_map func{}; + dense_map prop{}; }; struct meta_type_node {