Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5633 in orxonox.OLD for trunk/src/lib/util/executor/executor.cc


Ignore:
Timestamp:
Nov 18, 2005, 6:08:36 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: Executor works just fine.
Changed: Paramerte* to MT_*, to make things more general

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/executor/executor.cc

    r5632 r5633  
    4747  if (paramCount > FUNCTOR_MAX_ARGUMENTS)
    4848    paramCount = FUNCTOR_MAX_ARGUMENTS;
     49  // reading in Parameters.
    4950  this->paramCount = paramCount;
    50   this->parameters = new unsigned int[paramCount];
    5151  this->defaultValue = new MultiType[paramCount];
    5252
     
    5656  // What Parameters we have got
    5757  for (unsigned int i = 0; i < paramCount; i++)
    58     this->parameters[i] = va_arg(parameterList, int);
     58    this->defaultValue[i].setType(va_arg(parameterList, int));
    5959}
    6060
     
    6464Executor::~Executor()
    6565{
    66   delete[] this->parameters;
    6766  delete[] this->defaultValue;
    6867}
     
    106105  for (unsigned int i = 0; i < count; i++)
    107106  {
    108 
    109 
    110     switch (this->parameters[i])
     107    switch (this->defaultValue[i].getType())
    111108    {
    112       case ParameterBool:
     109      case MT_BOOL:
    113110        this->defaultValue[i].setInt(va_arg(defaultList, int));
    114111        break;
    115       case ParameterChar:
     112      case MT_CHAR:
    116113        this->defaultValue[i].setChar((char)va_arg(defaultList, int));
    117114        break;
    118       case ParameterString:
     115      case MT_STRING:
    119116        this->defaultValue[i].setString(va_arg(defaultList, char*));
    120117        break;
    121       case ParameterInt:
     118      case MT_INT:
    122119        this->defaultValue[i].setInt(va_arg(defaultList, int));
    123120        break;
    124       case ParameterUInt:
     121/*      case MT_UINT:
    125122        this->defaultValue[i].setInt((int)va_arg(defaultList, unsigned int));
    126         break;
    127       case ParameterFloat:
     123        break;*/
     124      case MT_FLOAT:
    128125        this->defaultValue[i].setFloat(va_arg(defaultList, double));
    129126        break;
    130       case ParameterLong:
     127/*      case MT_LONG:
    131128        this->defaultValue[i].setInt((int) va_arg(defaultList, long));
    132         break;
     129        break;*/
    133130      default:
    134131        break;
Note: See TracChangeset for help on using the changeset viewer.