Changeset 7372 for code/branches/doc/src/libraries/core/CoreIncludes.h
- Timestamp:
- Sep 7, 2010, 12:58:52 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/doc/src/libraries/core/CoreIncludes.h
r7363 r7372 37 37 @brief Definition of macros for Identifiers 38 38 39 Every class needs the RegisterObject(class) macro in its constructor. If the class is an interface40 or the BaseObject itself, it needs the macroRegisterRootObject(class) instead.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. 41 41 42 To allow the object being created through the factory, use the CreateFactory(class) macro outside 43 the of the class implementation, so it gets executed before main(). 42 To allow the object being created through the factory, use the @c CreateFactory(class) macro outside 43 of the class implementation, so it gets executed statically before @c main(). This will at the same time 44 register @a class in the class-hierarchy. If you don't want @a class to be loadable, but still 45 register it, call @c CreateUnloadableFactory(class). 46 47 Example: 48 @code 49 // Create the factory for MyClass 50 CreateFactory(MyClass); 51 52 // Constructor: 53 MyClass::MyClass() 54 { 55 // Register the object in the Identifier of MyClass 56 RegisterObject(MyClass); 57 } 58 @endcode 59 60 This file also defines a number of other useful macros, like, for example, @c Class(class) which 61 returns the @ref orxonox::Identifier "Identifier" of @a class, or @c ClassByString("class") which 62 returns the Identifier of a class with name @a "class". 63 64 Example: 65 @code 66 // Assigns the Identifier of MyClass 67 Identifier* identifier = Class(MyClass); 68 @endcode 69 @code 70 // Assigns the Identifier of a class named "MyClass" 71 Identifier* identifier = ClassByString("MyClass"); 72 @endcode 44 73 */ 45 74 … … 57 86 58 87 /** 59 @brief Intern macro, containing the common parts of RegisterObject andRegisterRootObject.88 @brief Intern macro, containing the common parts of @c RegisterObject and @c RegisterRootObject. 60 89 @param ClassName The name of the class 61 @param bRootClass True if the class is directly derived from OrxonoxClass90 @param bRootClass True if the class is directly derived from orxonox::OrxonoxClass 62 91 */ 63 92 #define InternRegisterObject(ClassName, bRootClass) \ … … 68 97 69 98 /** 70 @brief Register Object - with and without debug output.99 @brief Registers a newly created object in the core. Has to be called at the beginning of the constructor of @a ClassName. 71 100 @param ClassName The name of the class 72 101 */ … … 75 104 76 105 /** 77 @brief Register RootObject - with and without debug output.106 @brief Registers a newly created object in the core. Has to be called at the beginning of the constructor of @a ClassName. 78 107 @param ClassName The name of the class 108 109 In contrast to RegisterObject, this is used for classes that inherit directly from 110 orxonox::OrxonoxClass, namely all interfaces and orxonox::BaseObject. 79 111 */ 80 112 #define RegisterRootObject(ClassName) \
Note: See TracChangeset
for help on using the changeset viewer.