[Orxonox-commit 2577] r7282 - code/branches/consolecommands3/src/libraries/core/command

landauf at orxonox.net landauf at orxonox.net
Tue Aug 31 02:26:53 CEST 2010


Author: landauf
Date: 2010-08-31 02:26:53 +0200 (Tue, 31 Aug 2010)
New Revision: 7282

Modified:
   code/branches/consolecommands3/src/libraries/core/command/CommandEvaluation.h
   code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc
   code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.h
   code/branches/consolecommands3/src/libraries/core/command/TclThreadManager.h
Log:
ConsoleCommand::getCommand should return a const pointer

Modified: code/branches/consolecommands3/src/libraries/core/command/CommandEvaluation.h
===================================================================
--- code/branches/consolecommands3/src/libraries/core/command/CommandEvaluation.h	2010-08-31 00:16:45 UTC (rev 7281)
+++ code/branches/consolecommands3/src/libraries/core/command/CommandEvaluation.h	2010-08-31 00:26:53 UTC (rev 7282)
@@ -60,7 +60,7 @@
             inline bool isValid() const
                 { return (this->execCommand_ != 0); }
 
-            inline ConsoleCommand* getConsoleCommand() const
+            inline const ConsoleCommand* getConsoleCommand() const
                 { return this->execCommand_; }
 
             void setEvaluatedParameter(unsigned int index, const MultiType& param);
@@ -89,8 +89,8 @@
 
             static std::string getCommonBegin(const ArgumentCompletionList& list);
 
-            ConsoleCommand* execCommand_;
-            ConsoleCommand* hintCommand_;
+            const ConsoleCommand* execCommand_;
+            const ConsoleCommand* hintCommand_;
             SubString tokens_;
             std::string string_;
             unsigned int execArgumentsOffset_;

Modified: code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc
===================================================================
--- code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc	2010-08-31 00:16:45 UTC (rev 7281)
+++ code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.cc	2010-08-31 00:26:53 UTC (rev 7282)
@@ -414,7 +414,7 @@
         return GetLocalisation_noerror(this->descriptionReturnvalue_);
     }
 
-    /* static */ ConsoleCommand* ConsoleCommand::getCommand(const std::string& group, const std::string& name, bool bPrintError)
+    /* static */ const ConsoleCommand* ConsoleCommand::getCommand(const std::string& group, const std::string& name, bool bPrintError)
     {
         std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommand::getCommandMap().find(group);
         if (it_group != ConsoleCommand::getCommandMap().end())
@@ -435,7 +435,7 @@
         return 0;
     }
 
-    /* static */ ConsoleCommand* ConsoleCommand::getCommandLC(const std::string& group, const std::string& name, bool bPrintError)
+    /* static */ const ConsoleCommand* ConsoleCommand::getCommandLC(const std::string& group, const std::string& name, bool bPrintError)
     {
         std::string groupLC = getLowercase(group);
         std::string nameLC = getLowercase(name);

Modified: code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.h
===================================================================
--- code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.h	2010-08-31 00:16:45 UTC (rev 7281)
+++ code/branches/consolecommands3/src/libraries/core/command/ConsoleCommand.h	2010-08-31 00:26:53 UTC (rev 7282)
@@ -335,13 +335,13 @@
             static inline const std::map<std::string, std::map<std::string, ConsoleCommand*> >& getCommandsLC()
                 { return ConsoleCommand::getCommandMapLC(); }
 
-            static inline ConsoleCommand* getCommand(const std::string& name, bool bPrintError = false)
+            static inline const ConsoleCommand* getCommand(const std::string& name, bool bPrintError = false)
                 { return ConsoleCommand::getCommand("", name, bPrintError); }
-            static inline ConsoleCommand* getCommandLC(const std::string& name, bool bPrintError = false)
+            static inline const ConsoleCommand* getCommandLC(const std::string& name, bool bPrintError = false)
                 { return ConsoleCommand::getCommandLC("", name, bPrintError); }
 
-            static ConsoleCommand* getCommand(const std::string& group, const std::string& name, bool bPrintError = false);
-            static ConsoleCommand* getCommandLC(const std::string& group, const std::string& name, bool bPrintError = false);
+            static const ConsoleCommand* getCommand(const std::string& group, const std::string& name, bool bPrintError = false);
+            static const ConsoleCommand* getCommandLC(const std::string& group, const std::string& name, bool bPrintError = false);
 
             static void destroyAll();
 

Modified: code/branches/consolecommands3/src/libraries/core/command/TclThreadManager.h
===================================================================
--- code/branches/consolecommands3/src/libraries/core/command/TclThreadManager.h	2010-08-31 00:16:45 UTC (rev 7281)
+++ code/branches/consolecommands3/src/libraries/core/command/TclThreadManager.h	2010-08-31 00:26:53 UTC (rev 7282)
@@ -37,7 +37,6 @@
 #include <string>
 
 #include "util/Singleton.h"
-#include "core/OrxonoxClass.h"
 
 struct Tcl_Interp;
 




More information about the Orxonox-commit mailing list