Changeset 5328 in orxonox.OLD for trunk/src/lib/shell
- Timestamp:
- Oct 8, 2005, 10:13:32 PM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_command.cc
r5327 r5328 211 211 { 212 212 ShellCommandClass::commandClassList = new tList<ShellCommandClass>; 213 // ShellCommandStatic<ShellCommandBase>::registerCommand("debug", "ShellCommand", &ShellCommandBase::debug);213 ShellCommandStatic<ShellCommandBase>::registerCommand("debug", "ShellCommand", ShellCommandBase::debug); 214 214 } 215 215 } -
trunk/src/lib/shell/shell_command.h
r5327 r5328 41 41 42 42 43 //! an enumerator for the definition of the Type. 44 typedef enum { 45 ShellCommand_Objective = 1, 46 ShellCommand_Static = 2, 47 } ShellCommand_Type; 48 43 49 //////////////// 44 50 // BASE CLASS // … … 99 105 ~ShellCommandBase(); 100 106 107 /** @returns the Type of this Function (either static or objective) */ 108 inline ShellCommand_Type getType() { return this->functorType; }; 109 101 110 static bool isRegistered(const char* commandName, const char* className, unsigned int paramCount, ...); 102 111 static const char* paramToString(long parameter); … … 109 118 110 119 protected: 120 ShellCommand_Type functorType; //!< The type of Function we've got (either static or objective). 111 121 void* functionPointer; //!< The pointeer to the function of the Class (or static pointer if ClassID == CL_NULL ) 112 122 unsigned int paramCount; //!< the count of parameters. … … 116 126 float defaultFloats[FUNCTOR_MAX_ARGUMENTS]; //!< A list of default Floats stored. 117 127 bool defaultBools[FUNCTOR_MAX_ARGUMENTS]; //!< A list of default Bools stored. 128 118 129 119 130 private: … … 149 160 // SHELLCOMMANDEXECUTER can be redefined too. 150 161 // SHELLCOMMANDINCLASS 162 // SHELLCOMMANDTYPE 151 163 //! registers a command without any parameters 152 164 #define ShellCommandRegister0() \ … … 212 224 : ShellCommandBase(commandName, className, 0) \ 213 225 { \ 226 this->functorType = SHELLCOMMANDTYPE; \ 214 227 this->functionPointer_0 = function; \ 215 228 } … … 221 234 : ShellCommandBase(commandName, className, 1, t1##_PARAM, d1) \ 222 235 { \ 236 this->functorType = SHELLCOMMANDTYPE; \ 223 237 this->functionPointer_1_##t1 = function; \ 224 238 } … … 230 244 : ShellCommandBase(commandName, className, 2, t1##_PARAM, d1, t2##_PARAM, d2) \ 231 245 { \ 246 this->functorType = SHELLCOMMANDTYPE; \ 232 247 this->functionPointer_2_##t1##_##t2 = function; \ 233 248 } … … 239 254 : ShellCommandBase(commandName, className, 3, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3) \ 240 255 { \ 256 this->functorType = SHELLCOMMANDTYPE; \ 241 257 this->functionPointer_3_##t1##_##t2##_##t3 = function; \ 242 258 } … … 248 264 : ShellCommandBase(commandName, className, 4, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4) \ 249 265 { \ 266 this->functorType = SHELLCOMMANDTYPE; \ 250 267 this->functionPointer_4_##t1##_##t2##_##t3##_##t4 = function; \ 251 268 } … … 257 274 : ShellCommandBase(commandName, className, 5, t1##_PARAM, d1, t2##_PARAM, d2, t3##_PARAM, d3, t4##_PARAM, d4, t5##_PARAM, d5) \ 258 275 { \ 276 this->functorType = SHELLCOMMANDTYPE; \ 259 277 this->functionPointer_5_##t1##_##t2##_##t3##_##t4##_##t5 = function; \ 260 278 } … … 313 331 #endif 314 332 #define SHELLCOMMANDINCLASS(FUNCTION) (T::FUNCTION) 315 333 #ifdef SHELLCOMMANDTYPE 334 #undef SHELLCOMMANDTYPE 335 #endif 336 #define SHELLCOMMANDTYPE ShellCommand_Objective 316 337 //! FUNCTOR_LIST is the List of command-registerers 317 338 #define FUNCTOR_LIST(x) ShellCommandRegister ## x … … 350 371 #undef SHELLCOMMANDEXECUTER 351 372 #endif 352 #define SHELLCOMMANDEXECUTER(nameExt) T::functionPointer##nameExt373 #define SHELLCOMMANDEXECUTER(nameExt) functionPointer##nameExt 353 374 #ifdef SHELLCOMMANDINCLASS 354 375 #undef SHELLCOMMANDINCLASS 355 376 #endif 356 377 #define SHELLCOMMANDINCLASS(FUNCTION) (FUNCTION) 378 #ifdef SHELLCOMMANDTYPE 379 #undef SHELLCOMMANDTYPE 380 #endif 381 #define SHELLCOMMANDTYPE ShellCommand_Static 357 382 358 383 //! FUNCTOR_LIST is the List of command-registerers
Note: See TracChangeset
for help on using the changeset viewer.