Changeset 5130 in orxonox.OLD for trunk/src/util/shell_command.cc
- Timestamp:
- Aug 26, 2005, 12:04:43 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/util/shell_command.cc
r5129 r5130 28 28 using namespace std; 29 29 30 ShellCommandBase::ShellCommandBase(const char* commandName, ClassID classID )30 ShellCommandBase::ShellCommandBase(const char* commandName, ClassID classID, void* functionPointer, unsigned int paramCount, va_list parameters) 31 31 { 32 32 this->classID = classID; 33 this->functionPointer = functionPointer; 33 34 this->commandName = new char[strlen(commandName)+1]; 34 35 strcpy(this->commandName, commandName); 35 36 37 // handling parameters, and storing them: 38 this->paramCount = paramCount; 39 this->parameters = new ShellParameterType[paramCount]; 40 41 for (unsigned int i = 0; i < paramCount; i++) 42 parameters[i] = va_arg(parameters, long); 43 44 // adding this ShellCommand to the list of known Commands 36 45 ShellCommandBase::commandList->add(this); 37 46 } 38 47 48 ShellCommandBase::~ShellCommandBase() 49 { 50 delete[] this->commandName; 51 delete[] this->parameters; 52 } 39 53 40 54 41 55 tList<ShellCommandBase>* ShellCommandBase::commandList = NULL; 42 56 43 bool ShellCommandBase::isRegistered(const char* commandName, ClassID classID )57 bool ShellCommandBase::isRegistered(const char* commandName, ClassID classID, unsigned int paramCount, va_list parameters) 44 58 { 45 59 if (ShellCommandBase::commandList == NULL)
Note: See TracChangeset
for help on using the changeset viewer.