Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5130 in orxonox.OLD for trunk/src/util/shell_command.cc


Ignore:
Timestamp:
Aug 26, 2005, 12:04:43 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: flush

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/shell_command.cc

    r5129 r5130  
    2828using namespace std;
    2929
    30 ShellCommandBase::ShellCommandBase(const char* commandName, ClassID classID)
     30ShellCommandBase::ShellCommandBase(const char* commandName, ClassID classID, void* functionPointer, unsigned int paramCount, va_list parameters)
    3131{
    3232  this->classID = classID;
     33  this->functionPointer = functionPointer;
    3334  this->commandName = new char[strlen(commandName)+1];
    3435  strcpy(this->commandName, commandName);
    3536
     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
    3645  ShellCommandBase::commandList->add(this);
    3746}
    3847
     48ShellCommandBase::~ShellCommandBase()
     49{
     50  delete[] this->commandName;
     51  delete[] this->parameters;
     52}
    3953
    4054
    4155tList<ShellCommandBase>* ShellCommandBase::commandList = NULL;
    4256
    43 bool ShellCommandBase::isRegistered(const char* commandName, ClassID classID)
     57bool ShellCommandBase::isRegistered(const char* commandName, ClassID classID, unsigned int paramCount, va_list parameters)
    4458{
    4559  if (ShellCommandBase::commandList == NULL)
Note: See TracChangeset for help on using the changeset viewer.