EnTT  3.10.0
Public Types | Public Member Functions | List of all members
entt::meta_data Struct Reference

Opaque wrapper for data members. More...

#include <meta.hpp>

Public Types

using node_type = internal::meta_data_node
 Node type.
 
using size_type = typename node_type::size_type
 Unsigned integer type.
 

Public Member Functions

 meta_data (const node_type *curr=nullptr)
 Constructs an instance from a given node. More...
 
id_type id () const
 Returns the identifier assigned to a type. More...
 
size_type arity () const
 Returns the number of setters available. More...
 
bool is_const () const
 Indicates whether a data member is constant or not. More...
 
bool is_static () const
 Indicates whether a data member is static or not. More...
 
meta_type type () const
 Returns the object type if any, type_id<void>() otherwise. More...
 
template<typename Type >
bool set (meta_handle instance, Type &&value) const
 Sets the value of a given variable. More...
 
meta_any get (meta_handle instance) const
 Gets the value of a given variable. More...
 
meta_type arg (const size_type index) const
 Returns the type accepted by the i-th setter. More...
 
meta_range< meta_prop > prop () const
 Returns a range to visit registered meta properties. More...
 
meta_prop prop (meta_any key) const
 Lookup function for registered meta properties. More...
 
 operator bool () const
 Returns true if an object is valid, false otherwise. More...
 

Detailed Description

Opaque wrapper for data members.

Definition at line 714 of file meta.hpp.

Constructor & Destructor Documentation

◆ meta_data()

entt::meta_data::meta_data ( const node_type *  curr = nullptr)
inline

Constructs an instance from a given node.

Parameters
currThe underlying node with which to construct the instance.

Definition at line 721 of file meta.hpp.

Member Function Documentation

◆ arg()

meta_type entt::meta_data::arg ( const size_type  index) const
inline

Returns the type accepted by the i-th setter.

Parameters
indexIndex of the setter of which to return the accepted type.
Returns
The type accepted by the i-th setter.

Definition at line 1432 of file meta.hpp.

◆ arity()

size_type entt::meta_data::arity ( ) const
inline

Returns the number of setters available.

Returns
The number of setters available.

Definition at line 733 of file meta.hpp.

◆ get()

meta_any entt::meta_data::get ( meta_handle  instance) const
inline

Gets the value of a given variable.

It must be possible to cast the instance to the parent type of the data member.

Parameters
instanceAn opaque instance of the underlying type.
Returns
A wrapper containing the value of the underlying variable.

Definition at line 783 of file meta.hpp.

◆ id()

id_type entt::meta_data::id ( ) const
inline

Returns the identifier assigned to a type.

Returns
The identifier assigned to the type.

Definition at line 725 of file meta.hpp.

◆ is_const()

bool entt::meta_data::is_const ( ) const
inline

Indicates whether a data member is constant or not.

Returns
True if the data member is constant, false otherwise.

Definition at line 741 of file meta.hpp.

◆ is_static()

bool entt::meta_data::is_static ( ) const
inline

Indicates whether a data member is static or not.

Returns
True if the data member is static, false otherwise.

Definition at line 749 of file meta.hpp.

◆ operator bool()

entt::meta_data::operator bool ( ) const
inlineexplicit

Returns true if an object is valid, false otherwise.

Returns
True if the object is valid, false otherwise.

Definition at line 821 of file meta.hpp.

◆ prop() [1/2]

meta_range<meta_prop> entt::meta_data::prop ( ) const
inline

Returns a range to visit registered meta properties.

Returns
An iterable range to visit registered meta properties.

Definition at line 798 of file meta.hpp.

◆ prop() [2/2]

meta_prop entt::meta_data::prop ( meta_any  key) const
inline

Lookup function for registered meta properties.

Parameters
keyThe key to use to search for a property.
Returns
The registered meta property for the given key, if any.

Definition at line 807 of file meta.hpp.

◆ 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 data member.
The type of the value is such that a cast or conversion to the type of the variable is possible. Otherwise, invoking the setter does nothing.

Template Parameters
TypeType of value to assign.
Parameters
instanceAn opaque instance of the underlying type.
valueParameter to use to set the underlying variable.
Returns
True in case of success, false otherwise.

Definition at line 770 of file meta.hpp.

◆ type()

meta_type entt::meta_data::type ( ) const
inline

Returns the object type if any, type_id<void>() otherwise.

Returns
The object type if any, type_id<void>() otherwise.

Definition at line 1424 of file meta.hpp.


The documentation for this struct was generated from the following file: