meta
1.4.9
|
A meta factory to be used for reflection purposes. More...
#include <factory.hpp>
Public Member Functions | |
factory () noexcept=default | |
Default constructor. | |
template<typename... Property> | |
factory | type (const std::size_t identifier, Property &&... property) noexcept |
Extends a meta type by assigning it an identifier and properties. More... | |
template<typename Base > | |
factory | base () noexcept |
Assigns a meta base to a meta type. More... | |
template<typename To > | |
factory | conv () noexcept |
Assigns a meta conversion function to a meta type. More... | |
template<auto Candidate> | |
factory | conv () noexcept |
Assigns a meta conversion function to a meta type. More... | |
template<auto Func, typename Policy = as_is_t, typename... Property> | |
factory | ctor (Property &&... property) noexcept |
Assigns a meta constructor to a meta type. More... | |
template<typename... Args, typename... Property> | |
factory | ctor (Property &&... property) noexcept |
Assigns a meta constructor to a meta type. More... | |
template<auto Func> | |
factory | dtor () noexcept |
Assigns a meta destructor to a meta type. More... | |
template<auto Data, typename Policy = as_is_t, typename... Property> | |
factory | data (const std::size_t identifier, Property &&... property) noexcept |
Assigns a meta data to a meta type. More... | |
template<auto Setter, auto Getter, typename Policy = as_is_t, typename... Property> | |
factory | data (const std::size_t identifier, Property &&... property) 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, typename... Property> | |
factory | func (const std::size_t identifier, Property &&... property) noexcept |
Assigns a meta funcion to a meta type. More... | |
bool | unregister () noexcept |
Unregisters a meta type and all its parts. More... | |
A meta factory to be used for reflection purposes.
TURN_OFF_DOXYGEN 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. |
Definition at line 249 of file factory.hpp.
|
inlinenoexcept |
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. |
Definition at line 358 of file factory.hpp.
|
inlinenoexcept |
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. |
Definition at line 393 of file factory.hpp.
|
inlinenoexcept |
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. |
Definition at line 431 of file factory.hpp.
|
inlinenoexcept |
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). |
Property | Types of properties to assign to the meta data. |
property | Properties to assign to the meta data. |
Definition at line 472 of file factory.hpp.
|
inlinenoexcept |
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. |
Property | Types of properties to assign to the meta data. |
property | Properties to assign to the meta data. |
Definition at line 514 of file factory.hpp.
|
inlinenoexcept |
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). |
Property | Types of properties to assign to the meta data. |
identifier | Unique identifier. |
property | Properties to assign to the meta data. |
Definition at line 604 of file factory.hpp.
|
inlinenoexcept |
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). |
Property | Types of properties to assign to the meta data. |
identifier | Unique identifier. |
property | Properties to assign to the meta data. |
Definition at line 707 of file factory.hpp.
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. |
Definition at line 559 of file factory.hpp.
|
inlinenoexcept |
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). |
Property | Types of properties to assign to the meta function. |
identifier | Unique identifier. |
property | Properties to assign to the meta function. |
Definition at line 756 of file factory.hpp.
|
inlinenoexcept |
Extends a meta type by assigning it an identifier and properties.
Property | Types of properties to assign to the meta type. |
identifier | Unique identifier. |
property | Properties to assign to the meta type. |
Definition at line 336 of file factory.hpp.
|
inlinenoexcept |
Unregisters a meta type and all its parts.
This function unregisters 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 unregistered but the link between the two types is removed.
Definition at line 802 of file factory.hpp.