Clementine
|
Opaque wrapper for values of any type. More...
#include <entt.hpp>
Public Member Functions | |
meta_any () ENTT_NOEXCEPT | |
Default constructor. | |
template<typename Type , typename... Args> | |
meta_any (std::in_place_type_t< Type >, Args &&... args) | |
Constructs a meta any by directly initializing the new object. More... | |
template<typename Type > | |
meta_any (std::reference_wrapper< Type > value) | |
Constructs a meta any that holds an unmanaged object. More... | |
template<typename Type , typename = std::enable_if_t<!std::is_same_v<std::remove_cv_t<std::remove_reference_t<Type>>, meta_any>>> | |
meta_any (Type &&value) | |
Constructs a meta any from a given value. More... | |
meta_any (const meta_any &other)=default | |
Copy constructor. More... | |
meta_any (meta_any &&other) ENTT_NOEXCEPT | |
Move constructor. More... | |
~meta_any () | |
Frees the internal storage, whatever it means. | |
meta_any & | operator= (meta_any other) |
Assignment operator. 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... | |
template<typename... Args> | |
meta_any | invoke (const id_type id, Args &&... args) const |
Invokes the underlying function, if possible. More... | |
template<typename... Args> | |
meta_any | invoke (const id_type id, Args &&... args) |
Invokes the underlying function, if possible. More... | |
template<typename Type > | |
bool | set (const id_type id, Type &&value) |
Sets the value of a given variable. More... | |
meta_any | get (const id_type id) const |
Gets the value of a given variable. More... | |
meta_any | get (const id_type id) |
Gets the value of a given variable. More... | |
template<typename Type > | |
const Type * | try_cast () const |
Tries to cast an instance to a given type. More... | |
template<typename Type > | |
Type * | try_cast () |
Tries to cast an instance to a given type. More... | |
template<typename Type > | |
Type | cast () const |
Tries to cast an instance to a given type. More... | |
template<typename Type > | |
Type | cast () |
Tries to cast an instance to a given type. More... | |
template<typename Type > | |
meta_any | allow_cast () const |
Tries to make an instance castable to a certain type. More... | |
template<typename Type > | |
bool | allow_cast () |
Tries to make an instance castable to a certain type. More... | |
template<typename Type , typename... Args> | |
void | emplace (Args &&... args) |
Replaces the contained object by creating a new instance directly. More... | |
meta_sequence_container | as_sequence_container () ENTT_NOEXCEPT |
Returns a sequence container proxy. More... | |
meta_sequence_container | as_sequence_container () const ENTT_NOEXCEPT |
Returns a sequence container proxy. More... | |
meta_associative_container | as_associative_container () ENTT_NOEXCEPT |
Returns an associative container proxy. More... | |
meta_associative_container | as_associative_container () const ENTT_NOEXCEPT |
Returns an associative container proxy. More... | |
meta_any | operator* () ENTT_NOEXCEPT |
Indirection operator for dereferencing opaque objects. More... | |
meta_any | operator* () const ENTT_NOEXCEPT |
Indirection operator for dereferencing opaque objects. More... | |
operator bool () const ENTT_NOEXCEPT | |
Returns false if a wrapper is invalid, true otherwise. More... | |
bool | operator== (const meta_any &other) const |
Checks if two wrappers differ in their content. More... | |
Friends | |
void | swap (meta_any &lhs, meta_any &rhs) |
Swaps two meta any objects. More... | |
meta_any | as_ref (meta_any &other) ENTT_NOEXCEPT |
Aliasing constructor. More... | |
meta_any | as_ref (const meta_any &other) ENTT_NOEXCEPT |
Aliasing constructor. More... | |
Opaque wrapper for values of any type.
|
inlineexplicit |
Constructs a meta any by directly initializing the new object.
Type | Type of object to use to initialize the wrapper. |
Args | Types of arguments to use to construct the new instance. |
args | Parameters to use to construct the instance. |
|
inline |
Constructs a meta any that holds an unmanaged object.
Type | Type of object to use to initialize the wrapper. |
value | An instance of an object to use to initialize the wrapper. |
|
inline |
Constructs a meta any from a given value.
Type | Type of object to use to initialize the wrapper. |
value | An instance of an object to use to initialize the wrapper. |
|
default |
Copy constructor.
other | The instance to copy from. |
|
inline |
Move constructor.
other | The instance to move from. |
|
inline |
Tries to make an instance castable to a certain type.
Type | Type to which the cast is requested. |
|
inline |
Tries to make an instance castable to a certain type.
Type | Type to which the cast is requested. |
|
inline |
Returns an associative container proxy.
|
inline |
Returns an associative container proxy.
|
inline |
Returns a sequence container proxy.
|
inline |
Returns a sequence container proxy.
|
inline |
Tries to cast an instance to a given type.
The type of the instance must be such that the cast is possible.
Type | Type to which to cast the instance. |
|
inline |
Tries to cast an instance to a given type.
The type of the instance must be such that the cast is possible.
Type | Type to which to cast the instance. |
|
inline |
Returns an opaque pointer to the contained instance.
|
inline |
Returns an opaque pointer to the contained instance.
|
inline |
Replaces the contained object by creating a new instance directly.
Type | Type of object to use to initialize the wrapper. |
Args | Types of arguments to use to construct the new instance. |
args | Parameters to use to construct the instance. |
|
inline |
Gets the value of a given variable.
id | Unique identifier. |
|
inline |
Gets the value of a given variable.
id | Unique identifier. |
meta_any entt::meta_any::invoke | ( | const id_type | id, |
Args &&... | args | ||
) | const |
Invokes the underlying function, if possible.
Args | Types of arguments to use to invoke the function. |
id | Unique identifier. |
args | Parameters to use to invoke the function. |
meta_any entt::meta_any::invoke | ( | const id_type | id, |
Args &&... | args | ||
) |
Invokes the underlying function, if possible.
Args | Types of arguments to use to invoke the function. |
id | Unique identifier. |
args | Parameters to use to invoke the function. |
|
inlineexplicit |
Returns false if a wrapper is invalid, true otherwise.
|
inline |
Indirection operator for dereferencing opaque objects.
|
inline |
Indirection operator for dereferencing opaque objects.
Assignment operator.
other | The instance to assign from. |
|
inline |
Checks if two wrappers differ in their content.
other | Wrapper with which to compare. |
bool entt::meta_any::set | ( | const id_type | id, |
Type && | value | ||
) |
Sets the value of a given variable.
The type of the value must be such that a cast or conversion to the type of the variable is possible. Otherwise, invoking the setter does nothing.
Type | Type of value to assign. |
id | Unique identifier. |
value | Parameter to use to set the underlying variable. |
|
inline |
Tries to cast an instance to a given type.
Type | Type to which to cast the instance. |
|
inline |
Tries to cast an instance to a given type.
Type | Type to which to cast the instance. |
|
inline |
Returns the meta type of the underlying object.
Aliasing constructor.
other | A reference to an object that isn't necessarily initialized. |
Aliasing constructor.
other | A reference to an object that isn't necessarily initialized. |
Swaps two meta any objects.
lhs | A valid meta any object. |
rhs | A valid meta any object. |