OpenLexocad
28.0
|
A meta factory to be used for reflection purposes. More...
#include <entt.hpp>
Public Member Functions | |
auto | type (const ENTT_ID_TYPE identifier) ENTT_NOEXCEPT |
Extends a meta type by assigning it an identifier. More... | |
auto | type () ENTT_NOEXCEPT |
Extends a meta type by assigning it an identifier. More... | |
template<typename Base > | |
auto | base () ENTT_NOEXCEPT |
Assigns a meta base to a meta type. More... | |
template<typename To > | |
auto | conv () ENTT_NOEXCEPT |
Assigns a meta conversion function to a meta type. More... | |
template<auto Candidate> | |
auto | conv () ENTT_NOEXCEPT |
Assigns a meta conversion function to a meta type. More... | |
template<auto Func, typename Policy = as_is_t> | |
auto | ctor () ENTT_NOEXCEPT |
Assigns a meta constructor to a meta type. More... | |
template<typename... Args> | |
auto | ctor () ENTT_NOEXCEPT |
Assigns a meta constructor to a meta type. More... | |
template<auto Func> | |
auto | dtor () ENTT_NOEXCEPT |
Assigns a meta destructor to a meta type. More... | |
template<auto Data, typename Policy = as_is_t> | |
auto | data (const ENTT_ID_TYPE identifier) ENTT_NOEXCEPT |
Assigns a meta data to a meta type. More... | |
template<auto Setter, auto Getter, typename Policy = as_is_t> | |
auto | data (const ENTT_ID_TYPE identifier) ENTT_NOEXCEPT |
Assigns a meta data to a meta type by means of its setter and getter. More... | |
template<auto Candidate, typename Policy = as_is_t> | |
auto | func (const ENTT_ID_TYPE identifier) ENTT_NOEXCEPT |
Assigns a meta funcion to a meta type. More... | |
void | reset () ENTT_NOEXCEPT |
Resets a meta type and all its parts. More... | |
A meta factory to be used for reflection purposes.
A meta factory is an utility class used to reflect types, data and functions of all sorts. This class ensures that the underlying web of types is built correctly and performs some checks in debug mode to ensure that there are no subtle errors at runtime.
Type | Reflected type for which the factory was created. |
Assigns a meta base to a meta type.
A reflected base class must be a real base class of the reflected type.
Base | Type of the base class to assign to the meta type. |
Assigns a meta conversion function to a meta type.
The given type must be such that an instance of the reflected type can be converted to it.
To | Type of the conversion function to assign to the meta type. |
Assigns a meta conversion function to a meta type.
Conversion functions can be either free functions or member functions.
In case of free functions, they must accept a const reference to an instance of the parent type as an argument. In case of member functions, they should have no arguments at all.
Candidate | The actual function to use for the conversion. |
|
inline |
Assigns a meta constructor to a meta type.
Free functions can be assigned to meta types in the role of constructors. All that is required is that they return an instance of the underlying type.
From a client's point of view, nothing changes if a constructor of a meta type is a built-in one or a free function.
Func | The actual function to use as a constructor. |
Policy | Optional policy (no policy set by default). |
|
inline |
Assigns a meta constructor to a meta type.
A meta constructor is uniquely identified by the types of its arguments and is such that there exists an actual constructor of the underlying type that can be invoked with parameters whose types are those given.
Args | Types of arguments to use to construct an instance. |
|
inline |
Assigns a meta data to a meta type.
Both data members and static and global variables, as well as constants of any kind, can be assigned to a meta type.
From a client's point of view, all the variables associated with the reflected object will appear as if they were part of the type itself.
Data | The actual variable to attach to the meta type. |
Policy | Optional policy (no policy set by default). |
identifier | Unique identifier. |
|
inline |
Assigns a meta data to a meta type by means of its setter and getter.
Setters and getters can be either free functions, member functions or a mix of them.
In case of free functions, setters and getters must accept a reference to an instance of the parent type as their first argument. A setter has then an extra argument of a type convertible to that of the parameter to set.
In case of member functions, getters have no arguments at all, while setters has an argument of a type convertible to that of the parameter to set.
Setter | The actual function to use as a setter. |
Getter | The actual function to use as a getter. |
Policy | Optional policy (no policy set by default). |
identifier | Unique identifier. |
Assigns a meta destructor to a meta type.
Free functions can be assigned to meta types in the role of destructors. The signature of the function should identical to the following:
The purpose is to give users the ability to free up resources that require special treatment before an object is actually destroyed.
Func | The actual function to use as a destructor. |
|
inline |
Assigns a meta funcion to a meta type.
Both member functions and free functions can be assigned to a meta type.
From a client's point of view, all the functions associated with the reflected object will appear as if they were part of the type itself.
Candidate | The actual function to attach to the meta type. |
Policy | Optional policy (no policy set by default). |
identifier | Unique identifier. |
|
inline |
Resets a meta type and all its parts.
This function resets a meta type and all its data members, member functions and properties, as well as its constructors, destructors and conversion functions if any.
Base classes aren't reset but the link between the two types is removed.
|
inline |
Extends a meta type by assigning it an identifier.
This function is intended only for named types
|
inline |
Extends a meta type by assigning it an identifier.
This function is intended only for unnamed types.
identifier | Unique identifier. |