This class is used to register the constructors, properties, methods and enumeration for a certain class ClassType
.
More...
#include <register_reflection.h>
Public Member Functions | |
class_ (std::vector< rttr::metadata > data=std::vector< rttr::metadata >()) | |
~class_ () | |
template<typename... Args> | |
class_ & | constructor (std::vector< rttr::metadata > data=std::vector< rttr::metadata >()) |
Register a constructor for this class type with with or without arguments. More... | |
template<typename EnumType > | |
class_ & | enumeration (std::vector< std::pair< std::string, EnumType > > enum_data, std::vector< rttr::metadata > data=std::vector< rttr::metadata >()) |
Register a nested enumeration of type EnumType . More... | |
template<typename F > | |
class_ & | method (const std::string &name, F function) |
Register a method to this class. More... | |
template<typename F > | |
class_ & | method (const std::string &name, F function, std::vector< rttr::metadata > data) |
Register a method to this class. More... | |
template<typename F , typename Policy > | |
class_ & | method (const std::string &name, F function, const Policy &policy) |
Register a method to this class. More... | |
template<typename F , typename Policy > | |
class_ & | method (const std::string &name, F function, std::vector< rttr::metadata > data, const Policy &policy) |
Register a method to this class. More... | |
template<typename A > | |
class_ & | property (const std::string &name, A acc) |
Register a property with read and write access to this class. More... | |
template<typename A > | |
class_ & | property (const std::string &name, A acc, std::vector< rttr::metadata > data) |
Register a property with read and write access to this class. More... | |
template<typename A , typename Policy > | |
class_ & | property (const std::string &name, A acc, const Policy &policy,) |
Register a property with read and write access to this class. More... | |
template<typename A , typename Policy > | |
class_ & | property (const std::string &name, A acc, std::vector< rttr::metadata > data, const Policy &policy) |
Register a property with read and write access to this class. More... | |
template<typename A1 , typename A2 > | |
class_ & | property (const std::string &name, A1 getter, A2 setter,) |
Register a property with read and write access to this class. More... | |
template<typename A1 , typename A2 > | |
class_ & | property (const std::string &name, A1 getter, A2 setter, std::vector< rttr::metadata > data) |
Register a property with read and write access to this class. More... | |
template<typename A1 , typename A2 , typename Policy > | |
class_ & | property (const std::string &name, A1 getter, A2 setter, const Policy &policy) |
Register a property with read and write access to this class. More... | |
template<typename A1 , typename A2 , typename Policy > | |
class_ & | property (const std::string &name, A1 getter, A2 setter, std::vector< rttr::metadata > data, const Policy &policy) |
Register a property with read and write access to this class. More... | |
template<typename A > | |
class_ & | property_readonly (const std::string &name, A accessor) |
Register a property with read only access to this class. More... | |
template<typename A > | |
class_ & | property_readonly (const std::string &name, A acc, std::vector< rttr::metadata > data) |
Register a property with read only access to this class. More... | |
template<typename A , typename Policy > | |
class_ & | property_readonly (const std::string &name, A acc, const Policy &policy) |
Register a property with read only access to this class. More... | |
template<typename A , typename Policy > | |
class_ & | property_readonly (const std::string &name, A acc, std::vector< rttr::metadata > data, const Policy &policy) |
Register a property with read only access to this class. More... | |
Detailed Description
template<typename ClassType>
class rttr::class_< ClassType >
This class is used to register the constructors, properties, methods and enumeration for a certain class ClassType
.
Following example show the typical usage:
First the class declaration.
The in a cpp file, register the constructors, properties and methods of the class Mesh
.
Use it then for example like this:
Constructor & Destructor Documentation
rttr::class_< ClassType >::class_ | ( | std::vector< rttr::metadata > | data = std::vector< rttr::metadata >() | ) |
rttr::class_< ClassType >::~class_ | ( | ) |
Member Function Documentation
class_& rttr::class_< ClassType >::constructor | ( | std::vector< rttr::metadata > | data = std::vector< rttr::metadata >() | ) |
Register a constructor for this class type with with or without arguments.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::enumeration | ( | std::vector< std::pair< std::string, EnumType > > | enum_data, |
std::vector< rttr::metadata > | data = std::vector< rttr::metadata >() |
||
) |
Register a nested enumeration of type EnumType
.
- Parameters
-
enum_data The name of the property. data Additional meta data.
- Remarks
- Before using this make sure you have registered the type with RTTR_DECLARE_TYPE.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::method | ( | const std::string & | name, |
F | function | ||
) |
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.
- Remarks
- The method name does not have to be unique for this class.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::method | ( | const std::string & | name, |
F | function, | ||
std::vector< rttr::metadata > | data | ||
) |
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. data Additional meta data.
- Remarks
- The method name does not have to be unique for this class.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::method | ( | const std::string & | name, |
F | function, | ||
const Policy & | policy | ||
) |
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. policy The policies parameter describes how the method should be binded to the type system.
- Remarks
- The method name does not have to be unique for this class.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::method | ( | const std::string & | name, |
F | function, | ||
std::vector< rttr::metadata > | data, | ||
const Policy & | policy | ||
) |
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. data Additional meta data. policy The policies parameter describes how the method should be binded to the type system.
- Remarks
- The method name does not have to be unique for this class.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property | ( | const std::string & | name, |
A | acc | ||
) |
Register a property with read and write access 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.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property | ( | const std::string & | name, |
A | acc, | ||
std::vector< rttr::metadata > | data | ||
) |
Register a property with read and write access 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. data Additional meta data.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property | ( | const std::string & | name, |
A | acc, | ||
const Policy & | policy | ||
) |
Register a property with read and write access 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. policy The policies parameter describes how the property should be binded to the type system.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property | ( | const std::string & | name, |
A | acc, | ||
std::vector< rttr::metadata > | data, | ||
const Policy & | policy | ||
) |
Register a property with read and write access 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. data Additional meta data. policy The policies parameter describes how the property should be binded to the type system.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property | ( | const std::string & | name, |
A1 | getter, | ||
A2 | setter | ||
) |
Register a property with read and write access 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.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property | ( | const std::string & | name, |
A1 | getter, | ||
A2 | setter, | ||
std::vector< rttr::metadata > | data | ||
) |
Register a property with read and write access 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. data Additional meta data.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property | ( | const std::string & | name, |
A1 | getter, | ||
A2 | setter, | ||
const Policy & | policy | ||
) |
Register a property with read and write access 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. policy The policies parameter describes how the property should be binded to the type system.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property | ( | const std::string & | name, |
A1 | getter, | ||
A2 | setter, | ||
std::vector< rttr::metadata > | data, | ||
const Policy & | policy | ||
) |
Register a property with read and write access 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. data Additional meta data. policy The policies parameter describes how the property should be binded to the type system.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property_readonly | ( | const std::string & | name, |
A | accessor | ||
) |
Register a property with read only access 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.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property_readonly | ( | const std::string & | name, |
A | acc, | ||
std::vector< rttr::metadata > | data | ||
) |
Register a property with read only access 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. data Additional meta data.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property_readonly | ( | const std::string & | name, |
A | acc, | ||
const Policy & | policy | ||
) |
Register a property with read only access 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. policy The policies parameter describes how the property should be binded to the type system.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
class_& rttr::class_< ClassType >::property_readonly | ( | const std::string & | name, |
A | acc, | ||
std::vector< rttr::metadata > | data, | ||
const Policy & | policy | ||
) |
Register a property with read only access 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. data Additional meta data. policy The policies parameter describes how the property should be binded to the type system.
- Remarks
- The name of the property has to be unique for this class, otherwise it will not be registered.
- Returns
- Reference to this, in order to chain other calls.
The documentation for this class was generated from the following file: