Clementine
|
Opaque wrapper for meta types. More...
#include <entt.hpp>
Public Types | |
using | node_type = internal::meta_type_node |
Node type. | |
using | size_type = typename node_type::size_type |
Unsigned integer type. | |
Public Member Functions | |
meta_type (node_type *curr=nullptr) ENTT_NOEXCEPT | |
Constructs an instance from a given node. More... | |
type_info | info () const ENTT_NOEXCEPT |
Returns the type info object of the underlying type. More... | |
id_type | id () const ENTT_NOEXCEPT |
Returns the identifier assigned to a meta object. More... | |
size_type | size_of () const ENTT_NOEXCEPT |
Returns the size of the underlying type if known. More... | |
bool | is_void () const ENTT_NOEXCEPT |
Checks whether a type refers to void or not. More... | |
bool | is_integral () const ENTT_NOEXCEPT |
Checks whether a type refers to an integral type or not. More... | |
bool | is_floating_point () const ENTT_NOEXCEPT |
Checks whether a type refers to a floating-point type or not. More... | |
bool | is_array () const ENTT_NOEXCEPT |
Checks whether a type refers to an array type or not. More... | |
bool | is_enum () const ENTT_NOEXCEPT |
Checks whether a type refers to an enum or not. More... | |
bool | is_union () const ENTT_NOEXCEPT |
Checks whether a type refers to an union or not. More... | |
bool | is_class () const ENTT_NOEXCEPT |
Checks whether a type refers to a class or not. More... | |
bool | is_pointer () const ENTT_NOEXCEPT |
Checks whether a type refers to a pointer or not. More... | |
bool | is_function_pointer () const ENTT_NOEXCEPT |
Checks whether a type refers to a function pointer or not. More... | |
bool | is_member_object_pointer () const ENTT_NOEXCEPT |
Checks whether a type refers to a pointer to data member or not. More... | |
bool | is_member_function_pointer () const ENTT_NOEXCEPT |
Checks whether a type refers to a pointer to member function or not. More... | |
bool | is_pointer_like () const ENTT_NOEXCEPT |
Checks whether a type is a pointer-like type or not. More... | |
bool | is_sequence_container () const ENTT_NOEXCEPT |
Checks whether a type refers to a sequence container or not. More... | |
bool | is_associative_container () const ENTT_NOEXCEPT |
Checks whether a type refers to an associative container or not. More... | |
size_type | rank () const ENTT_NOEXCEPT |
If a type refers to an array type, provides the number of dimensions of the array. More... | |
size_type | extent (size_type dim={}) const ENTT_NOEXCEPT |
If a type refers to an array type, provides the number of elements along the given dimension of the array. More... | |
meta_type | remove_pointer () const ENTT_NOEXCEPT |
Provides the meta type for which the pointer is defined. More... | |
meta_type | remove_extent () const ENTT_NOEXCEPT |
Provides the meta type for which the array is defined. More... | |
meta_range< meta_base > | base () const ENTT_NOEXCEPT |
Returns a range to use to visit top-level meta bases. More... | |
meta_base | base (const id_type id) const |
Returns the meta base associated with a given identifier. More... | |
meta_range< meta_conv > | conv () const ENTT_NOEXCEPT |
Returns a range to use to visit top-level meta conversion functions. More... | |
template<typename Type > | |
meta_conv | conv () const |
Returns the meta conversion function associated with a given type. More... | |
meta_range< meta_ctor > | ctor () const ENTT_NOEXCEPT |
Returns a range to use to visit top-level meta constructors. More... | |
template<typename... Args> | |
meta_ctor | ctor () const |
Returns the meta constructor that accepts a given list of types of arguments. More... | |
meta_range< meta_data > | data () const ENTT_NOEXCEPT |
Returns a range to use to visit top-level meta data. More... | |
meta_data | data (const id_type id) const |
Returns the meta data associated with a given identifier. More... | |
meta_range< meta_func > | func () const ENTT_NOEXCEPT |
Returns a range to use to visit top-level meta functions. More... | |
meta_func | func (const id_type id) const |
Returns the meta function associated with a given identifier. More... | |
meta_any | construct (meta_any *const args, const size_type sz) const |
Creates an instance of the underlying type, if possible. More... | |
template<typename... Args> | |
meta_any | construct (Args &&... args) const |
Creates an instance of the underlying type, if possible. More... | |
meta_any | invoke (const id_type id, meta_handle instance, meta_any *const args, const size_type sz) const |
Invokes the function with the given identifier, if possible. More... | |
template<typename... Args> | |
meta_any | invoke (const id_type id, meta_handle instance, Args &&... args) const |
Invokes the function with the given identifier, if possible. More... | |
template<typename Type > | |
bool | set (const id_type id, meta_handle instance, Type &&value) const |
Sets the value of a given variable. More... | |
meta_any | get (const id_type id, meta_handle instance) const |
Gets the value of a given variable. More... | |
meta_range< meta_prop > | prop () const ENTT_NOEXCEPT |
Returns a range to use to visit top-level meta properties. More... | |
meta_prop | prop (meta_any key) const |
Returns the property associated with a given key. More... | |
operator bool () const ENTT_NOEXCEPT | |
Returns true if a meta object is valid, false otherwise. More... | |
bool | operator== (const meta_type &other) const ENTT_NOEXCEPT |
Checks if two meta objects refer to the same type. More... | |
void | reset () ENTT_NOEXCEPT |
Resets a meta type and all its parts. More... | |
Opaque wrapper for meta types.
|
inline |
Constructs an instance from a given node.
curr | The underlying node with which to construct the instance. |
|
inline |
Returns a range to use to visit top-level meta bases.
|
inline |
Returns the meta base associated with a given identifier.
id | Unique identifier. |
Creates an instance of the underlying type, if possible.
To create a valid instance, 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.
args | Parameters to use to construct the instance. |
sz | Number of parameters to use to construct the instance. |
|
inline |
Creates an instance of the underlying type, if possible.
Args | Types of arguments to use to construct the instance. |
args | Parameters to use to construct the instance. |
|
inline |
Returns a range to use to visit top-level meta conversion functions.
|
inline |
Returns the meta conversion function associated with a given type.
Type | The type to use to search for a meta conversion function. |
|
inline |
Returns a range to use to visit top-level meta constructors.
|
inline |
Returns the meta constructor that accepts a given list of types of arguments.
|
inline |
Returns a range to use to visit top-level meta data.
|
inline |
Returns the meta data associated with a given identifier.
The meta data of the base classes will also be visited, if any.
id | Unique identifier. |
If a type refers to an array type, provides the number of elements along the given dimension of the array.
dim | The dimension of which to return the number of elements. |
|
inline |
Returns a range to use to visit top-level meta functions.
|
inline |
Returns the meta function associated with a given identifier.
The meta functions of the base classes will also be visited, if any.
In the case of overloaded meta functions, the first one with the required id will be returned.
id | Unique identifier. |
|
inline |
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.
id | Unique identifier. |
instance | An opaque instance of the underlying type. |
|
inline |
Returns the identifier assigned to a meta object.
|
inline |
Returns the type info object of the underlying type.
|
inline |
Invokes the function with the given identifier, 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.
id | Unique identifier. |
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. |
|
inline |
Invokes the function with the given identifier, if possible.
id | Unique identifier. |
Args | Types of arguments to use to invoke the function. |
instance | An opaque instance of the underlying type. |
args | Parameters to use to invoke the function. |
|
inline |
Checks whether a type refers to an array type or not.
|
inline |
Checks whether a type refers to an associative container or not.
|
inline |
Checks whether a type refers to a class or not.
|
inline |
Checks whether a type refers to an enum or not.
|
inline |
Checks whether a type refers to a floating-point type or not.
|
inline |
Checks whether a type refers to a function pointer or not.
|
inline |
Checks whether a type refers to an integral type or not.
|
inline |
Checks whether a type refers to a pointer to member function or not.
|
inline |
Checks whether a type refers to a pointer to data member or not.
|
inline |
Checks whether a type refers to a pointer or not.
|
inline |
Checks whether a type is a pointer-like type or not.
|
inline |
Checks whether a type refers to a sequence container or not.
|
inline |
Checks whether a type refers to an union or not.
|
inline |
Checks whether a type refers to void or not.
|
inlineexplicit |
Returns true if a meta object is valid, false otherwise.
|
inline |
Checks if two meta objects refer to the same type.
other | The meta object with which to compare. |
|
inline |
Returns a range to use to visit top-level meta properties.
Returns the property associated with a given key.
Properties of the base classes will also be visited, if any.
key | The key to use to search for a property. |
|
inline |
If a type refers to an array type, provides the number of dimensions of the array.
|
inline |
Provides the meta type for which the array is defined.
|
inline |
Provides the meta type for which the pointer is defined.
|
inline |
Resets a meta type and all its parts.
This function resets a meta type and all its data members, member functions and properties, as well as its constructors, destructors and conversion functions if any.
Base classes aren't reset but the link between the two types is removed.
The meta type is also removed from the list of searchable types.
|
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.
Type | Type of value to assign. |
id | Unique identifier. |
instance | An opaque instance of the underlying type. |
value | Parameter to use to set the underlying variable. |
|
inline |
Returns the size of the underlying type if known.