Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5640 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Nov 18, 2005, 7:29:10 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: default Values work, and small fix with unused ShellCommand_Type

Location:
trunk/src/lib/shell
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_command.cc

    r5639 r5640  
    264264          if (!strcmp(enumCMD->getName(), inputSplits.getString(fktPos)))
    265265          {
    266             if (objectPointer == NULL && enumCMD->functorType == ShellCommand_Objective)
     266            if (objectPointer == NULL && enumCMD->executor->getType() == Executor_Objective)
    267267            {
    268268              delete itCMD;
     
    339339  if (this == NULL)
    340340    return NULL;
    341   if (count == 0)
    342     return this;
    343   if (count > this->paramCount)
    344     count = this->paramCount;
    345 
    346   va_list defaultList;
    347   va_start(defaultList, count);
    348 
    349   for (unsigned int i = 0; i < count; i++)
    350   {
    351 
    352 
    353     switch (this->parameters[i])
    354     {
    355       case MT_BOOL:
    356         this->defaultValue[i].setInt(va_arg(defaultList, int));
    357         break;
    358       case MT_CHAR:
    359         this->defaultValue[i].setChar((char)va_arg(defaultList, int));
    360         break;
    361       case MT_STRING:
    362         this->defaultValue[i].setString(va_arg(defaultList, char*));
    363         break;
    364       case MT_INT:
    365         this->defaultValue[i].setInt(va_arg(defaultList, int));
    366         break;
    367 /*      case MT_UINT:
    368         this->defaultValue[i].setInt((int)va_arg(defaultList, unsigned int));
    369         break;*/
    370       case MT_FLOAT:
    371         this->defaultValue[i].setFloat(va_arg(defaultList, double));
    372         break;
    373 /*      case MT_LONG:
    374         this->defaultValue[i].setInt((int) va_arg(defaultList, long));
    375         break;*/
    376       default:
    377         break;
    378     }
    379   }
     341
     342  va_list values;
     343  va_start(values, count);
     344
     345  this->executor->defaultValues(count, values);
     346
    380347  return this;
    381348}
  • trunk/src/lib/shell/shell_command.h

    r5639 r5640  
    6060
    6161
    62 //! an enumerator for the definition of the Type.
    63 typedef enum {
    64   ShellCommand_Objective = 1,
    65   ShellCommand_Static    = 2,
    66 } ShellCommand_Type;
    6762
    6863//! a baseClass for all possible ShellCommands
     
    8782    ~ShellCommand();
    8883
    89     /** @returns the Type of this Function (either static or objective) */
    90     inline ShellCommand_Type getType() { return this->functorType; };
    91 
    9284    static bool isRegistered(const char* commandName, const char* className, Executor* executor);
    9385    static const char* paramToString(long parameter);
    9486
    9587  protected:
    96     ShellCommand_Type                functorType;                          //!< The type of Function we've got (either static or objective).
    9788    void*                            functionPointer;                      //!< The pointeer to the function of the Class (or static pointer if ClassID == CL_NULL )
    9889    unsigned int                     paramCount;                           //!< the count of parameters.
Note: See TracChangeset for help on using the changeset viewer.