From 9c969fb6ac921efe215cc7aa698fe02f4e7174a1 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 5 Oct 2022 12:09:10 +0200 Subject: [PATCH] meta: context aware meta_prop_node --- src/entt/meta/factory.hpp | 5 +++-- src/entt/meta/meta.hpp | 4 +++- src/entt/meta/node.hpp | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/entt/meta/factory.hpp b/src/entt/meta/factory.hpp index 48d3d7c97..35355c946 100644 --- a/src/entt/meta/factory.hpp +++ b/src/entt/meta/factory.hpp @@ -11,6 +11,7 @@ #include "../core/fwd.hpp" #include "../core/type_info.hpp" #include "../core/type_traits.hpp" +#include "../locator/locator.hpp" // TODO #include "context.hpp" #include "meta.hpp" #include "node.hpp" @@ -489,13 +490,13 @@ public: *bucket, id, internal::meta_prop_node{ - &internal::resolve_TODO}); + &internal::resolve}); } else { internal::meta_extend( *bucket, id, internal::meta_prop_node{ - &internal::resolve_TODO>..., + &internal::resolve>..., std::make_shared>(std::forward(value))...}); } diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 6d133de84..c92ce3c53 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -13,6 +13,7 @@ #include "../core/type_info.hpp" #include "../core/type_traits.hpp" #include "../core/utility.hpp" +#include "../locator/locator.hpp" // TODO #include "adl_pointer.hpp" #include "context.hpp" #include "fwd.hpp" @@ -655,7 +656,8 @@ struct meta_prop { * @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{}; + const auto &ctx_TODO = internal::meta_context::from(locator::value_or()); + return node->value ? node->type(ctx_TODO).from_void(nullptr, node->value.get()) : meta_any{}; } /** diff --git a/src/entt/meta/node.hpp b/src/entt/meta/node.hpp index 840619203..cd9760730 100644 --- a/src/entt/meta/node.hpp +++ b/src/entt/meta/node.hpp @@ -13,6 +13,7 @@ #include "../core/type_info.hpp" #include "../core/type_traits.hpp" #include "../core/utility.hpp" +#include "../locator/locator.hpp" // TODO #include "context.hpp" #include "type_traits.hpp" @@ -48,7 +49,7 @@ enum class meta_traits : std::uint32_t { struct meta_type_node; struct meta_prop_node { - meta_type_node (*type)() noexcept {}; + meta_type_node (*type)(const meta_context &) noexcept {}; std::shared_ptr value{}; };