Changeset 9659 for code/branches/core6/src/libraries/core/CoreIncludes.h
- Timestamp:
- Aug 18, 2013, 4:57:51 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/CoreIncludes.h
r9646 r9659 37 37 @brief Defines several very important macros used to register objects, register classes, and to work with identifiers. 38 38 39 Every class needs the @c RegisterObject(class) macro in its constructor. If the class is an interface 40 or the @c BaseObject itself, it needs the macro @c RegisterRootObject(class) instead. 39 Every class needs the @c RegisterObject(class) macro in its constructor. 41 40 42 41 To register @a class in the class-hierarchy, use the @c RegisterClass(class) macro outside of the class implementation, 43 42 so it gets executed statically before @c main(). If you don't want @a class to be loadable, but still register it, call 44 43 @c RegisterUnloadableClass(class). 44 45 Abstract classes are registered with @c RegisterAbstractClass(class). For abstract classes, the inheritance must be 46 defined manually with @c RegisterAbstractClass(class).inheritsFrom(Class(parent)). Multiple parent classes can be defined 47 by chaining the above command. 45 48 46 49 Example: … … 125 128 126 129 /** 127 @brief Intern macro, containing the common parts of @c RegisterObject and @c RegisterRootObject. 128 @param ClassName The name of the class 129 @param bRootClass True if the class is directly derived from orxonox::OrxonoxClass 130 */ 131 #define InternRegisterObject(ClassName) \ 130 @brief Registers a newly created object in the framework. Has to be called at the beginning of the constructor of @a ClassName. 131 @param ClassName The name of the class 132 */ 133 #define RegisterObject(ClassName) \ 132 134 if (ClassIdentifier<ClassName>::getIdentifier(#ClassName)->initializeObject(this)) \ 133 135 return; \ 134 136 else \ 135 137 ((void)0) 136 137 /**138 @brief Registers a newly created object in the framework. Has to be called at the beginning of the constructor of @a ClassName.139 @param ClassName The name of the class140 */141 #define RegisterObject(ClassName) \142 InternRegisterObject(ClassName)143 144 /**145 @brief Registers a newly created object in the framework. Has to be called at the beginning of the constructor of @a ClassName.146 @param ClassName The name of the class147 148 In contrast to RegisterObject, this is used for classes that inherit directly from149 orxonox::OrxonoxClass, namely all interfaces and orxonox::BaseObject.150 */151 #define RegisterRootObject(ClassName) \152 InternRegisterObject(ClassName)153 138 154 139 /**
Note: See TracChangeset
for help on using the changeset viewer.