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... | |
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:
rttr::class_< ClassType >::class_ | ( | std::vector< rttr::metadata > | data = std::vector< rttr::metadata >() | ) |
rttr::class_< ClassType >::~class_ | ( | ) |
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.
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
.
enum_data | The name of the property. |
data | Additional meta data. |
class_& rttr::class_< ClassType >::method | ( | const std::string & | name, |
F | function | ||
) |
Register a method to this class.
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. |
class_& rttr::class_< ClassType >::method | ( | const std::string & | name, |
F | function, | ||
std::vector< rttr::metadata > | data | ||
) |
Register a method to this class.
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. |
class_& rttr::class_< ClassType >::method | ( | const std::string & | name, |
F | function, | ||
const Policy & | policy | ||
) |
Register a method to this class.
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. |
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.
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. |
class_& rttr::class_< ClassType >::property | ( | const std::string & | name, |
A | acc | ||
) |
Register a property with read and write access to this class.
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. |
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.
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. |
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.
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. |
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.
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. |
class_& rttr::class_< ClassType >::property | ( | const std::string & | name, |
A1 | getter, | ||
A2 | setter | ||
) |
Register a property with read and write access to this class.
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. |
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.
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. |
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.
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. |
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.
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. |
class_& rttr::class_< ClassType >::property_readonly | ( | const std::string & | name, |
A | accessor | ||
) |
Register a property with read only access to this class.
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. |
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.
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. |
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.
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. |
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.
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. |