rttr::registration::class_< Class_Type > Class Template Reference
The class_ is used to register classes to RTTR. More...
#include <registration.h>
Public Member Functions | |
class_ (string_view name) | |
Construct a class_ object with the given name name . More... | |
~class_ () | |
template<typename... Args, typename acc_level = detail::public_access, typename Tp = typename std::enable_if<detail::contains<acc_level, detail::access_levels_list>::value>::type> | |
bind< detail::ctor, Class_Type, acc_level, Args... > | constructor (acc_level level=acc_level()) |
Register a constructor for this class type with or without arguments. More... | |
template<typename F , typename acc_level = detail::public_access, typename Tp = typename std::enable_if<!detail::contains<F, detail::access_levels_list>::value>::type> | |
bind< detail::ctor_func, Class_Type, F, acc_level > | constructor (F func, acc_level level=acc_level()) |
Register a constructor for this class type which uses a function F . More... | |
template<typename Enum_Type > | |
bind< detail::enum_, Class_Type, Enum_Type > | enumeration (string_view name) |
Register a nested enumeration of type Enum_Type . More... | |
template<typename F , typename acc_level = detail::public_access> | |
bind< detail::meth, Class_Type, F, acc_level > | method (string_view name, F f, acc_level level=acc_level()) |
Register a method to this class. More... | |
template<typename... Args> | |
class_< Class_Type > & | operator() (Args &&...args) |
The bracket operator can be used to add additional meta data to the class type. More... | |
template<typename A , typename acc_level = detail::public_access, typename Tp = typename std::enable_if<detail::contains<acc_level, detail::access_levels_list>::value>::type> | |
bind< detail::prop, Class_Type, A, acc_level > | property (string_view name, A acc, acc_level level=acc_level()) |
Register a property to this class. More... | |
template<typename A1 , typename A2 , typename Tp = typename std::enable_if<!detail::contains<A2, detail::access_levels_list>::value>::type, typename acc_level = detail::public_access> | |
bind< detail::prop, Class_Type, A1, A2, acc_level > | property (string_view name, A1 getter, A2 setter, acc_level level=acc_level()) |
Register a property to this class. More... | |
template<typename A , typename acc_level = detail::public_access, typename Tp = typename std::enable_if<detail::contains<acc_level, detail::access_levels_list>::value>::type> | |
bind< detail::prop_readonly, Class_Type, A, acc_level > | property_readonly (string_view name, A acc, acc_level level=acc_level()) |
Register a read only property to this class. More... | |
Detailed Description
template<typename Class_Type>
class rttr::registration::class_< Class_Type >
The class_ is used to register classes to RTTR.
Constructor & Destructor Documentation
template<typename Class_Type>
rttr::registration::class_< Class_Type >::class_ | ( | string_view | name | ) |
Construct a class_ object with the given name name
.
- Parameters
-
name The name of the class as string literal. Can be retrieved later via type::get_name().
template<typename Class_Type>
rttr::registration::class_< Class_Type >::~class_ | ( | ) |
Member Function Documentation
template<typename Class_Type>
template<typename... Args, typename acc_level = detail::public_access, typename Tp = typename std::enable_if<detail::contains<acc_level, detail::access_levels_list>::value>::type>
bind<detail::ctor, Class_Type, acc_level, Args...> rttr::registration::class_< Class_Type >::constructor | ( | acc_level | level = acc_level() | ) |
Register a constructor for this class type with or without arguments.
- Parameters
-
level The access level of the constructor; default is: registration::public_access.
(can be also: registration::protected_access or registration::private_access)
- Remarks
- The default constructor create policy is: policy::ctor::as_std_shared_ptr.
- See also
- constructor, type::get_constructor(), type::create()
- Returns
- A bind object, in order to chain more calls.
template<typename Class_Type>
template<typename F , typename acc_level = detail::public_access, typename Tp = typename std::enable_if<!detail::contains<F, detail::access_levels_list>::value>::type>
bind<detail::ctor_func, Class_Type, F, acc_level> rttr::registration::class_< Class_Type >::constructor | ( | F | func, |
acc_level | level = acc_level() |
||
) |
Register a constructor for this class type which uses a function F
.
- Parameters
-
func A function which creates an instance of Class_Type
; This can be a pointer to a function or a std::function.level The access level of the constructor; default is: registration::public_access.
(can be also: registration::protected_access or registration::private_access)
- See also
- constructor, type::get_constructor(), type::create()
- Returns
- A bind object, in order to chain more calls.
template<typename Class_Type>
template<typename Enum_Type >
bind<detail::enum_, Class_Type, Enum_Type> rttr::registration::class_< Class_Type >::enumeration | ( | string_view | name | ) |
Register a nested enumeration of type Enum_Type
.
- Parameters
-
name The name of the enumeration.
- See also
- enumeration, type::get_enumeration()
- Returns
- A bind object, in order to chain more calls.
template<typename Class_Type>
template<typename F , typename acc_level = detail::public_access>
bind<detail::meth, Class_Type, F, acc_level> rttr::registration::class_< Class_Type >::method | ( | string_view | name, |
F | f, | ||
acc_level | level = acc_level() |
||
) |
Register a method to this class.
- Parameters
-
name The name of the method. function The function accessor to this method; this can be a member function, a function or an std::function. level The access level of the method; default is: registration::public_access.
(can be also: registration::protected_access or registration::private_access)
- Remarks
- The method name does not have to be unique for this class.
- See also
- method, type::get_method(), type::invoke()
- Returns
- A bind object, in order to chain more calls.
template<typename Class_Type>
template<typename... Args>
class_<Class_Type>& rttr::registration::class_< Class_Type >::operator() | ( | Args &&... | args | ) |
The bracket operator can be used to add additional meta data to the class type.
template<typename Class_Type>
template<typename A , typename acc_level = detail::public_access, typename Tp = typename std::enable_if<detail::contains<acc_level, detail::access_levels_list>::value>::type>
bind<detail::prop, Class_Type, A, acc_level> rttr::registration::class_< Class_Type >::property | ( | string_view | name, |
A | acc, | ||
acc_level | level = acc_level() |
||
) |
Register a property to this class.
- Parameters
-
name The name of the property. acc The accessor to the property; this can be a pointer to a member or a pointer to a variable. level The access level of the property; default is: registration::public_access.
(can be also: registration::protected_access or registration::private_access)
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- A bind object, in order to chain more calls.
template<typename Class_Type>
template<typename A1 , typename A2 , typename Tp = typename std::enable_if<!detail::contains<A2, detail::access_levels_list>::value>::type, typename acc_level = detail::public_access>
bind<detail::prop, Class_Type, A1, A2, acc_level> rttr::registration::class_< Class_Type >::property | ( | string_view | name, |
A1 | getter, | ||
A2 | setter, | ||
acc_level | level = acc_level() |
||
) |
Register a property to this class.
- Parameters
-
name The name of the property. getter The getter accessor to the property; this can be a pointer to a member function, a pointer to a function or a std::function. setter The setter accessor to the property; this can be a pointer to a member function, a pointer to a function or a std::function. level The access level of the property; default is: registration::public_access.
(can be also: registration::protected_access or registration::private_access)
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- A bind object, in order to chain more calls.
template<typename Class_Type>
template<typename A , typename acc_level = detail::public_access, typename Tp = typename std::enable_if<detail::contains<acc_level, detail::access_levels_list>::value>::type>
bind<detail::prop_readonly, Class_Type, A, acc_level> rttr::registration::class_< Class_Type >::property_readonly | ( | string_view | name, |
A | acc, | ||
acc_level | level = acc_level() |
||
) |
Register a read only property to this class.
- Parameters
-
name The name of the property. acc The accessor to the property; this can be a pointer to a member, a pointer to a variable, a pointer to a member function, a pointer to a function or a std::function. level The access level of the read only property; default is: registration::public_access.
(can be: registration::protected_access or registration::private_access)
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- A bind object, in order to chain more calls.
The documentation for this class was generated from the following file: