[Orxonox-commit 1650] r6368 - code/branches/presentation2/src/libraries/core

rgrieder at orxonox.net rgrieder at orxonox.net
Thu Dec 17 10:49:17 CET 2009


Author: rgrieder
Date: 2009-12-17 10:49:16 +0100 (Thu, 17 Dec 2009)
New Revision: 6368

Modified:
   code/branches/presentation2/src/libraries/core/ConfigValueIncludes.h
Log:
Added config value macro "SetConfigValueAlias" where you can specify the entry name.

Modified: code/branches/presentation2/src/libraries/core/ConfigValueIncludes.h
===================================================================
--- code/branches/presentation2/src/libraries/core/ConfigValueIncludes.h	2009-12-16 21:19:32 UTC (rev 6367)
+++ code/branches/presentation2/src/libraries/core/ConfigValueIncludes.h	2009-12-17 09:49:16 UTC (rev 6368)
@@ -83,7 +83,20 @@
 #define SetConfigValue(varname, defaultValue) \
     orxonox::setConfigValueGeneric(this, &varname, ConfigFileType::Settings, this->getIdentifier()->getName(), #varname, defaultValue)
 
+/** Sets a runtime configurable value (simplified macro version of setConfigValueGeneric)
+    If the container for the value doesn't yet exist, a new one is created.
+    Also, the @a varname argument will be modified and set to the new value (default or from ini file).
+ at param variable
+    Variable name as C++ identifier.
+ at param entryName
+    Name of the entry in the ini file (e.g. [MySection] myValue)
+ at param defaultValue
+    Value to be used if it cannot be read from the ini file
+*/
+#define SetConfigValueAlias(variable, entryName, defaultValue) \
+    orxonox::setConfigValueGeneric(this, &variable, ConfigFileType::Settings, this->getIdentifier()->getName(), entryName, defaultValue)
 
+
 namespace orxonox
 {
     /** Resets a runtime configurable value to its default.




More information about the Orxonox-commit mailing list