OpenLexocad  27.1
entt::meta_func Struct Reference

Opaque container for meta functions. More...

#include <entt.hpp>

Public Types

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

Public Member Functions

 meta_func (const internal::meta_func_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...
 
meta_type parent () const ENTT_NOEXCEPT
 Returns the meta type to which a meta object belongs. More...
 
size_type size () const ENTT_NOEXCEPT
 Returns the number of arguments accepted by a meta function. More...
 
bool is_const () const ENTT_NOEXCEPT
 Indicates whether a given meta function is constant or not. More...
 
bool is_static () const ENTT_NOEXCEPT
 Indicates whether a given meta function is static or not. More...
 
meta_type ret () const ENTT_NOEXCEPT
 Returns the meta type of the return type of a meta function. More...
 
meta_type arg (size_type index) const ENTT_NOEXCEPT
 Returns the meta type of the i-th argument of a meta function. More...
 
template<typename... Args>
meta_any invoke (meta_handle handle, Args &&... args) const
 Invokes the underlying function, if possible. 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 function. 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_func &other) const ENTT_NOEXCEPT
 Checks if two meta objects refer to the same node. More...
 

Detailed Description

Opaque container for meta functions.

Member Typedef Documentation

◆ size_type

using entt::meta_func::size_type = typename internal::meta_func_node::size_type

Unsigned integer type.

Constructor & Destructor Documentation

◆ meta_func()

entt::meta_func::meta_func ( const internal::meta_func_node *  curr = nullptr)
inline

Constructs an instance from a given node.

Parameters
currThe underlying node with which to construct the instance.

Member Function Documentation

◆ arg()

meta_type entt::meta_func::arg ( size_type  index) const
inline

Returns the meta type of the i-th argument of a meta function.

Parameters
indexThe index of the argument of which to return the meta type.
Returns
The meta type of the i-th argument of a meta function, if any.

◆ identifier()

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

Returns the identifier assigned to a given meta object.

Returns
The identifier assigned to the meta object.

◆ invoke()

template<typename... Args>
meta_any entt::meta_func::invoke ( meta_handle  handle,
Args &&...  args 
) const
inline

Invokes the underlying function, if possible.

To invoke a meta function, the types of the parameters must coincide exactly with those required by the underlying function. Otherwise, an empty and then invalid container is returned.
It must be possible to cast the instance to the parent type of the meta function. Otherwise, invoking the underlying function results in an undefined behavior.

Template Parameters
ArgsTypes of arguments to use to invoke the function.
Parameters
handleAn opaque pointer to an instance of the underlying type.
argsParameters to use to invoke the function.
Returns
A meta any containing the returned value, if any.

◆ is_const()

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

Indicates whether a given meta function is constant or not.

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

◆ is_static()

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

Indicates whether a given meta function is static or not.

A static meta function is such that it can be invoked using a null pointer as an instance.

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

◆ operator bool()

entt::meta_func::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_func::operator== ( const meta_func 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.

◆ parent()

meta_type entt::meta_func::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]

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

Iterates all the properties assigned to a meta function.

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

◆ prop() [2/2]

meta_prop entt::meta_func::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.

◆ ret()

meta_type entt::meta_func::ret ( ) const
inline

Returns the meta type of the return type of a meta function.

Returns
The meta type of the return type of the meta function.

◆ size()

size_type entt::meta_func::size ( ) const
inline

Returns the number of arguments accepted by a meta function.

Returns
The number of arguments accepted by the meta function.

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