EnTT 3.13.0
Loading...
Searching...
No Matches
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 size_type = typename internal::meta_data_node::size_type
 Unsigned integer type.
 

Public Member Functions

 meta_data () noexcept
 Default constructor.
 
 meta_data (const meta_ctx &area, const internal::meta_data_node &curr) noexcept
 Context aware constructor for meta objects.
 
size_type arity () const noexcept
 Returns the number of setters available.
 
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 object type if any, type_id<void>() otherwise.
 
template<typename Type >
bool set (meta_handle instance, Type &&value) const
 Sets the value of a given variable.
 
meta_any get (meta_handle instance) const
 Gets the value of a given variable.
 
meta_type arg (const size_type index) const noexcept
 Returns the type accepted by the i-th setter.
 
meta_range< meta_prop, typename decltype(internal::meta_data_node::prop)::const_iterator > prop () const noexcept
 Returns a range to visit registered meta properties.
 
meta_prop prop (const id_type key) const
 Lookup utility for meta properties.
 
 operator bool () const noexcept
 Returns true if an object is valid, false otherwise.
 
bool operator== (const meta_data &other) const noexcept
 Checks if two objects refer to the same type.
 

Detailed Description

Opaque wrapper for data members.

Definition at line 837 of file meta.hpp.

Member Typedef Documentation

◆ size_type

using entt::meta_data::size_type = typename internal::meta_data_node::size_type

Unsigned integer type.

Definition at line 839 of file meta.hpp.

Constructor & Destructor Documentation

◆ meta_data() [1/2]

entt::meta_data::meta_data ( )
inlinenoexcept

Default constructor.

Definition at line 842 of file meta.hpp.

◆ meta_data() [2/2]

entt::meta_data::meta_data ( const meta_ctx area,
const internal::meta_data_node &  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 851 of file meta.hpp.

Member Function Documentation

◆ arg()

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

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 1617 of file meta.hpp.

◆ arity()

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

Returns the number of setters available.

Returns
The number of setters available.

Definition at line 859 of file meta.hpp.

◆ get()

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

Gets the value of a given variable.

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

Definition at line 899 of file meta.hpp.

◆ is_const()

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

Indicates whether a data member is constant or not.

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

Definition at line 867 of file meta.hpp.

◆ is_static()

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

Indicates whether a data member is static or not.

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

Definition at line 875 of file meta.hpp.

◆ operator bool()

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

Returns true if an object is valid, false otherwise.

Returns
True if the object is valid, false otherwise.

Definition at line 932 of file meta.hpp.

◆ operator==()

bool entt::meta_data::operator== ( const meta_data other) const
inlinenoexcept

Checks if two objects refer to the same type.

Parameters
otherThe object with which to compare.
Returns
True if the objects refer to the same type, false otherwise.

Definition at line 937 of file meta.hpp.

◆ prop() [1/2]

meta_range< meta_prop, typename decltype(internal::meta_data_node::prop)::const_iterator > entt::meta_data::prop ( ) const
inlinenoexcept

Returns a range to visit registered meta properties.

Returns
An iterable range to visit registered meta properties.

Definition at line 914 of file meta.hpp.

◆ prop() [2/2]

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

Lookup utility for 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 923 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.

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 890 of file meta.hpp.

◆ type()

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

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

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

Definition at line 1613 of file meta.hpp.


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