Changeset 949 for code/branches/core2/src/orxonox/core/CommandExecutor.h
- Timestamp:
- Mar 29, 2008, 2:30:10 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/core/CommandExecutor.h
r948 r949 33 33 #include <list> 34 34 35 #include "util/SubString.h" 35 36 #include "CorePrereqs.h" 36 37 37 class SubString; 38 #define COMMAND_EXECUTOR_CURSOR '$' 38 39 39 40 namespace orxonox … … 70 71 71 72 /** @brief Returns the map that stores all console commands. @return The const_iterator */ 72 static inline const std::map<std::string, ExecutorStatic*>& getConsoleCommandShortcutMap() { return CommandExecutor:: consoleCommandShortcuts_s; }73 static inline const std::map<std::string, ExecutorStatic*>& getConsoleCommandShortcutMap() { return CommandExecutor::getInstance().consoleCommandShortcuts_s; } 73 74 /** @brief Returns a const_iterator to the beginning of the map that stores all console commands. @return The const_iterator */ 74 static inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandShortcutMapBegin() { return CommandExecutor:: consoleCommandShortcuts_s.begin(); }75 static inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandShortcutMapBegin() { return CommandExecutor::getInstance().consoleCommandShortcuts_s.begin(); } 75 76 /** @brief Returns a const_iterator to the end of the map that stores all console commands. @return The const_iterator */ 76 static inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandShortcutMapEnd() { return CommandExecutor:: consoleCommandShortcuts_s.end(); }77 static inline std::map<std::string, ExecutorStatic*>::const_iterator getConsoleCommandShortcutMapEnd() { return CommandExecutor::getInstance().consoleCommandShortcuts_s.end(); } 77 78 78 79 /** @brief Returns the map that stores all console commands with their names in lowercase. @return The const_iterator */ 79 static inline const std::map<std::string, ExecutorStatic*>& getLowercaseConsoleCommandShortcutMap() { return CommandExecutor:: consoleCommandShortcuts_LC_s; }80 static inline const std::map<std::string, ExecutorStatic*>& getLowercaseConsoleCommandShortcutMap() { return CommandExecutor::getInstance().consoleCommandShortcuts_LC_s; } 80 81 /** @brief Returns a const_iterator to the beginning of the map that stores all console commands with their names in lowercase. @return The const_iterator */ 81 static inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandShortcutMapBegin() { return CommandExecutor:: consoleCommandShortcuts_LC_s.begin(); }82 static inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandShortcutMapBegin() { return CommandExecutor::getInstance().consoleCommandShortcuts_LC_s.begin(); } 82 83 /** @brief Returns a const_iterator to the end of the map that stores all console commands with their names in lowercase. @return The const_iterator */ 83 static inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandShortcutMapEnd() { return CommandExecutor:: consoleCommandShortcuts_LC_s.end(); }84 static inline std::map<std::string, ExecutorStatic*>::const_iterator getLowercaseConsoleCommandShortcutMapEnd() { return CommandExecutor::getInstance().consoleCommandShortcuts_LC_s.end(); } 84 85 85 86 private: 87 static CommandExecutor& getInstance(); 88 86 89 static void parse(const std::string& command, bool bInitialize = true); 87 90 static void initialize(); … … 116 119 static ConfigValueContainer* getContainerOfPossibleKey(const std::string& name); 117 120 118 static const char cursor_s = '$'; 121 std::string lastProcessedCommand_s; 122 SubString tokens_s; 123 std::list<const std::string*> listOfPossibleFunctionClasses_s; 124 std::list<const std::string*> listOfPossibleShortcuts_s; 125 std::list<const std::string*> listOfPossibleFunctions_s; 126 std::list<const std::string*> listOfPossibleConfigValueClasses_s; 127 std::list<const std::string*> listOfPossibleConfigValues_s; 128 std::list<const std::string*> listOfPossibleKeys_s; 119 129 120 static std::string lastProcessedCommand_s; 121 static SubString tokens_s; 122 static std::list<const std::string*> listOfPossibleFunctionClasses_s; 123 static std::list<const std::string*> listOfPossibleShortcuts_s; 124 static std::list<const std::string*> listOfPossibleFunctions_s; 125 static std::list<const std::string*> listOfPossibleConfigValueClasses_s; 126 static std::list<const std::string*> listOfPossibleConfigValues_s; 127 static std::list<const std::string*> listOfPossibleKeys_s; 130 Identifier* functionclass_s; 131 Identifier* configvalueclass_s; 132 ExecutorStatic* shortcut_s; 133 ExecutorStatic* function_s; 134 ConfigValueContainer* configvalue_s; 135 ConfigValueContainer* key_s; 128 136 129 static Identifier* functionclass_s; 130 static Identifier* configvalueclass_s; 131 static ExecutorStatic* shortcut_s; 132 static ExecutorStatic* function_s; 133 static ConfigValueContainer* configvalue_s; 134 static ConfigValueContainer* key_s; 137 std::string errorMessage_s; 138 CommandState state_s; 135 139 136 static std::string errorMessage_s; 137 static CommandState state_s; 138 139 static std::map<std::string, ExecutorStatic*> consoleCommandShortcuts_s; 140 static std::map<std::string, ExecutorStatic*> consoleCommandShortcuts_LC_s; 140 std::map<std::string, ExecutorStatic*> consoleCommandShortcuts_s; 141 std::map<std::string, ExecutorStatic*> consoleCommandShortcuts_LC_s; 141 142 }; 142 143 }
Note: See TracChangeset
for help on using the changeset viewer.