Defines helper macros for reflecting types. The helper macros install typedefs and function stubs. The definitions are built by macros in Reflection.hpp.
It is possible to do this with template injection but it makes it difficult to describe DLL boundaries correctly, so we don’t do that.
Reflection.h | Defines helper macros for reflecting types. |
Macros | |
DECLARE_REFLECTION | Declares reflection for a class. |
DECLARE_TEMPLATE_REFLECTION | Declares reflection for a class with a templated base type. |
DECLARE_REFLECTION_EX | Declares reflection for a class, changing the ClassType used to reflect the class. |
DECLARE_STATIC_REFLECTION | Declares reflection for a static type. |
DECLARE_REFLECTION_ALIAS | Causes one static type to share reflection with another. |
DECLARE_TEMPLATE_REFLECTION_ALIAS | Causes a templated static type to share reflection with another. |
DECLARE_STATIC_EXTENSION | |
DEFINE_LOCAL_STATIC_REFLECTION |
Declares reflection for a class.
Place this macro somewhere in the class to be reflected to enable reflection on it. The reflection must be defined using DEFINE_REFLECTION in an implementation file somewhere. This macro adds both private and public symbols, so put a public/private/protected label after it.
BASE | The base class this class inherits from. |
class MyClass : public MyBase { DECLARE_REFLECTION(MyBase) public: ...
Declares reflection for a class, changing the ClassType used to reflect the class. This is an advanced declaration for introducing new root kinds of dynamic classes.
BASE | The base class this class inherits from. |
CLASSTYPE | The new reflection class. |
class Persistent : public Dynamic, public Serializable { DECLARE_REFLECTION_EX(MyBase, PersistentClass) public: ...
Declares reflection for a static type. Use this macro outside of any namespace scope.
MODULE | The module for ReflectExport or “local” if the type reflection doesn’t need to cross dll boundaries. |
TYPE | The type to reflect. |
CLASSTYPE | The class type to use to reflect this type. (should be a *Type, not a *Class). |
Template specializes Signature for the type.
Signatures provide a uniform means of accessing the Class object and the static type of that class of any reflected type, dynamic (Dynamic) or not.
template<typename T> struct Signature