[Orxonox-commit 4660] r9331 - code/branches/presentation2012merge/src/libraries/core/command
landauf at orxonox.net
landauf at orxonox.net
Sun Jul 22 21:35:54 CEST 2012
Author: landauf
Date: 2012-07-22 21:35:54 +0200 (Sun, 22 Jul 2012)
New Revision: 9331
Modified:
code/branches/presentation2012merge/src/libraries/core/command/ConsoleCommand.cc
code/branches/presentation2012merge/src/libraries/core/command/ConsoleCommand.h
Log:
removed const_cast and some const qualifiers from ConsoleCommand and -Manipulator
Modified: code/branches/presentation2012merge/src/libraries/core/command/ConsoleCommand.cc
===================================================================
--- code/branches/presentation2012merge/src/libraries/core/command/ConsoleCommand.cc 2012-07-22 17:23:51 UTC (rev 9330)
+++ code/branches/presentation2012merge/src/libraries/core/command/ConsoleCommand.cc 2012-07-22 19:35:54 UTC (rev 9331)
@@ -593,7 +593,7 @@
@param name The group of the requested command
@param bPrintError If true, an error is printed if the command doesn't exist
*/
- /* static */ const ConsoleCommand* ConsoleCommand::getCommand(const std::string& group, const std::string& name, bool bPrintError)
+ /* static */ ConsoleCommand* ConsoleCommand::getCommand(const std::string& group, const std::string& name, bool bPrintError)
{
// find the group
std::map<std::string, std::map<std::string, ConsoleCommand*> >::const_iterator it_group = ConsoleCommand::getCommandMap().find(group);
@@ -623,7 +623,7 @@
@param name The group of the requested command in lowercase
@param bPrintError If true, an error is printed if the command doesn't exist
*/
- /* static */ const ConsoleCommand* ConsoleCommand::getCommandLC(const std::string& group, const std::string& name, bool bPrintError)
+ /* static */ 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/presentation2012merge/src/libraries/core/command/ConsoleCommand.h
===================================================================
--- code/branches/presentation2012merge/src/libraries/core/command/ConsoleCommand.h 2012-07-22 17:23:51 UTC (rev 9330)
+++ code/branches/presentation2012merge/src/libraries/core/command/ConsoleCommand.h 2012-07-22 19:35:54 UTC (rev 9331)
@@ -381,7 +381,7 @@
{
public:
/// Constructor: Creates a manipulator for a given ConsoleCommand.
- ConsoleCommandManipulator(const ConsoleCommand* command) : command_(const_cast<ConsoleCommand*>(command)) {}
+ ConsoleCommandManipulator(ConsoleCommand* command) : command_(command) {}
/// Changes the current function of the command. @param function The new function-pointer @param bForce If true, the new function-pointer is always assigned, even if the headers don't match
template <class F>
@@ -618,7 +618,7 @@
{ return this->inputConfiguredParam_; }
/// Returns a manipulator for this command.
- inline ConsoleCommandManipulator getManipulator() const
+ inline ConsoleCommandManipulator getManipulator()
{ return this; }
private:
@@ -666,14 +666,14 @@
{ return ConsoleCommand::getCommandMapLC(); }
/// Returns a command (shortcut) with given name. @param name The name of the command shortcut @param bPrintError If true, an error is printed if the command doesn't exist
- static inline const ConsoleCommand* getCommand(const std::string& name, bool bPrintError = false)
+ static inline ConsoleCommand* getCommand(const std::string& name, bool bPrintError = false)
{ return ConsoleCommand::getCommand("", name, bPrintError); }
/// Returns a command (shortcut) with given name in lowercase. @param name The lowercase name of the command shortcut @param bPrintError If true, an error is printed if the command doesn't exist
- static inline const ConsoleCommand* getCommandLC(const std::string& name, bool bPrintError = false)
+ static inline ConsoleCommand* getCommandLC(const std::string& name, bool bPrintError = false)
{ return ConsoleCommand::getCommandLC("", name, bPrintError); }
- 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 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 void destroyAll();
More information about the Orxonox-commit
mailing list