Changeset 3224 for code/branches/core4/src/core/CoreIncludes.h
- Timestamp:
- Jun 23, 2009, 8:14:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core4/src/core/CoreIncludes.h
r3196 r3224 56 56 */ 57 57 #define InternRegisterObject(ClassName, bRootClass) \ 58 this->setIdentifier(orxonox::ClassIdentifier<ClassName>::getIdentifier(#ClassName)); \ 59 if (orxonox::Identifier::isCreatingHierarchy()) \ 60 { \ 61 if (this->getParents()) \ 62 { \ 63 orxonox::ClassIdentifier<ClassName>::getIdentifier(#ClassName)->initializeClassHierarchy(this->getParents(), bRootClass); \ 64 this->getParents()->insert(this->getParents()->end(), this->getIdentifier()); \ 65 } \ 66 this->setConfigValues(); \ 58 if (ClassIdentifier<ClassName>::getIdentifier(#ClassName)->initialiseObject(this, #ClassName, bRootClass)) \ 67 59 return; \ 68 } \ 69 orxonox::ClassIdentifier<ClassName>::getIdentifier()->addObject(this) 70 71 /** 72 @brief Intern macro, containing the specific part of RegisterRootObject. 73 @param ClassName The name of the class 74 */ 75 #define InternRegisterRootObject(ClassName) \ 76 if (orxonox::Identifier::isCreatingHierarchy() && !this->getParents()) \ 77 this->createParents(); \ 78 InternRegisterObject(ClassName, true) 60 else \ 61 ((void)0) 79 62 80 63 /** … … 83 66 */ 84 67 #define RegisterObject(ClassName) \ 85 COUT(5) << "*** Register Object: " << #ClassName << std::endl; \86 68 InternRegisterObject(ClassName, false) 87 69 … … 91 73 */ 92 74 #define RegisterRootObject(ClassName) \ 93 COUT(5) << "*** Register Root-Object: " << #ClassName << std::endl; \ 94 InternRegisterRootObject(ClassName) 75 InternRegisterObject(ClassName, true) 95 76 96 77 /** … … 115 96 orxonox::ClassIdentifier<ClassName>::getIdentifier() 116 97 117 /**118 @brief Returns the Identifier with a given name through the factory.119 @param String The name of the class120 */121 #define ClassByString(String) \122 orxonox::Factory::getIdentifier(String)123 98 124 /** 125 @brief Returns the Identifier with a given network ID through the factory. 126 @param networkID The network ID of the class 127 */ 128 #define ClassByID(networkID) \ 129 orxonox::Factory::getIdentifier(networkID) 99 namespace orxonox 100 { 101 /** 102 @brief Returns the Identifier with a given name through the factory. 103 @param String The name of the class 104 */ 105 inline Identifier* ClassByString(const std::string& name) 106 { 107 return Factory::getIdentifier(name); 108 } 109 110 /** 111 @brief Returns the Identifier with a given network ID through the factory. 112 @param networkID The network ID of the class 113 */ 114 inline Identifier* ClassByID(uint32_t id) 115 { 116 return Factory::getIdentifier(id); 117 } 118 } 130 119 131 120 #endif /* _CoreIncludes_H__ */
Note: See TracChangeset
for help on using the changeset viewer.