Changeset 5151 in orxonox.OLD for trunk/src/util
- Timestamp:
- Aug 27, 2005, 12:59:28 PM (19 years ago)
- Location:
- trunk/src/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/shell.cc
r5149 r5151 80 80 ShellCommand<Shell>::registerCommand("clear", CL_SHELL, &Shell::clear); 81 81 ShellCommand<Shell>::registerCommand("testS", CL_SHELL, &Shell::testS); 82 ShellCommand<Shell>::registerCommand("testI", CL_SHELL, &Shell::testI );82 ShellCommand<Shell>::registerCommand("testI", CL_SHELL, &Shell::testI, 5); 83 83 } 84 84 -
trunk/src/util/shell_command.h
r5150 r5151 26 26 // MACRO DEFINITIONS // 27 27 /////////////////////// 28 #define l_BOOL_DEFGRAB(i) this->defaultBools[i] 29 #define l_INT_DEFGRAB(i) this->defaultInts[i] 30 #define l_UINT_DEFGRAB(i) (unsigned int)this->defaultInts[i] 31 #define l_LONG_DEFGRAB(i) (long)this->defaultInts[i] 32 #define l_FLOAT_DEFGRAB(i) this->defaultFloats[i] 33 #define l_STRING_DEFGRAB(i) this->defaultStrings[i] 28 34 29 35 // COMMAND REGISTRATION … … 70 76 #define ShellCommandExecute1(t1) \ 71 77 else if (this->paramCount == 1 && this->parameters[0] == t1##_PARAM) \ 72 (dynamic_cast<T*>(object)->*functionPointer_1_##t1)(t1##_FUNC(parameters, 0))78 (dynamic_cast<T*>(object)->*functionPointer_1_##t1)(t1##_FUNC(parameters, t1##_DEFGRAB(0))) 73 79 74 80 … … 101 107 unsigned int* parameters; //!< Parameters 102 108 bool isSingleton; //!< if the Class is Singleton @todo autocheck 109 char* defaultStrings[FUNCTOR_MAX_ARGUMENTS]; 110 int defaultInts[FUNCTOR_MAX_ARGUMENTS]; 111 float defaultFloats[FUNCTOR_MAX_ARGUMENTS]; 112 bool defaultBools[FUNCTOR_MAX_ARGUMENTS]; 103 113 104 114 private: … … 106 116 const char* className; //!< The Name of the Class associated to this Command 107 117 108 char* defaultStrings[FUNCTOR_MAX_ARGUMENTS];109 int defaultInts[FUNCTOR_MAX_ARGUMENTS];110 float defaultFloats[FUNCTOR_MAX_ARGUMENTS];111 bool defaultBools[FUNCTOR_MAX_ARGUMENTS];112 113 114 118 // STATIC MEMBERS 115 119 static tList<ShellCommandBase>* commandList; //!< A list of availiable commands. 116 120 }; 117 118 template<class T> class ShellCommand;119 /*120 template<class T> class ShellCommandSingleton : public ShellCommandBase121 {122 friend class ShellCommand<T>;123 private:124 ShellCommandSingleton(const char* commandName, ClassID classID, void (T::*functionPointer)())125 : ShellCommandBase (commandName, classID, 0)126 {127 this->functionPointer_NULL = functionPointer;128 }129 void (T::*functionPointer_NULL)();130 131 virtual void executeCommand (const char* parameters)132 {133 if (this->paramCount == 0)134 (T::getInstance()->*functionPointer_NULL)();135 }136 };*/137 138 121 139 122 //! keeps information about a ShellCommand
Note: See TracChangeset
for help on using the changeset viewer.