OpenLexocad  27.1
entt::meta_handle Class Reference

Opaque pointers to instances of any type. More...

#include <entt.hpp>

Public Member Functions

 meta_handle () ENTT_NOEXCEPT
 Default constructor. More...
 
 meta_handle (meta_any &any) ENTT_NOEXCEPT
 Constructs a meta handle from a meta any object. More...
 
template<typename Type , typename = std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, meta_handle>>>
 meta_handle (Type &obj) ENTT_NOEXCEPT
 Constructs a meta handle from a given instance. More...
 
meta_type type () const ENTT_NOEXCEPT
 Returns the meta type of the underlying object. More...
 
const void * data () const ENTT_NOEXCEPT
 Returns an opaque pointer to the contained instance. More...
 
void * data () ENTT_NOEXCEPT
 Returns an opaque pointer to the contained instance. More...
 
 operator bool () const ENTT_NOEXCEPT
 Returns false if a handle is empty, true otherwise. More...
 

Friends

class meta_any
 A meta any is allowed to inherit from a meta handle. More...
 

Detailed Description

Opaque pointers to instances of any type.

A handle doesn't perform copies and isn't responsible for the contained object. It doesn't prolong the lifetime of the pointed instance. Users are responsible for ensuring that the target object remains alive for the entire interval of use of the handle.

Constructor & Destructor Documentation

◆ meta_handle() [1/3]

entt::meta_handle::meta_handle ( )
inline

Default constructor.

◆ meta_handle() [2/3]

entt::meta_handle::meta_handle ( meta_any any)
inline

Constructs a meta handle from a meta any object.

Parameters
anyA reference to an object to use to initialize the handle.

◆ meta_handle() [3/3]

template<typename Type , typename = std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, meta_handle>>>
entt::meta_handle::meta_handle ( Type &  obj)
inline

Constructs a meta handle from a given instance.

Template Parameters
TypeType of object to use to initialize the handle.
Parameters
objA reference to an object to use to initialize the handle.

Member Function Documentation

◆ data() [1/2]

const void* entt::meta_handle::data ( ) const
inline

Returns an opaque pointer to the contained instance.

Returns
An opaque pointer the contained instance, if any.

◆ data() [2/2]

void* entt::meta_handle::data ( )
inline

Returns an opaque pointer to the contained instance.

Returns
An opaque pointer the contained instance, if any.

◆ operator bool()

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

Returns false if a handle is empty, true otherwise.

Returns
False if the handle is empty, true otherwise.

◆ type()

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

Returns the meta type of the underlying object.

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

Friends And Related Function Documentation

◆ meta_any

friend class meta_any
friend

A meta any is allowed to inherit from a meta handle.


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