Opaque wrapper for meta data.
More...
#include <entt.hpp>
|
using | node_type = internal::meta_data_node |
| Node type.
|
|
Opaque wrapper for meta data.
◆ meta_data()
entt::meta_data::meta_data |
( |
const node_type * |
curr = nullptr | ) |
|
|
inline |
Constructs an instance from a given node.
- Parameters
-
curr | The underlying node with which to construct the instance. |
◆ get()
Gets the value of a given variable.
It must be possible to cast the instance to the parent type of the meta data. Otherwise, invoking the getter results in an undefined behavior.
- Parameters
-
instance | An opaque instance of the underlying type. |
- Returns
- A meta any containing the value of the underlying variable.
◆ id()
id_type entt::meta_data::id |
( |
| ) |
const |
|
inline |
Returns the identifier assigned to a meta object.
- Returns
- The identifier assigned to the meta object.
◆ is_const()
bool entt::meta_data::is_const |
( |
| ) |
const |
|
inline |
Indicates whether a meta data is constant or not.
- Returns
- True if the meta data is constant, false otherwise.
◆ is_static()
bool entt::meta_data::is_static |
( |
| ) |
const |
|
inline |
Indicates whether a meta data is static or not.
- Returns
- True if the meta data is static, false otherwise.
◆ operator bool()
entt::meta_data::operator bool |
( |
| ) |
const |
|
inlineexplicit |
Returns true if a meta object is valid, false otherwise.
- Returns
- True if the meta object is valid, false otherwise.
◆ parent()
Returns the meta type to which a meta object belongs.
- Returns
- The meta type to which the meta object belongs.
◆ prop() [1/2]
Returns a range to use to visit all meta properties.
- Returns
- An iterable range to use to visit all meta properties.
◆ prop() [2/2]
Returns the property associated with a given key.
- Parameters
-
key | The key to use to search for a property. |
- Returns
- The property associated with the given key, if any.
◆ set()
template<typename Type >
bool entt::meta_data::set |
( |
meta_handle |
instance, |
|
|
Type && |
value |
|
) |
| const |
|
inline |
Sets the value of a given variable.
It must be possible to cast the instance to the parent type of the meta data. Otherwise, invoking the setter results in an undefined behavior.
The type of the value must be such that a cast or conversion to the type of the variable is possible. Otherwise, invoking the setter does nothing.
- Template Parameters
-
Type | Type of value to assign. |
- Parameters
-
instance | An opaque instance of the underlying type. |
value | Parameter to use to set the underlying variable. |
- Returns
- True in case of success, false otherwise.
◆ type()
Returns the meta type of the underlying object.
- Returns
- The meta type of the underlying object, if any.
The documentation for this struct was generated from the following file: