Struct meta_conv
Synopsis
#include <src/entt/meta/meta.hpp>
struct meta_conv
Description
Opaque wrapper for meta conversion functions.
Mentioned in
- Runtime Reflection System / Enjoy the runtime
Methods
meta_conv | Constructs an instance from a given node. | |
convert | Converts an instance to the underlying type. | |
operator bool | Returns true if a meta object is valid, false otherwise. | |
parent | Returns the meta type to which a meta object belongs. | |
type | Returns the meta type of the underlying object. |
Source
Lines 707-741 in src/entt/meta/meta.hpp.
struct meta_conv {
/*! @brief Node type. */
using node_type = internal::meta_conv_node;
/*! @copydoc meta_prop::meta_prop */
meta_conv(const node_type *curr = nullptr) ENTT_NOEXCEPT
: node{curr}
{}
/*! @copydoc meta_base::parent */
[[nodiscard]] inline meta_type parent() const ENTT_NOEXCEPT;
/*! @copydoc meta_any::type */
[[nodiscard]] inline meta_type type() const ENTT_NOEXCEPT;
/**
* @brief Converts an instance to the underlying type.
* @param instance The instance to convert.
* @return An opaque pointer to the instance to convert.
*/
[[nodiscard]] meta_any convert(const void *instance) const {
return node->conv(instance);
}
/**
* @brief Returns true if a meta object is valid, false otherwise.
* @return True if the meta object is valid, false otherwise.
*/
[[nodiscard]] explicit operator bool() const ENTT_NOEXCEPT {
return !(node == nullptr);
}
private:
const node_type *node;
};