OpenLexocad  27.1
entt::meta_ctor Struct Reference

Opaque container for meta constructors. More...

#include <entt.hpp>

Public Types

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

Public Member Functions

 meta_ctor (const internal::meta_ctor_node *curr=nullptr) ENTT_NOEXCEPT
 Constructs an instance from a given node. 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 constructor. More...
 
meta_type arg (size_type index) const ENTT_NOEXCEPT
 Returns the meta type of the i-th argument of a meta constructor. More...
 
template<typename... Args>
meta_any invoke (Args &&... args) const
 Creates an instance of the underlying type, 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 constructor. 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_ctor &other) const ENTT_NOEXCEPT
 Checks if two meta objects refer to the same node. More...
 

Detailed Description

Opaque container for meta constructors.

Member Typedef Documentation

◆ size_type

using entt::meta_ctor::size_type = typename internal::meta_ctor_node::size_type

Unsigned integer type.

Constructor & Destructor Documentation

◆ meta_ctor()

entt::meta_ctor::meta_ctor ( const internal::meta_ctor_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_ctor::arg ( size_type  index) const
inline

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

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 constructor, if any.

◆ invoke()

template<typename... Args>
meta_any entt::meta_ctor::invoke ( 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.

◆ operator bool()

entt::meta_ctor::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_ctor::operator== ( const meta_ctor 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_ctor::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_ctor::prop ( Op  op) const
inline

Iterates all the properties assigned to a meta constructor.

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

◆ prop() [2/2]

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

◆ size()

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

Returns the number of arguments accepted by a meta constructor.

Returns
The number of arguments accepted by the meta constructor.

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