Changeset 1052 for code/trunk/src/orxonox/core/CoreIncludes.h
- Timestamp:
- Apr 14, 2008, 3:42:49 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/core/CoreIncludes.h
r871 r1052 28 28 /** 29 29 @file CoreIncludes.h 30 @brief Definition of macros and typedefs.30 @brief Definition of macros for Identifier and Factory. 31 31 32 32 Every class needs the RegisterObject(class) macro in its constructor. If the class is an interface … … 40 40 #define _CoreIncludes_H__ 41 41 42 #include "CorePrereqs.h"43 44 // All needed header-files45 42 #include "Identifier.h" 46 43 #include "ClassManager.h" 47 44 #include "Factory.h" 48 45 #include "ClassFactory.h" 49 #include "Iterator.h"50 #include "OrxonoxClass.h"51 #include "ConfigValueContainer.h"52 46 #include "Debug.h" 53 47 54 48 55 // All needed macros56 49 /** 57 50 @brief Intern macro, containing the common parts of RegisterObject and RegisterRootObject. … … 111 104 orxonox::Factory::getIdentifier(StringOrInt) 112 105 113 /**114 @brief Assigns the value, defined in the config-file, to the variable (or the default-value, if there is no entry in the file).115 @param varname The name of the variable116 @param defvalue The default-value of the variable117 */118 #define SetConfigValue(varname, defvalue) \119 orxonox::ConfigValueContainer* container##varname = this->getIdentifier()->getConfigValueContainer(#varname); \120 if (!container##varname) \121 { \122 container##varname = new orxonox::ConfigValueContainer(this->getIdentifier()->getName(), #varname, varname = defvalue); \123 this->getIdentifier()->addConfigValueContainer(#varname, container##varname); \124 } \125 container##varname->getValue(&varname)126 127 /**128 @brief Sets the variable and the config-file entry back to the previously defined default-value.129 @param varname The name of the variable130 */131 #define ResetConfigValue(varname) \132 orxonox::ConfigValueContainer* container##varname##reset = this->getIdentifier()->getConfigValueContainer(#varname); \133 if (container##varname##reset) \134 { \135 container##varname##reset->resetConfigValue(); \136 container##varname##reset->getValue(&varname); \137 } \138 else \139 COUT(2) << "Warning: Couldn't reset variable " << #varname << ", corresponding container doesn't exist." << std::endl140 141 106 #endif /* _CoreIncludes_H__ */
Note: See TracChangeset
for help on using the changeset viewer.