From 33383bd0c374261324f62fc3ee21bbdb8a897cee Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Wed, 5 Oct 2022 18:07:31 +0200 Subject: [PATCH] meta: try to follow my own naming convention :) --- src/entt/meta/meta.hpp | 32 ++++++++++++++++---------------- src/entt/meta/node.hpp | 4 ++-- src/entt/meta/resolve.hpp | 30 +++++++++++++++--------------- src/entt/meta/utility.hpp | 6 +++--- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/entt/meta/meta.hpp b/src/entt/meta/meta.hpp index 1d5e8efb1..22fa83b00 100644 --- a/src/entt/meta/meta.hpp +++ b/src/entt/meta/meta.hpp @@ -656,8 +656,8 @@ struct meta_prop { * @return A wrapper containing the value stored with the property. */ [[nodiscard]] meta_any value() const { - 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{}; + const auto &context_TODO = internal::meta_context::from(locator::value_or()); + return node->value ? node->type(context_TODO).from_void(nullptr, node->value.get()) : meta_any{}; } /** @@ -988,8 +988,8 @@ public: */ meta_type(const internal::meta_base_node &curr) noexcept : meta_type{} { - if(const auto &ctx_TODO = internal::meta_context::from(locator::value_or()); curr.type) { - node = curr.type(ctx_TODO); + if(const auto &context_TODO = internal::meta_context::from(locator::value_or()); curr.type) { + node = curr.type(context_TODO); } } @@ -1080,8 +1080,8 @@ public: * doesn't refer to a pointer type. */ [[nodiscard]] meta_type remove_pointer() const noexcept { - const auto &ctx_TODO = internal::meta_context::from(locator::value_or()); - return node.remove_pointer(ctx_TODO); + const auto &context_TODO = internal::meta_context::from(locator::value_or()); + return node.remove_pointer(context_TODO); } /** @@ -1135,8 +1135,8 @@ public: * @return The tag for the class template of the underlying type. */ [[nodiscard]] inline meta_type template_type() const noexcept { - const auto &ctx_TODO = internal::meta_context::from(locator::value_or()); - return node.templ.type ? meta_type{node.templ.type(ctx_TODO)} : meta_type{}; + const auto &context_TODO = internal::meta_context::from(locator::value_or()); + return node.templ.type ? meta_type{node.templ.type(context_TODO)} : meta_type{}; } /** @@ -1145,8 +1145,8 @@ public: * @return The type of the i-th template argument of a type. */ [[nodiscard]] inline meta_type template_arg(const size_type index) const noexcept { - const auto &ctx_TODO = internal::meta_context::from(locator::value_or()); - return index < template_arity() ? meta_type{node.templ.arg(index, ctx_TODO)} : meta_type{}; + const auto &context_TODO = internal::meta_context::from(locator::value_or()); + return index < template_arity() ? meta_type{node.templ.arg(index, context_TODO)} : meta_type{}; } /** @@ -1447,8 +1447,8 @@ bool meta_any::set(const id_type id, Type &&value) { if(const auto *value = data(); node.details) { for(auto &&curr: node.details->base) { - const auto &ctx_TODO = internal::meta_context::from(locator::value_or()); - const auto &as_const = curr.second.type(ctx_TODO).from_void(nullptr, curr.second.cast(value)); + const auto &context_TODO = internal::meta_context::from(locator::value_or()); + const auto &as_const = curr.second.type(context_TODO).from_void(nullptr, curr.second.cast(value)); if(auto other = as_const.allow_cast(type); other) { return other; @@ -1486,8 +1486,8 @@ inline bool meta_any::assign(meta_any &&other) { } [[nodiscard]] inline meta_type meta_data::type() const noexcept { - const auto &ctx_TODO = internal::meta_context::from(locator::value_or()); - return node->type(ctx_TODO); + const auto &context_TODO = internal::meta_context::from(locator::value_or()); + return node->type(context_TODO); } [[nodiscard]] inline meta_type meta_data::arg(const size_type index) const noexcept { @@ -1496,8 +1496,8 @@ inline bool meta_any::assign(meta_any &&other) { } [[nodiscard]] inline meta_type meta_func::ret() const noexcept { - const auto &ctx_TODO = internal::meta_context::from(locator::value_or()); - return node->ret(ctx_TODO); + const auto &context_TODO = internal::meta_context::from(locator::value_or()); + return node->ret(context_TODO); } [[nodiscard]] inline meta_type meta_func::arg(const size_type index) const noexcept { diff --git a/src/entt/meta/node.hpp b/src/entt/meta/node.hpp index 879174954..7219f6c21 100644 --- a/src/entt/meta/node.hpp +++ b/src/entt/meta/node.hpp @@ -154,10 +154,10 @@ template } if(from.details) { - const auto &ctx_TODO = meta_context::from(locator::value_or()); + const auto &context_TODO = meta_context::from(locator::value_or()); for(auto &&curr: from.details->base) { - if(const void *elem = try_cast(curr.second.type(ctx_TODO), to, curr.second.cast(instance)); elem) { + if(const void *elem = try_cast(curr.second.type(context_TODO), to, curr.second.cast(instance)); elem) { return elem; } } diff --git a/src/entt/meta/resolve.hpp b/src/entt/meta/resolve.hpp index f939aee65..9b8cc8c18 100644 --- a/src/entt/meta/resolve.hpp +++ b/src/entt/meta/resolve.hpp @@ -14,33 +14,33 @@ namespace entt { /** * @brief Returns the meta type associated with a given type. * @tparam Type Type to use to search for a meta type. - * @param context The context from which to search for meta types. + * @param ctx The context from which to search for meta types. * @return The meta type associated with the given type, if any. */ template -[[nodiscard]] meta_type resolve(const meta_ctx &context = locator::value_or()) noexcept { - auto &&ctx = internal::meta_context::from(context); - return internal::resolve>>(ctx); +[[nodiscard]] meta_type resolve(const meta_ctx &ctx = locator::value_or()) noexcept { + auto &&context = internal::meta_context::from(ctx); + return internal::resolve>>(context); } /** * @brief Returns a range to use to visit all meta types. - * @param context The context from which to search for meta types. + * @param ctx The context from which to search for meta types. * @return An iterable range to use to visit all meta types. */ -[[nodiscard]] inline meta_range resolve(const meta_ctx &context = locator::value_or()) noexcept { - auto &&ctx = internal::meta_context::from(context); - return {ctx.value.cbegin(), ctx.value.cend()}; +[[nodiscard]] inline meta_range resolve(const meta_ctx &ctx = locator::value_or()) noexcept { + auto &&context = internal::meta_context::from(ctx); + return {context.value.cbegin(), context.value.cend()}; } /** * @brief Returns the meta type associated with a given identifier, if any. * @param id Unique identifier. - * @param context The context from which to search for meta types. + * @param ctx The context from which to search for meta types. * @return The meta type associated with the given identifier, if any. */ -[[nodiscard]] inline meta_type resolve(const id_type id, const meta_ctx &context = locator::value_or()) noexcept { - for(auto &&curr: resolve(context)) { +[[nodiscard]] inline meta_type resolve(const id_type id, const meta_ctx &ctx = locator::value_or()) noexcept { + for(auto &&curr: resolve(ctx)) { if(curr.second.id() == id) { return curr.second; } @@ -52,12 +52,12 @@ template /** * @brief Returns the meta type associated with a given type info object. * @param info The type info object of the requested type. - * @param context The context from which to search for meta types. + * @param ctx The context from which to search for meta types. * @return The meta type associated with the given type info object, if any. */ -[[nodiscard]] inline meta_type resolve(const type_info &info, const meta_ctx &context = locator::value_or()) noexcept { - auto &&ctx = internal::meta_context::from(context); - const auto *elem = internal::try_resolve(info, ctx); +[[nodiscard]] inline meta_type resolve(const type_info &info, const meta_ctx &ctx = locator::value_or()) noexcept { + auto &&context = internal::meta_context::from(ctx); + const auto *elem = internal::try_resolve(info, context); return elem ? *elem : meta_type{}; } diff --git a/src/entt/meta/utility.hpp b/src/entt/meta/utility.hpp index b4c519747..52cf12677 100644 --- a/src/entt/meta/utility.hpp +++ b/src/entt/meta/utility.hpp @@ -176,9 +176,9 @@ meta_any meta_dispatch([[maybe_unused]] Type &&value) { * @return The meta type of the i-th element of the list of arguments. */ template -[[nodiscard]] static meta_type meta_arg(const std::size_t index, const meta_ctx &context = locator::value_or()) noexcept { - auto &&ctx = internal::meta_context::from(context); - return internal::meta_arg_node(Type{}, index, ctx); +[[nodiscard]] static meta_type meta_arg(const std::size_t index, const meta_ctx &ctx = locator::value_or()) noexcept { + auto &&context = internal::meta_context::from(ctx); + return internal::meta_arg_node(Type{}, index, context); } /**