[Orxonox-commit 1721] r6439 - code/branches/gamestate/src/libraries/core

rgrieder at orxonox.net rgrieder at orxonox.net
Sun Jan 3 15:54:34 CET 2010


Author: rgrieder
Date: 2010-01-03 15:54:34 +0100 (Sun, 03 Jan 2010)
New Revision: 6439

Modified:
   code/branches/gamestate/src/libraries/core/Language.h
Log:
Found two macros that can be replaced by simple inline functions.

Modified: code/branches/gamestate/src/libraries/core/Language.h
===================================================================
--- code/branches/gamestate/src/libraries/core/Language.h	2010-01-02 12:55:45 UTC (rev 6438)
+++ code/branches/gamestate/src/libraries/core/Language.h	2010-01-03 14:54:34 UTC (rev 6439)
@@ -52,13 +52,6 @@
 #include <cassert>
 #include "util/Singleton.h"
 
-#define AddLanguageEntry(label, fallbackstring) \
-    orxonox::Language::getInstance().addEntry(label, fallbackstring)
-
-#define GetLocalisation(label) \
-    orxonox::Language::getInstance().getLocalisation(label)
-
-
 namespace orxonox
 {
     // ###############################
@@ -139,6 +132,18 @@
 
             static Language* singletonPtr_s;
     };
+
+    //! Shortcut function for Language::addEntry
+    inline void AddLanguageEntry(const LanguageEntryLabel& label, const std::string& fallbackString)
+    {
+        Language::getInstance().addEntry(label, fallbackString);
+    }
+
+    //! Shortcut function for Language::getLocalisation
+    inline const std::string& GetLocalisation(const LanguageEntryLabel& label)
+    {
+        return Language::getInstance().getLocalisation(label);
+    }
 }
 
 #endif /* _Language_H__ */




More information about the Orxonox-commit mailing list