EnTT: entt::meta_data Class Reference

EnTT 3.16.0

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
entt::meta_data Class 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
| Default constructor.
| meta_data (const meta_ctx &area, const internal::meta_data_node &curr) noexcept
| Context aware constructor for meta objects.
const char * | name () const noexcept
| Returns the name assigned to a data member, if any.
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 info if any, type_id<void>() otherwise.
template<typename Instance = meta_handle, typename Type>
bool | set (Instance &&instance, Type &&value) const
| Sets the value of a given variable.
template<typename Instance = meta_handle>
meta_any | get (Instance &&instance) const
| Gets the value of a given variable.
meta_type | arg (size_type index) const noexcept
| Returns the type accepted by the i-th setter.
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.
| 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 785 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 793 of file meta.hpp.

## Constructor & Destructor Documentation

## ◆ meta_data()

entt::meta_data::meta_data | ( | const meta_ctx & | area,
|  | const internal::meta_data_node & | curr )
| inlinenoexcept

Context aware constructor for meta objects.

Parameters

  area | The context from which to search for meta types.
  curr | The underlying node with which to construct the instance.

Definition at line 803 of file meta.hpp.

## Member Function Documentation

## ◆ arg()

meta_type entt::meta_data::arg | ( | size_type | index | ) | const
| inlinenodiscardnoexcept

Returns the type accepted by the i-th setter.

Parameters

  index | Index of the setter of which to return the accepted type.

Returns
  The type accepted by the i-th setter.

Definition at line 1623 of file meta.hpp.

## ◆ arity()

size_type entt::meta_data::arity | ( |  | ) | const
| inlinenodiscardnoexcept

Returns the number of setters available.

Returns
  The number of setters available.

Definition at line 819 of file meta.hpp.

## ◆ 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 888 of file meta.hpp.

## ◆ get()

template<typename Instance = meta_handle>

meta_any entt::meta_data::get | ( | Instance && | instance | ) | const
| inlinenodiscard

Gets the value of a given variable.

Template Parameters

  Instance | Type of instance to operate on.

Parameters

  instance | An instance that fits the underlying type.

Returns
  A wrapper containing the value of the underlying variable.

Definition at line 863 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 827 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 835 of file meta.hpp.

## ◆ name()

const char * 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 811 of file meta.hpp.

## ◆ operator bool()

entt::meta_data::operator bool | ( |  | ) | const
| inlineexplicitnodiscardnoexcept

Returns true if an object is valid, false otherwise.

Returns
  True if the object is valid, false otherwise.

Definition at line 896 of file meta.hpp.

## ◆ operator==()

bool entt::meta_data::operator== | ( | const meta_data & | other | ) | const
| inlinenodiscardnoexcept

Checks if two objects refer to the same type.

Parameters

  other | The object with which to compare.

Returns
  True if the objects refer to the same type, false otherwise.

Definition at line 905 of file meta.hpp.

## ◆ set()

template<typename Instance = meta_handle, typename Type>

bool entt::meta_data::set | ( | Instance && | instance,
|  | Type && | value ) const
| inline

Sets the value of a given variable.

Template Parameters

  Instance | Type of instance to operate on.
  Type | Type of value to assign.

Parameters

  instance | An instance that fits the underlying type.
  value | Parameter to use to set the underlying variable.

Returns
  True in case of success, false otherwise.

Definition at line 852 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

  Type | The type to convert the meta traits to.

Returns
  The registered meta traits, if any.

Definition at line 880 of file meta.hpp.

## ◆ type()

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

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

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

Definition at line 1619 of file meta.hpp.

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

- src/entt/meta/meta.hpp