EnTT 4.0.0
Loading...
Searching...
No Matches
entt::meta_data Struct Reference

Opaque wrapper for data members. More...

#include <meta.hpp>

Inheritance diagram for entt::meta_data:
Collaboration diagram for entt::meta_data:

Public Member Functions

stl::string_view name () const noexcept
 Returns the name assigned to a data member, if any.
size_type set_arity () const noexcept
 Returns the number of arguments of a data member's setter.
size_type get_arity () const noexcept
 Returns the number of arguments of a data member's getter.
bool is_const () const noexcept
 Indicates whether a data member is constant or not.
bool is_static () const noexcept
 Indicates whether a data member is static or not.
meta_type type () const noexcept
 Returns the meta type associated with the contained instance.
template<typename Instance = meta_handle>
bool set (Instance &&instance, auto &&...args) const
 Sets the value of a given variable.
template<typename Instance = meta_handle>
meta_any get (Instance &&instance, auto &&...args) const
 Gets the value of a given variable.
meta_type set_arg (size_type index) const noexcept
 Returns the type of the i-th argument of a data member's setter.
meta_type get_arg (size_type index) const noexcept
 Returns the type of the i-th argument of a data member's getter.
template<typename Type>
Type traits () const noexcept
 Returns all meta traits for a given meta object.
meta_custom custom () const noexcept
 Returns user defined data for a given meta object.
 meta_object () noexcept=default
 Default constructor.
 meta_object (const meta_ctx &area, const node_type &curr) noexcept
 Context aware constructor for meta objects.
Public Member Functions inherited from entt::meta_object< internal::meta_data_node >
 meta_object () noexcept=default
 Default constructor.
 operator bool () const noexcept
 Returns true if an object is valid, false otherwise.
bool operator== (const meta_object &other) const noexcept
 Checks if two objects refer to the same type.

Additional Inherited Members

Public Types inherited from entt::meta_object< internal::meta_data_node >
using node_type
 Underlying meta node type.
using size_type
 Unsigned integer type.

Detailed Description

Opaque wrapper for data members.

Definition at line 831 of file meta.hpp.

Member Function Documentation

◆ custom()

meta_custom entt::meta_data::custom ( ) const
inlinenodiscardnoexcept

Returns user defined data for a given meta object.

Returns
User defined arbitrary data.

Definition at line 930 of file meta.hpp.

◆ get()

template<typename Instance = meta_handle>
meta_any entt::meta_data::get ( Instance && instance,
auto &&... args ) const
inlinenodiscard

Gets the value of a given variable.

Template Parameters
InstanceType of instance to operate on.
Parameters
instanceAn instance that fits the underlying type.
argsParameters to use to get the underlying variable, if any.
Returns
A wrapper containing the value of the underlying variable.

Definition at line 898 of file meta.hpp.

◆ get_arg()

meta_type entt::meta_data::get_arg ( size_type index) const
inlinenodiscardnoexcept

Returns the type of the i-th argument of a data member's getter.

Parameters
indexIndex of the argument of which to return the type.
Returns
The type of the i-th argument of a data member's getter.

Definition at line 1556 of file meta.hpp.

◆ get_arity()

size_type entt::meta_data::get_arity ( ) const
inlinenodiscardnoexcept

Returns the number of arguments of a data member's getter.

Returns
The number of arguments accepted by the data member's getter.

Definition at line 854 of file meta.hpp.

◆ is_const()

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

Indicates whether a data member is constant or not.

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

Definition at line 862 of file meta.hpp.

◆ is_static()

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

Indicates whether a data member is static or not.

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

Definition at line 870 of file meta.hpp.

◆ meta_object()

entt::meta_object< Type >::meta_object ( const meta_ctx & area,
const node_type & curr )
inlinenoexcept

Context aware constructor for meta objects.

Parameters
areaThe context from which to search for meta types.
currThe underlying node with which to construct the instance.

Definition at line 808 of file meta.hpp.

◆ name()

stl::string_view entt::meta_data::name ( ) const
inlinenodiscardnoexcept

Returns the name assigned to a data member, if any.

Returns
The name assigned to the data member, if any.

Definition at line 838 of file meta.hpp.

◆ set()

template<typename Instance = meta_handle>
bool entt::meta_data::set ( Instance && instance,
auto &&... args ) const
inline

Sets the value of a given variable.

Template Parameters
InstanceType of instance to operate on.
Parameters
instanceAn instance that fits the underlying type.
argsParameters to use to set the underlying variable.
Returns
True in case of success, false otherwise.

Definition at line 886 of file meta.hpp.

◆ set_arg()

meta_type entt::meta_data::set_arg ( size_type index) const
inlinenodiscardnoexcept

Returns the type of the i-th argument of a data member's setter.

Parameters
indexIndex of the argument of which to return the type.
Returns
The type of the i-th argument of a data member's setter.

Definition at line 1552 of file meta.hpp.

◆ set_arity()

size_type entt::meta_data::set_arity ( ) const
inlinenodiscardnoexcept

Returns the number of arguments of a data member's setter.

Returns
The number of arguments accepted by the data member's setter.

Definition at line 846 of file meta.hpp.

◆ traits()

template<typename Type>
Type entt::meta_data::traits ( ) const
inlinenodiscardnoexcept

Returns all meta traits for a given meta object.

Template Parameters
TypeThe type to convert the meta traits to.
Returns
The registered meta traits, if any.

Definition at line 922 of file meta.hpp.

◆ type()

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

Returns the meta type associated with the contained instance.

Returns
The meta type associated with the contained instance.

Definition at line 1548 of file meta.hpp.


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