Changeset 1670 for code/branches/gui/src/core/CommandLine.h
- Timestamp:
- Aug 26, 2008, 4:26:04 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/core/CommandLine.h
r1664 r1670 38 38 #define SetCommandLineArgument(name, defaultValue) \ 39 39 BaseCommandLineArgument& CmdArgumentDummyBoolVar##name \ 40 = orxonox::CommandLine::add CommandLineArgument(#name, defaultValue)40 = orxonox::CommandLine::addArgument(#name, defaultValue) 41 41 #define SetCommandLineSwitch(name) \ 42 42 BaseCommandLineArgument& CmdArgumentDummyBoolVar##name \ 43 = orxonox::CommandLine::add CommandLineArgument(#name, false)43 = orxonox::CommandLine::addArgument(#name, false) 44 44 45 45 … … 89 89 protected: 90 90 BaseCommandLineArgument(const std::string& name) 91 : name_(name)92 , bHasDefaultValue_(true)91 : bHasDefaultValue_(true) 92 , name_(name) 93 93 { } 94 94 … … 216 216 217 217 template <class T> 218 static const CommandLineArgument<T>* get CommandLineArgument(const std::string& name);218 static const CommandLineArgument<T>* getArgument(const std::string& name); 219 219 //! Writes the argument value in the given parameter. 220 220 template <class T> 221 static void get CommandLineValue(const std::string& name, T* value)222 { *value = get CommandLineArgument<T>(name)->getValue(); }223 template <class T> 224 static BaseCommandLineArgument& add CommandLineArgument(const std::string& name, T defaultValue);221 static void getValue(const std::string& name, T* value) 222 { *value = getArgument<T>(name)->getValue(); } 223 template <class T> 224 static BaseCommandLineArgument& addArgument(const std::string& name, T defaultValue); 225 225 226 226 private: … … 264 264 */ 265 265 template <class T> 266 const CommandLineArgument<T>* CommandLine::get CommandLineArgument(const std::string& name)266 const CommandLineArgument<T>* CommandLine::getArgument(const std::string& name) 267 267 { 268 268 std::map<std::string, BaseCommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name); … … 302 302 */ 303 303 template <class T> 304 BaseCommandLineArgument& CommandLine::add CommandLineArgument(const std::string& name, T defaultValue)304 BaseCommandLineArgument& CommandLine::addArgument(const std::string& name, T defaultValue) 305 305 { 306 306 std::map<std::string, BaseCommandLineArgument*>::const_iterator it = _getInstance().cmdLineArgs_.find(name);
Note: See TracChangeset
for help on using the changeset viewer.