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

Opaque wrapper for meta data. More...

#include <entt.hpp>

Public Types

using node_type = internal::meta_data_node
 Node type.
 

Public Member Functions

 meta_data (const node_type *curr=nullptr) ENTT_NOEXCEPT
 Constructs an instance from a given node. More...
 
id_type id () const ENTT_NOEXCEPT
 Returns the identifier assigned to a meta object. More...
 
meta_type parent () const ENTT_NOEXCEPT
 Returns the meta type to which a meta object belongs. More...
 
bool is_const () const ENTT_NOEXCEPT
 Indicates whether a meta data is constant or not. More...
 
bool is_static () const ENTT_NOEXCEPT
 Indicates whether a meta data is static or not. More...
 
meta_type type () const ENTT_NOEXCEPT
 Returns the meta type of the underlying object. 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_range< meta_propprop () const ENTT_NOEXCEPT
 Returns a range to use to visit all 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...
 

Detailed Description

Opaque wrapper for meta data.

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.

Member Function Documentation

◆ 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 meta data. Otherwise, invoking the getter results in an undefined behavior.

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

◆ id()

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

Returns the identifier assigned to a meta object.

Returns
The identifier assigned to the meta object.

◆ is_const()

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

Indicates whether a meta data is constant or not.

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

◆ is_static()

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

Indicates whether a meta data is static or not.

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

◆ operator bool()

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

Returns true if a meta object is valid, false otherwise.

Returns
True if the meta object is valid, false otherwise.

◆ parent()

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

Returns the meta type to which a meta object belongs.

Returns
The meta type to which the meta object belongs.

◆ prop() [1/2]

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

Returns a range to use to visit all meta properties.

Returns
An iterable range to use to visit all meta properties.

◆ prop() [2/2]

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

Returns the property associated with a given key.

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

◆ 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 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.

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.

◆ type()

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

Returns the meta type of the underlying object.

Returns
The meta type of the underlying object, if any.

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