OpenLexocad
27.0
|
Opaque container for values of any type. More...
#include <entt.hpp>
Public Member Functions | |
meta_any () ENTT_NOEXCEPT | |
Default constructor. More... | |
template<typename Type , typename... Args> | |
meta_any (std::in_place_type_t< Type >, [[maybe_unused]] Args &&... args) | |
Constructs a meta any by directly initializing the new object. More... | |
template<typename Type > | |
meta_any (std::reference_wrapper< Type > type) | |
Constructs a meta any that holds an unmanaged object. More... | |
meta_any (meta_handle handle) ENTT_NOEXCEPT | |
Constructs a meta any from a meta handle 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 &&type) | |
Constructs a meta any from a given value. More... | |
meta_any (const meta_any &other) | |
Copy constructor. More... | |
meta_any (meta_any &&other) ENTT_NOEXCEPT | |
Move constructor. More... | |
~meta_any () | |
Frees the internal storage, whatever it means. 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 & | operator= (Type &&type) |
Assignment operator. More... | |
meta_any & | operator= (const meta_any &other) |
Copy assignment operator. More... | |
meta_any & | operator= (meta_any &&other) ENTT_NOEXCEPT |
Move 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 Type > | |
const Type * | try_cast () const ENTT_NOEXCEPT |
Tries to cast an instance to a given type. More... | |
template<typename Type > | |
Type * | try_cast () ENTT_NOEXCEPT |
Tries to cast an instance to a given type. More... | |
template<typename Type > | |
const Type & | cast () const ENTT_NOEXCEPT |
Tries to cast an instance to a given type. More... | |
template<typename Type > | |
Type & | cast () ENTT_NOEXCEPT |
Tries to cast an instance to a given type. More... | |
template<typename Type > | |
meta_any | convert () const |
Tries to convert an instance to a given type and returns it. More... | |
template<typename Type > | |
bool | convert () |
Tries to convert an instance to a given type. More... | |
template<typename Type , typename... Args> | |
void | emplace (Args &&... args) |
Replaces the contained object by initializing a new instance directly. More... | |
operator bool () const ENTT_NOEXCEPT | |
Returns false if a container is empty, true otherwise. More... | |
bool | operator== (const meta_any &other) const ENTT_NOEXCEPT |
Checks if two containers differ in their content. More... | |
Friends | |
class | meta_handle |
A meta handle is allowed to inherit from a meta any. More... | |
void | swap (meta_any &lhs, meta_any &rhs) ENTT_NOEXCEPT |
Swaps two meta any objects. More... | |
Opaque container for values of any type.
TURN_OFF_DOXYGENThis class uses a technique called small buffer optimization (SBO) to completely eliminate the need to allocate memory, where possible.
From the user's point of view, nothing will change, but the elimination of allocations will reduce the jumps in memory and therefore will avoid chasing of pointers. This will greatly improve the use of the cache, thus increasing the overall performance.
|
inline |
Default constructor.
|
inlineexplicit |
Constructs a meta any by directly initializing the new object.
Type | Type of object to use to initialize the container. |
Args | Types of arguments to use to construct the new instance. |
args | Parameters to use to construct the instance. |
|
inlineexplicit |
Constructs a meta any that holds an unmanaged object.
Type | Type of object to use to initialize the container. |
type | An instance of an object to use to initialize the container. |
|
inline |
Constructs a meta any from a meta handle object.
handle | A reference to an object to use to initialize the meta any. |
|
inline |
Constructs a meta any from a given value.
Type | Type of object to use to initialize the container. |
type | An instance of an object to use to initialize the container. |
|
inline |
Copy constructor.
other | The instance to copy from. |
|
inline |
Move constructor.
After meta any move construction, instances that have been moved from are placed in a valid but unspecified state. It's highly discouraged to continue using them.
other | The instance to move from. |
|
inline |
Frees the internal storage, whatever it means.
|
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 |
Tries to convert an instance to a given type and returns it.
Type | Type to which to convert the instance. |
|
inline |
Tries to convert an instance to a given type.
Type | Type to which to convert 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 initializing a new instance directly.
Type | Type of object to use to initialize the container. |
Args | Types of arguments to use to construct the new instance. |
args | Parameters to use to construct the instance. |
|
inlineexplicit |
Returns false if a container is empty, true otherwise.
|
inline |
Assignment operator.
Type | Type of object to use to initialize the container. |
type | An instance of an object to use to initialize the container. |
Copy assignment operator.
other | The instance to assign. |
Move assignment operator.
other | The instance to assign. |
|
inline |
Checks if two containers differ in their content.
other | Container with which to compare. |
|
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.
|
friend |
A meta handle is allowed to inherit from a meta any.
Swaps two meta any objects.
lhs | A valid meta any object. |
rhs | A valid meta any object. |