rttr::registration::class_< Class_Type, Visitor_List > Class Template - 0.9.7 |RTTR
rttr::registration::class_< Class_Type, Visitor_List > 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, Visitor_List, 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, Visitor_List > 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, Visitor_List > method (string_view name, F f, acc_level level=acc_level())
 Register a method to this class. More...
 
template<typename... Args>
class_< Class_Type, Visitor_List > & 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, Visitor_List > property (string_view name, A acc, acc_level level=acc_level())
 Register a property to this class. More...
 
template<typename A1 , typename A2 , typename acc_level = detail::public_access, typename Tp = typename std::enable_if<!detail::contains<A2, detail::access_levels_list>::value>::type>
bind< detail::prop, Class_Type, A1, A2, acc_level, Visitor_List > 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, Visitor_List > 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, typename Visitor_List = READ_TL(rttr_visitor_list)>
class rttr::registration::class_< Class_Type, Visitor_List >

The class_ is used to register classes to RTTR.

Constructor & Destructor Documentation

template<typename Class_Type, typename Visitor_List = READ_TL(rttr_visitor_list)>
rttr::registration::class_< Class_Type, Visitor_List >::class_ ( string_view  name)

Construct a class_ object with the given name name.

Parameters
nameThe name of the class as string literal. Can be retrieved later via type::get_name().
template<typename Class_Type, typename Visitor_List = READ_TL(rttr_visitor_list)>
rttr::registration::class_< Class_Type, Visitor_List >::~class_ ( )

Member Function Documentation

template<typename Class_Type, typename Visitor_List = READ_TL(rttr_visitor_list)>
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, Visitor_List, Args...> rttr::registration::class_< Class_Type, Visitor_List >::constructor ( acc_level  level = acc_level())

Register a constructor for this class type with or without arguments.

Parameters
levelThe 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, typename Visitor_List = READ_TL(rttr_visitor_list)>
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, Visitor_List> rttr::registration::class_< Class_Type, Visitor_List >::constructor ( func,
acc_level  level = acc_level() 
)

Register a constructor for this class type which uses a function F.

Parameters
funcA function which creates an instance of Class_Type; This can be a pointer to a function or a std::function.
levelThe 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, typename Visitor_List = READ_TL(rttr_visitor_list)>
template<typename Enum_Type >
bind<detail::enum_, Class_Type, Enum_Type> rttr::registration::class_< Class_Type, Visitor_List >::enumeration ( string_view  name)

Register a nested enumeration of type Enum_Type.

Parameters
nameThe name of the enumeration.
See also
enumeration, type::get_enumeration()
Returns
A bind object, in order to chain more calls.
template<typename Class_Type, typename Visitor_List = READ_TL(rttr_visitor_list)>
template<typename F , typename acc_level = detail::public_access>
bind<detail::meth, Class_Type, F, acc_level, Visitor_List> rttr::registration::class_< Class_Type, Visitor_List >::method ( string_view  name,
f,
acc_level  level = acc_level() 
)

Register a method to this class.

Parameters
nameThe name of the method.
functionThe function accessor to this method; this can be a member function, a function or an std::function.
levelThe 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, typename Visitor_List = READ_TL(rttr_visitor_list)>
template<typename... Args>
class_<Class_Type, Visitor_List>& rttr::registration::class_< Class_Type, Visitor_List >::operator() ( Args &&...  args)

The bracket operator can be used to add additional meta data to the class type.

template<typename Class_Type, typename Visitor_List = READ_TL(rttr_visitor_list)>
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, Visitor_List> rttr::registration::class_< Class_Type, Visitor_List >::property ( string_view  name,
acc,
acc_level  level = acc_level() 
)

Register a property to this class.

Parameters
nameThe name of the property.
accThe accessor to the property; this can be a pointer to a member or a pointer to a variable.
levelThe 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.
See also
property, type::get_property(), type::get_property_value(), type::set_property_value()
Returns
A bind object, in order to chain more calls.
template<typename Class_Type, typename Visitor_List = READ_TL(rttr_visitor_list)>
template<typename A1 , typename A2 , typename acc_level = detail::public_access, typename Tp = typename std::enable_if<!detail::contains<A2, detail::access_levels_list>::value>::type>
bind<detail::prop, Class_Type, A1, A2, acc_level, Visitor_List> rttr::registration::class_< Class_Type, Visitor_List >::property ( string_view  name,
A1  getter,
A2  setter,
acc_level  level = acc_level() 
)

Register a property to this class.

Parameters
nameThe name of the property.
getterThe getter accessor to the property; this can be a pointer to a member function, a pointer to a function or a std::function.
setterThe setter accessor to the property; this can be a pointer to a member function, a pointer to a function or a std::function.
levelThe 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.
See also
property, type::get_property(), type::get_property_value(), type::set_property_value()
Returns
A bind object, in order to chain more calls.
template<typename Class_Type, typename Visitor_List = READ_TL(rttr_visitor_list)>
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, Visitor_List> rttr::registration::class_< Class_Type, Visitor_List >::property_readonly ( string_view  name,
acc,
acc_level  level = acc_level() 
)

Register a read only property to this class.

Parameters
nameThe name of the property.
accThe 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.
levelThe 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.
See also
property, type::get_property(), type::get_property_value(), type::set_property_value()
Returns
A bind object, in order to chain more calls.

The documentation for this class was generated from the following file: