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

Opaque wrapper for meta constructors. More...

#include <entt.hpp>

Public Types

using node_type = internal::meta_ctor_node
 Node type.
 
using size_type = typename node_type::size_type
 Unsigned integer type.
 

Public Member Functions

 meta_ctor (const node_type *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...
 
meta_any invoke (meta_any *const args, const size_type sz) const
 Creates an instance of the underlying type, if possible. More...
 
template<typename... Args>
meta_any invoke ([[maybe_unused]] Args &&... args) const
 Creates an instance of the underlying type, if possible. 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 constructors.

Constructor & Destructor Documentation

◆ meta_ctor()

entt::meta_ctor::meta_ctor ( 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

◆ 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() [1/2]

meta_any entt::meta_ctor::invoke ( meta_any *const  args,
const size_type  sz 
) const
inline

Creates an instance of the underlying type, if possible.

To create a valid instance, the parameters must be such that a cast or conversion to the required types is possible. Otherwise, an empty and thus invalid wrapper is returned.

Parameters
argsParameters to use to construct the instance.
szNumber of parameters to use to construct the instance.
Returns
A meta any containing the new instance, if any.

◆ invoke() [2/2]

template<typename... Args>
meta_any entt::meta_ctor::invoke ( [[maybe_unused] ] Args &&...  args) const
inline

Creates an instance of the underlying type, if possible.

See also
invoke
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.

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

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