[Orxonox-commit 3996] r8670 - in code/branches/unity_build/src/libraries/core: . command

rgrieder at orxonox.net rgrieder at orxonox.net
Sun May 29 22:58:28 CEST 2011


Author: rgrieder
Date: 2011-05-29 22:58:28 +0200 (Sun, 29 May 2011)
New Revision: 8670

Modified:
   code/branches/unity_build/src/libraries/core/CommandLineParser.h
   code/branches/unity_build/src/libraries/core/command/Shell.h
Log:
- Shell shouldn't inherit OrxonoxClass twice if not necessary.
- Return const MultitType& if possible in CommandLineParser.

Modified: code/branches/unity_build/src/libraries/core/CommandLineParser.h
===================================================================
--- code/branches/unity_build/src/libraries/core/CommandLineParser.h	2011-05-29 20:56:57 UTC (rev 8669)
+++ code/branches/unity_build/src/libraries/core/CommandLineParser.h	2011-05-29 20:58:28 UTC (rev 8670)
@@ -98,9 +98,9 @@
         { this->usageInformation_ = usage; return *this; }
 
         //! Returns the actual value of the argument. Can be equal to default value.
-        MultiType getValue() const { return value_; }
+        const MultiType& getValue() const { return value_; }
         //! Returns the given default value as type T.
-        MultiType getDefaultValue() const { return defaultValue_; }
+        const MultiType& getDefaultValue() const { return defaultValue_; }
 
     private:
         //! Constructor initialises both value_ and defaultValue_ with defaultValue.
@@ -155,7 +155,7 @@
         template <class T>
         static void getValue(const std::string& name, T* value)
         { *value = (T)(getArgument(name)->getValue()); }
-        static MultiType getValue(const std::string& name)
+        static const MultiType& getValue(const std::string& name)
         { return getArgument(name)->getValue(); }
         template <class T>
         static CommandLineArgument& addArgument(const std::string& name, T defaultValue);

Modified: code/branches/unity_build/src/libraries/core/command/Shell.h
===================================================================
--- code/branches/unity_build/src/libraries/core/command/Shell.h	2011-05-29 20:56:57 UTC (rev 8669)
+++ code/branches/unity_build/src/libraries/core/command/Shell.h	2011-05-29 20:58:28 UTC (rev 8670)
@@ -84,7 +84,7 @@
 
         Different graphical consoles build upon a Shell, for example InGameConsole and IOConsole.
     */
-    class _CoreExport Shell : virtual public OrxonoxClass, public OutputListener, public DevModeListener
+    class _CoreExport Shell : public OutputListener, public DevModeListener
     {
         public:
             /// Defines the type of a line of text in the Shell - some types depend on the output level, others are of internal use.




More information about the Orxonox-commit mailing list