|
|
@@ -816,8 +816,8 @@ struct meta_data {
|
|
|
* @param area The context from which to search for meta types.
|
|
|
* @param curr The underlying node with which to construct the instance.
|
|
|
*/
|
|
|
- meta_data(const meta_ctx &area, internal::meta_data_node curr) noexcept
|
|
|
- : node{std::move(curr)},
|
|
|
+ meta_data(const meta_ctx &area, const internal::meta_data_node &curr) noexcept
|
|
|
+ : node{&curr},
|
|
|
ctx{&area} {}
|
|
|
|
|
|
/**
|
|
|
@@ -825,7 +825,7 @@ struct meta_data {
|
|
|
* @return The name assigned to the data member, if any.
|
|
|
*/
|
|
|
[[nodiscard]] const char *name() const noexcept {
|
|
|
- return node.name;
|
|
|
+ return node->name;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -833,7 +833,7 @@ struct meta_data {
|
|
|
* @return The number of setters available.
|
|
|
*/
|
|
|
[[nodiscard]] size_type arity() const noexcept {
|
|
|
- return node.arity;
|
|
|
+ return node->arity;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -841,7 +841,7 @@ struct meta_data {
|
|
|
* @return True if the data member is constant, false otherwise.
|
|
|
*/
|
|
|
[[nodiscard]] bool is_const() const noexcept {
|
|
|
- return !!(node.traits & internal::meta_traits::is_const);
|
|
|
+ return !!(node->traits & internal::meta_traits::is_const);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -849,7 +849,7 @@ struct meta_data {
|
|
|
* @return True if the data member is static, false otherwise.
|
|
|
*/
|
|
|
[[nodiscard]] bool is_static() const noexcept {
|
|
|
- return !!(node.traits & internal::meta_traits::is_static);
|
|
|
+ return !!(node->traits & internal::meta_traits::is_static);
|
|
|
}
|
|
|
|
|
|
/*! @copydoc meta_any::type */
|
|
|
@@ -865,7 +865,7 @@ struct meta_data {
|
|
|
template<typename Type>
|
|
|
// NOLINTNEXTLINE(modernize-use-nodiscard)
|
|
|
bool set(meta_handle instance, Type &&value) const {
|
|
|
- return (node.set != nullptr) && node.set(meta_handle{*ctx, std::move(instance)}, meta_any{*ctx, std::forward<Type>(value)});
|
|
|
+ return (node->set != nullptr) && node->set(meta_handle{*ctx, std::move(instance)}, meta_any{*ctx, std::forward<Type>(value)});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -874,7 +874,7 @@ struct meta_data {
|
|
|
* @return A wrapper containing the value of the underlying variable.
|
|
|
*/
|
|
|
[[nodiscard]] meta_any get(meta_handle instance) const {
|
|
|
- return (node.get != nullptr) ? node.get(meta_handle{*ctx, std::move(instance)}) : meta_any{meta_ctx_arg, *ctx};
|
|
|
+ return (node->get != nullptr) ? node->get(meta_handle{*ctx, std::move(instance)}) : meta_any{meta_ctx_arg, *ctx};
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -891,7 +891,7 @@ struct meta_data {
|
|
|
*/
|
|
|
template<typename Type>
|
|
|
[[nodiscard]] Type traits() const noexcept {
|
|
|
- return internal::meta_to_user_traits<Type>(node.traits);
|
|
|
+ return internal::meta_to_user_traits<Type>(node->traits);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -899,7 +899,7 @@ struct meta_data {
|
|
|
* @return User defined arbitrary data.
|
|
|
*/
|
|
|
[[nodiscard]] meta_custom custom() const noexcept {
|
|
|
- return {node.custom};
|
|
|
+ return {node->custom};
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -907,7 +907,7 @@ struct meta_data {
|
|
|
* @return True if the object is valid, false otherwise.
|
|
|
*/
|
|
|
[[nodiscard]] explicit operator bool() const noexcept {
|
|
|
- return (node.get != nullptr);
|
|
|
+ return (node != nullptr);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -916,11 +916,11 @@ struct meta_data {
|
|
|
* @return True if the objects refer to the same type, false otherwise.
|
|
|
*/
|
|
|
[[nodiscard]] bool operator==(const meta_data &other) const noexcept {
|
|
|
- return (ctx == other.ctx) && (node.set == other.node.set) && (node.get == other.node.get);
|
|
|
+ return (ctx == other.ctx) && (node == other.node);
|
|
|
}
|
|
|
|
|
|
private:
|
|
|
- internal::meta_data_node node{};
|
|
|
+ const internal::meta_data_node *node{};
|
|
|
const meta_ctx *ctx{&locator<meta_ctx>::value_or()};
|
|
|
};
|
|
|
|
|
|
@@ -947,8 +947,8 @@ struct meta_func {
|
|
|
* @param area The context from which to search for meta types.
|
|
|
* @param curr The underlying node with which to construct the instance.
|
|
|
*/
|
|
|
- meta_func(const meta_ctx &area, internal::meta_func_node curr) noexcept
|
|
|
- : node{std::move(curr)},
|
|
|
+ meta_func(const meta_ctx &area, const internal::meta_func_node &curr) noexcept
|
|
|
+ : node{&curr},
|
|
|
ctx{&area} {}
|
|
|
|
|
|
/**
|
|
|
@@ -956,7 +956,7 @@ struct meta_func {
|
|
|
* @return The name assigned to the member function, if any.
|
|
|
*/
|
|
|
[[nodiscard]] const char *name() const noexcept {
|
|
|
- return node.name;
|
|
|
+ return node->name;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -964,7 +964,7 @@ struct meta_func {
|
|
|
* @return The number of arguments accepted by the member function.
|
|
|
*/
|
|
|
[[nodiscard]] size_type arity() const noexcept {
|
|
|
- return node.arity;
|
|
|
+ return node->arity;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -972,7 +972,7 @@ struct meta_func {
|
|
|
* @return True if the member function is constant, false otherwise.
|
|
|
*/
|
|
|
[[nodiscard]] bool is_const() const noexcept {
|
|
|
- return !!(node.traits & internal::meta_traits::is_const);
|
|
|
+ return !!(node->traits & internal::meta_traits::is_const);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -980,7 +980,7 @@ struct meta_func {
|
|
|
* @return True if the member function is static, false otherwise.
|
|
|
*/
|
|
|
[[nodiscard]] bool is_static() const noexcept {
|
|
|
- return !!(node.traits & internal::meta_traits::is_static);
|
|
|
+ return !!(node->traits & internal::meta_traits::is_static);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1004,7 +1004,7 @@ struct meta_func {
|
|
|
* @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 ((node.invoke != nullptr) && (sz == arity())) ? node.invoke(meta_handle{*ctx, std::move(instance)}, args) : meta_any{meta_ctx_arg, *ctx};
|
|
|
+ return ((node->invoke != nullptr) && (sz == arity())) ? node->invoke(meta_handle{*ctx, std::move(instance)}, args) : meta_any{meta_ctx_arg, *ctx};
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1023,12 +1023,12 @@ struct meta_func {
|
|
|
/*! @copydoc meta_data::traits */
|
|
|
template<typename Type>
|
|
|
[[nodiscard]] Type traits() const noexcept {
|
|
|
- return internal::meta_to_user_traits<Type>(node.traits);
|
|
|
+ return internal::meta_to_user_traits<Type>(node->traits);
|
|
|
}
|
|
|
|
|
|
/*! @copydoc meta_data::custom */
|
|
|
[[nodiscard]] meta_custom custom() const noexcept {
|
|
|
- return {node.custom};
|
|
|
+ return {node->custom};
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1036,7 +1036,7 @@ struct meta_func {
|
|
|
* @return The next overload of the given function, if any.
|
|
|
*/
|
|
|
[[nodiscard]] meta_func next() const {
|
|
|
- return (node.next != nullptr) ? meta_func{*ctx, *node.next} : meta_func{};
|
|
|
+ return (node->next != nullptr) ? meta_func{*ctx, *node->next} : meta_func{};
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -1044,16 +1044,16 @@ struct meta_func {
|
|
|
* @return True if the object is valid, false otherwise.
|
|
|
*/
|
|
|
[[nodiscard]] explicit operator bool() const noexcept {
|
|
|
- return (node.invoke != nullptr);
|
|
|
+ return (node != nullptr);
|
|
|
}
|
|
|
|
|
|
/*! @copydoc meta_data::operator== */
|
|
|
[[nodiscard]] bool operator==(const meta_func &other) const noexcept {
|
|
|
- return (ctx == other.ctx) && (node.invoke == other.node.invoke);
|
|
|
+ return (ctx == other.ctx) && (node == other.node);
|
|
|
}
|
|
|
|
|
|
private:
|
|
|
- internal::meta_func_node node{};
|
|
|
+ const internal::meta_func_node *node{};
|
|
|
const meta_ctx *ctx{&locator<meta_ctx>::value_or()};
|
|
|
};
|
|
|
|
|
|
@@ -1588,19 +1588,19 @@ inline bool meta_any::assign(meta_any &&other) {
|
|
|
}
|
|
|
|
|
|
[[nodiscard]] inline meta_type meta_data::type() const noexcept {
|
|
|
- return (node.type != nullptr) ? meta_type{*ctx, node.type(internal::meta_context::from(*ctx))} : meta_type{};
|
|
|
+ return (node->type != nullptr) ? meta_type{*ctx, node->type(internal::meta_context::from(*ctx))} : meta_type{};
|
|
|
}
|
|
|
|
|
|
[[nodiscard]] inline meta_type meta_data::arg(const size_type index) const noexcept {
|
|
|
- return index < arity() ? node.arg(*ctx, index) : meta_type{};
|
|
|
+ return index < arity() ? node->arg(*ctx, index) : meta_type{};
|
|
|
}
|
|
|
|
|
|
[[nodiscard]] inline meta_type meta_func::ret() const noexcept {
|
|
|
- return (node.ret != nullptr) ? meta_type{*ctx, node.ret(internal::meta_context::from(*ctx))} : meta_type{};
|
|
|
+ return (node->ret != nullptr) ? meta_type{*ctx, node->ret(internal::meta_context::from(*ctx))} : meta_type{};
|
|
|
}
|
|
|
|
|
|
[[nodiscard]] inline meta_type meta_func::arg(const size_type index) const noexcept {
|
|
|
- return index < arity() ? node.arg(*ctx, index) : meta_type{};
|
|
|
+ return index < arity() ? node->arg(*ctx, index) : meta_type{};
|
|
|
}
|
|
|
|
|
|
/*! @cond TURN_OFF_DOXYGEN */
|