Opaque wrapper for meta functions.
More...
#include <entt.hpp>
|
using | node_type = internal::meta_func_node |
| Node type.
|
|
using | size_type = typename node_type::size_type |
| Unsigned integer type.
|
|
Opaque wrapper for meta functions.
◆ meta_func()
entt::meta_func::meta_func |
( |
const node_type * |
curr = nullptr | ) |
|
|
inline |
Constructs an instance from a given node.
- Parameters
-
curr | The underlying node with which to construct the instance. |
◆ arg()
Returns the meta type of the i-th argument of a meta function.
- Parameters
-
index | The index of the argument of which to return the meta type. |
- Returns
- The meta type of the i-th argument of a meta function, if any.
◆ id()
id_type entt::meta_func::id |
( |
| ) |
const |
|
inline |
Returns the identifier assigned to a meta object.
- Returns
- The identifier assigned to the meta object.
◆ invoke() [1/2]
Invokes the underlying function, if possible.
To invoke a meta function, the parameters must be such that a cast or conversion to the required types is possible. Otherwise, an empty and thus invalid wrapper is returned.
It must be possible to cast the instance to the parent type of the meta function. Otherwise, invoking the underlying function results in an undefined behavior.
- Parameters
-
instance | An opaque instance of the underlying type. |
args | Parameters to use to invoke the function. |
sz | Number of parameters to use to invoke the function. |
- Returns
- A meta any containing the returned value, if any.
◆ invoke() [2/2]
template<typename... Args>
Invokes the underlying function, if possible.
- See also
- invoke
- Template Parameters
-
Args | Types of arguments to use to invoke the function. |
- Parameters
-
instance | An opaque instance of the underlying type. |
args | Parameters to use to invoke the function. |
- Returns
- A meta any containing the new instance, if any.
◆ is_const()
bool entt::meta_func::is_const |
( |
| ) |
const |
|
inline |
Indicates whether a meta function is constant or not.
- Returns
- True if the meta function is constant, false otherwise.
◆ is_static()
bool entt::meta_func::is_static |
( |
| ) |
const |
|
inline |
Indicates whether a meta function is static or not.
- Returns
- True if the meta function is static, false otherwise.
◆ operator bool()
entt::meta_func::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.
◆ ret()
Returns the meta type of the return type of a meta function.
- Returns
- The meta type of the return type of the meta function.
◆ size()
Returns the number of arguments accepted by a meta function.
- Returns
- The number of arguments accepted by the meta function.
The documentation for this struct was generated from the following file: