Meta factory to be used for reflection purposes.
More...
#include <factory.hpp>
|
| meta_factory () noexcept |
| Default constructor.
|
|
| meta_factory (meta_ctx &area) noexcept |
| Context aware constructor.
|
|
meta_factory | type (const id_type id) noexcept |
| Assigns a custom unique identifier to a meta type.
|
|
template<typename Base> |
meta_factory | base () noexcept |
| Assigns a meta base to a meta type.
|
|
template<auto Candidate> |
auto | conv () noexcept |
| Assigns a meta conversion function to a meta type.
|
|
template<typename To> |
meta_factory | conv () noexcept |
| Assigns a meta conversion function to a meta type.
|
|
template<auto Candidate, typename Policy = as_is_t> |
meta_factory | ctor () noexcept |
| Assigns a meta constructor to a meta type.
|
|
template<typename... Args> |
meta_factory | ctor () noexcept |
| Assigns a meta constructor to a meta type.
|
|
template<auto Func> |
meta_factory | dtor () noexcept |
| Assigns a meta destructor to a meta type.
|
|
template<auto Data, typename Policy = as_is_t> |
meta_factory | data (const id_type id) noexcept |
| Assigns a meta data to a meta type.
|
|
template<auto Setter, auto Getter, typename Policy = as_is_t> |
meta_factory | data (const id_type id) noexcept |
| Assigns a meta data to a meta type by means of its setter and getter.
|
|
template<typename Setter, auto Getter, typename Policy = as_is_t> |
meta_factory | data (const id_type id) noexcept |
| Assigns a meta data to a meta type by means of its setters and getter.
|
|
template<auto Candidate, typename Policy = as_is_t> |
meta_factory | func (const id_type id) noexcept |
| Assigns a meta function to a meta type.
|
|
template<typename Value> |
meta_factory | traits (const Value value) |
| Sets traits on the last created meta object.
|
|
template<typename Value, typename... Args> |
meta_factory | custom (Args &&...args) |
| Sets user defined data that will never be used by the library.
|
|
template<typename Type>
class entt::meta_factory< Type >
Meta factory to be used for reflection purposes.
- Template Parameters
-
Type | Reflected type for which the factory was created. |
Definition at line 150 of file factory.hpp.
◆ meta_factory() [1/2]
◆ meta_factory() [2/2]
Context aware constructor.
- Parameters
-
area | The context into which to construct meta types. |
Definition at line 181 of file factory.hpp.
◆ base()
template<typename Type>
template<typename Base>
Assigns a meta base to a meta type.
A reflected base class must be a real base class of the reflected type.
- Template Parameters
-
Base | Type of the base class to assign to the meta type. |
- Returns
- A meta factory for the parent type.
Definition at line 203 of file factory.hpp.
◆ conv() [1/2]
template<typename Type>
template<auto Candidate>
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.
- Template Parameters
-
Candidate | The actual function to use for the conversion. |
- Returns
- A meta factory for the parent type.
Definition at line 223 of file factory.hpp.
◆ conv() [2/2]
template<typename Type>
template<typename To>
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.
- Template Parameters
-
To | Type of the conversion function to assign to the meta type. |
- Returns
- A meta factory for the parent type.
Definition at line 240 of file factory.hpp.
◆ ctor() [1/2]
template<typename Type>
template<auto Candidate, typename Policy = as_is_t>
Assigns a meta constructor to a meta type.
Both member functions and free function 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 not.
- Template Parameters
-
Candidate | The actual function to use as a constructor. |
Policy | Optional policy (no policy set by default). |
- Returns
- A meta factory for the parent type.
Definition at line 261 of file factory.hpp.
◆ ctor() [2/2]
template<typename Type>
template<typename... Args>
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.
- Template Parameters
-
Args | Types of arguments to use to construct an instance. |
- Returns
- A meta factory for the parent type.
Definition at line 280 of file factory.hpp.
◆ custom()
template<typename Type>
template<typename Value, typename... Args>
Sets user defined data that will never be used by the library.
- Template Parameters
-
Value | Type of user defined data to store. |
Args | Types of arguments to use to construct the user data. |
- Parameters
-
args | Parameters to use to initialize the user data. |
- Returns
- A meta factory for the parent type.
Definition at line 500 of file factory.hpp.
◆ data() [1/3]
template<typename Type>
template<auto Data, typename Policy = as_is_t>
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.
- Template Parameters
-
Data | The actual variable to attach to the meta type. |
Policy | Optional policy (no policy set by default). |
- Parameters
-
- Returns
- A meta factory for the parent type.
Definition at line 330 of file factory.hpp.
◆ data() [2/3]
template<typename Type>
template<auto Setter, auto Getter, typename Policy = as_is_t>
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.
- Template Parameters
-
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). |
- Parameters
-
- Returns
- A meta factory for the parent type.
Definition at line 389 of file factory.hpp.
◆ data() [3/3]
template<typename Type>
template<typename Setter, auto Getter, typename Policy = as_is_t>
Assigns a meta data to a meta type by means of its setters and getter.
Multi-setter support for meta data members. All setters are tried in the order of definition before returning to the caller.
Setters can be either free functions, member functions or a mix of them and are provided via a value_list
type.
- See also
- data
- Template Parameters
-
Setter | The actual functions to use as setters. |
Getter | The actual getter function. |
Policy | Optional policy (no policy set by default). |
- Parameters
-
- Returns
- A meta factory for the parent type.
Definition at line 441 of file factory.hpp.
◆ dtor()
template<typename Type>
template<auto Func>
Assigns a meta destructor to a meta type.
Both free functions and member functions can be assigned to meta types in the role of destructors.
The signature of a free function should be identical to the following:
Member functions should not take arguments instead.
The purpose is to give users the ability to free up resources that require special treatment before an object is actually destroyed.
- Template Parameters
-
Func | The actual function to use as a destructor. |
- Returns
- A meta factory for the parent type.
Definition at line 309 of file factory.hpp.
◆ func()
template<typename Type>
template<auto Candidate, typename Policy = as_is_t>
Assigns a meta function 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.
- Template Parameters
-
Candidate | The actual function to attach to the meta type. |
Policy | Optional policy (no policy set by default). |
- Parameters
-
- Returns
- A meta factory for the parent type.
Definition at line 460 of file factory.hpp.
◆ traits()
template<typename Type>
template<typename Value>
Sets traits on the last created meta object.
The assigned value must be an enum and intended as a bitmask.
- Template Parameters
-
Value | Type of the traits value. |
- Parameters
-
- Returns
- A meta factory for the parent type.
Definition at line 486 of file factory.hpp.
◆ type()
Assigns a custom unique identifier to a meta type.
- Parameters
-
id | A custom unique identifier. |
- Returns
- A meta factory for the given type.
Definition at line 189 of file factory.hpp.
The documentation for this class was generated from the following file: