OpenLexocad  27.1
entt::meta_type Class Reference

Opaque container for meta types. More...

#include <entt.hpp>

Public Types

using size_type = typename internal::meta_type_node::size_type
 Unsigned integer type. More...
 

Public Member Functions

 meta_type (const internal::meta_type_node *curr=nullptr) ENTT_NOEXCEPT
 Constructs an instance from a given node. More...
 
ENTT_ID_TYPE identifier () const ENTT_NOEXCEPT
 Returns the identifier assigned to a given meta object. More...
 
bool is_void () const ENTT_NOEXCEPT
 Indicates whether a given meta type refers to void or not. More...
 
bool is_integral () const ENTT_NOEXCEPT
 Indicates whether a given meta type refers to an integral type or not. More...
 
bool is_floating_point () const ENTT_NOEXCEPT
 Indicates whether a given meta type refers to a floating-point type or not. More...
 
bool is_array () const ENTT_NOEXCEPT
 Indicates whether a given meta type refers to an array type or not. More...
 
bool is_enum () const ENTT_NOEXCEPT
 Indicates whether a given meta type refers to an enum or not. More...
 
bool is_union () const ENTT_NOEXCEPT
 Indicates whether a given meta type refers to an union or not. More...
 
bool is_class () const ENTT_NOEXCEPT
 Indicates whether a given meta type refers to a class or not. More...
 
bool is_pointer () const ENTT_NOEXCEPT
 Indicates whether a given meta type refers to a pointer or not. More...
 
bool is_function_pointer () const ENTT_NOEXCEPT
 Indicates whether a given meta type refers to a function pointer or not. More...
 
bool is_member_object_pointer () const ENTT_NOEXCEPT
 Indicates whether a given meta type refers to a pointer to data member or not. More...
 
bool is_member_function_pointer () const ENTT_NOEXCEPT
 Indicates whether a given meta type refers to a pointer to member function or not. More...
 
size_type extent () const ENTT_NOEXCEPT
 If a given meta type refers to an array type, provides the number of elements of the array. More...
 
meta_type remove_pointer () const ENTT_NOEXCEPT
 Provides the meta type for which the pointer is defined. More...
 
meta_type remove_extent () const ENTT_NOEXCEPT
 Provides the meta type for which the array is defined. More...
 
template<typename Op >
std::enable_if_t< std::is_invocable_v< Op, meta_base >, void > base (Op op) const ENTT_NOEXCEPT
 Iterates all the meta base of a meta type. More...
 
meta_base base (const ENTT_ID_TYPE identifier) const ENTT_NOEXCEPT
 Returns the meta base associated with a given identifier. More...
 
template<typename Op >
void conv (Op op) const ENTT_NOEXCEPT
 Iterates all the meta conversion functions of a meta type. More...
 
template<typename Type >
meta_conv conv () const ENTT_NOEXCEPT
 Returns the meta conversion function associated with a given type. More...
 
template<typename Op >
void ctor (Op op) const ENTT_NOEXCEPT
 Iterates all the meta constructors of a meta type. More...
 
template<typename... Args>
meta_ctor ctor () const ENTT_NOEXCEPT
 Returns the meta constructor that accepts a given list of types of arguments. More...
 
meta_dtor dtor () const ENTT_NOEXCEPT
 Returns the meta destructor associated with a given type. More...
 
template<typename Op >
std::enable_if_t< std::is_invocable_v< Op, meta_data >, void > data (Op op) const ENTT_NOEXCEPT
 Iterates all the meta data of a meta type. More...
 
meta_data data (const ENTT_ID_TYPE identifier) const ENTT_NOEXCEPT
 Returns the meta data associated with a given identifier. More...
 
template<typename Op >
std::enable_if_t< std::is_invocable_v< Op, meta_func >, void > func (Op op) const ENTT_NOEXCEPT
 Iterates all the meta functions of a meta type. More...
 
meta_func func (const ENTT_ID_TYPE identifier) const ENTT_NOEXCEPT
 Returns the meta function associated with a given identifier. More...
 
template<typename... Args>
meta_any construct (Args &&... args) const
 Creates an instance of the underlying type, if possible. More...
 
bool destroy (meta_handle handle) const
 Destroys an instance of the underlying type. More...
 
template<typename Op >
std::enable_if_t< std::is_invocable_v< Op, meta_prop >, void > prop (Op op) const ENTT_NOEXCEPT
 Iterates all the properties assigned to a meta type. More...
 
meta_prop prop (meta_any key) const ENTT_NOEXCEPT
 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...
 
bool operator== (const meta_type &other) const ENTT_NOEXCEPT
 Checks if two meta objects refer to the same node. More...
 

Detailed Description

Opaque container for meta types.

Member Typedef Documentation

◆ size_type

using entt::meta_type::size_type = typename internal::meta_type_node::size_type

Unsigned integer type.

Constructor & Destructor Documentation

◆ meta_type()

entt::meta_type::meta_type ( const internal::meta_type_node *  curr = nullptr)
inline

Constructs an instance from a given node.

Parameters
currThe underlying node with which to construct the instance.

Member Function Documentation

◆ base() [1/2]

template<typename Op >
std::enable_if_t<std::is_invocable_v<Op, meta_base>, void> entt::meta_type::base ( Op  op) const
inline

Iterates all the meta base of a meta type.

Iteratively returns all the base classes of the given type.

Template Parameters
OpType of the function object to invoke.
Parameters
opA valid function object.

◆ base() [2/2]

meta_base entt::meta_type::base ( const ENTT_ID_TYPE  identifier) const
inline

Returns the meta base associated with a given identifier.

Searches recursively among all the base classes of the given type.

Parameters
identifierUnique identifier.
Returns
The meta base associated with the given identifier, if any.

◆ construct()

template<typename... Args>
meta_any entt::meta_type::construct ( Args &&...  args) const
inline

Creates an instance of the underlying type, if possible.

To create a valid instance, the types of the parameters must coincide exactly with those required by the underlying meta constructor. Otherwise, an empty and then invalid container is returned.

Template Parameters
ArgsTypes of arguments to use to construct the instance.
Parameters
argsParameters to use to construct the instance.
Returns
A meta any containing the new instance, if any.

◆ conv() [1/2]

template<typename Op >
void entt::meta_type::conv ( Op  op) const
inline

Iterates all the meta conversion functions of a meta type.

Iteratively returns all the meta conversion functions of the given type.

Template Parameters
OpType of the function object to invoke.
Parameters
opA valid function object.

◆ conv() [2/2]

template<typename Type >
meta_conv entt::meta_type::conv ( ) const
inline

Returns the meta conversion function associated with a given type.

Searches recursively among all the conversion functions of the given type.

Template Parameters
TypeThe type to use to search for a meta conversion function.
Returns
The meta conversion function associated with the given type, if any.

◆ ctor() [1/2]

template<typename Op >
void entt::meta_type::ctor ( Op  op) const
inline

Iterates all the meta constructors of a meta type.

Template Parameters
OpType of the function object to invoke.
Parameters
opA valid function object.

◆ ctor() [2/2]

template<typename... Args>
meta_ctor entt::meta_type::ctor ( ) const
inline

Returns the meta constructor that accepts a given list of types of arguments.

Returns
The requested meta constructor, if any.

◆ data() [1/2]

template<typename Op >
std::enable_if_t<std::is_invocable_v<Op, meta_data>, void> entt::meta_type::data ( Op  op) const
inline

Iterates all the meta data of a meta type.

Iteratively returns all the meta data of the given type. This means that the meta data of the base classes will also be returned, if any.

Template Parameters
OpType of the function object to invoke.
Parameters
opA valid function object.

◆ data() [2/2]

meta_data entt::meta_type::data ( const ENTT_ID_TYPE  identifier) const
inline

Returns the meta data associated with a given identifier.

Searches recursively among all the meta data of the given type. This means that the meta data of the base classes will also be inspected, if any.

Parameters
identifierUnique identifier.
Returns
The meta data associated with the given identifier, if any.

◆ destroy()

bool entt::meta_type::destroy ( meta_handle  handle) const
inline

Destroys an instance of the underlying type.

It must be possible to cast the instance to the underlying type. Otherwise, invoking the meta destructor results in an undefined behavior.
If no destructor has been set, this function returns true without doing anything.

Parameters
handleAn opaque pointer to an instance of the underlying type.
Returns
True in case of success, false otherwise.

◆ dtor()

meta_dtor entt::meta_type::dtor ( ) const
inline

Returns the meta destructor associated with a given type.

Returns
The meta destructor associated with the given type, if any.

◆ extent()

size_type entt::meta_type::extent ( ) const
inline

If a given meta type refers to an array type, provides the number of elements of the array.

Returns
The number of elements of the array if the underlying type is an array type, 0 otherwise.

◆ func() [1/2]

template<typename Op >
std::enable_if_t<std::is_invocable_v<Op, meta_func>, void> entt::meta_type::func ( Op  op) const
inline

Iterates all the meta functions of a meta type.

Iteratively returns all the meta functions of the given type. This means that the meta functions of the base classes will also be returned, if any.

Template Parameters
OpType of the function object to invoke.
Parameters
opA valid function object.

◆ func() [2/2]

meta_func entt::meta_type::func ( const ENTT_ID_TYPE  identifier) const
inline

Returns the meta function associated with a given identifier.

Searches recursively among all the meta functions of the given type. This means that the meta functions of the base classes will also be inspected, if any.

Parameters
identifierUnique identifier.
Returns
The meta function associated with the given identifier, if any.

◆ identifier()

ENTT_ID_TYPE entt::meta_type::identifier ( ) const
inline

Returns the identifier assigned to a given meta object.

Returns
The identifier assigned to the meta object.

◆ is_array()

bool entt::meta_type::is_array ( ) const
inline

Indicates whether a given meta type refers to an array type or not.

Returns
True if the underlying type is an array type, false otherwise.

◆ is_class()

bool entt::meta_type::is_class ( ) const
inline

Indicates whether a given meta type refers to a class or not.

Returns
True if the underlying type is a class, false otherwise.

◆ is_enum()

bool entt::meta_type::is_enum ( ) const
inline

Indicates whether a given meta type refers to an enum or not.

Returns
True if the underlying type is an enum, false otherwise.

◆ is_floating_point()

bool entt::meta_type::is_floating_point ( ) const
inline

Indicates whether a given meta type refers to a floating-point type or not.

Returns
True if the underlying type is a floating-point type, false otherwise.

◆ is_function_pointer()

bool entt::meta_type::is_function_pointer ( ) const
inline

Indicates whether a given meta type refers to a function pointer or not.

Returns
True if the underlying type is a function pointer, false otherwise.

◆ is_integral()

bool entt::meta_type::is_integral ( ) const
inline

Indicates whether a given meta type refers to an integral type or not.

Returns
True if the underlying type is an integral type, false otherwise.

◆ is_member_function_pointer()

bool entt::meta_type::is_member_function_pointer ( ) const
inline

Indicates whether a given meta type refers to a pointer to member function or not.

Returns
True if the underlying type is a pointer to member function, false otherwise.

◆ is_member_object_pointer()

bool entt::meta_type::is_member_object_pointer ( ) const
inline

Indicates whether a given meta type refers to a pointer to data member or not.

Returns
True if the underlying type is a pointer to data member, false otherwise.

◆ is_pointer()

bool entt::meta_type::is_pointer ( ) const
inline

Indicates whether a given meta type refers to a pointer or not.

Returns
True if the underlying type is a pointer, false otherwise.

◆ is_union()

bool entt::meta_type::is_union ( ) const
inline

Indicates whether a given meta type refers to an union or not.

Returns
True if the underlying type is an union, false otherwise.

◆ is_void()

bool entt::meta_type::is_void ( ) const
inline

Indicates whether a given meta type refers to void or not.

Returns
True if the underlying type is void, false otherwise.

◆ operator bool()

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

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

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

◆ operator==()

bool entt::meta_type::operator== ( const meta_type other) const
inline

Checks if two meta objects refer to the same node.

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

◆ prop() [1/2]

template<typename Op >
std::enable_if_t<std::is_invocable_v<Op, meta_prop>, void> entt::meta_type::prop ( Op  op) const
inline

Iterates all the properties assigned to a meta type.

Iteratively returns all the properties of the given type. This means that the properties of the base classes will also be returned, if any.

Template Parameters
OpType of the function object to invoke.
Parameters
opA valid function object.

◆ prop() [2/2]

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

Returns the property associated with a given key.

Searches recursively among all the properties of the given type. This means that the properties of the base classes will also be inspected, if any.

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

◆ remove_extent()

meta_type entt::meta_type::remove_extent ( ) const
inline

Provides the meta type for which the array is defined.

Returns
The meta type for which the array is defined or this meta type if it doesn't refer to an array type.

◆ remove_pointer()

meta_type entt::meta_type::remove_pointer ( ) const
inline

Provides the meta type for which the pointer is defined.

Returns
The meta type for which the pointer is defined or this meta type if it doesn't refer to a pointer type.

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