Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 30, 2008, 5:38:03 AM (16 years ago)
Author:
landauf
Message:
  • added set and tset functions to the ConfigValueContainer to (temporary) set a config-value to a new value
  • ConfigValueContainer uses now the functions of MultiTypeMath to convert and assign values
  • added some errorhandling to the CommandExecutor in case there are not enough parameters when executing the command
  • added updateConfigValues function to Identifier
  • added addTime and removeTime functions to the Timer
  • some changes in Executor to allow adding description and default-values when using the ConsoleCommand macro
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/core/Executor.cc

    r947 r957  
    6464    }
    6565
    66     void Executor::setDescription(const std::string& description)
     66    Executor& Executor::setDescription(const std::string& description)
    6767    {
    6868        if (!this->bAddedDescription_)
     
    7272            this->bAddedDescription_ = true;
    7373        }
     74        return (*this);
    7475    }
    7576
     
    7980    }
    8081
    81     void Executor::setDescriptionParam(int param, const std::string& description)
     82    Executor& Executor::setDescriptionParam(int param, const std::string& description)
    8283    {
    8384        if (param >= 0 && param < MAX_FUNCTOR_ARGUMENTS)
     
    8788                std::string paramnumber;
    8889                if (!Convert::ToString(&paramnumber, param))
    89                     return;
     90                    return (*this);
    9091
    9192                this->descriptionParam_[param] = std::string("ExecutorDescription::" + this->name_ + "::param" + paramnumber);
     
    9495            }
    9596        }
     97        return (*this);
    9698    }
    9799
     
    104106    }
    105107
    106     void Executor::setDescriptionReturnvalue(const std::string& description)
     108    Executor& Executor::setDescriptionReturnvalue(const std::string& description)
    107109    {
    108110        if (!this->bAddedDescriptionReturnvalue_)
     
    112114            this->bAddedDescriptionReturnvalue_ = true;
    113115        }
     116        return (*this);
    114117    }
    115118
     
    119122    }
    120123
    121     void Executor::setDefaultValues(const MultiTypeMath& param1)
    122     {
    123         this->defaultValue_[0] = param1;
    124         this->bAddedDefaultValue_[0] = true;
    125     }
    126 
    127     void Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2)
    128     {
    129         this->defaultValue_[0] = param1;
    130         this->bAddedDefaultValue_[0] = true;
    131         this->defaultValue_[1] = param2;
    132         this->bAddedDefaultValue_[1] = true;
    133     }
    134 
    135     void Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)
     124    Executor& Executor::setDefaultValues(const MultiTypeMath& param1)
     125    {
     126        this->defaultValue_[0] = param1;
     127        this->bAddedDefaultValue_[0] = true;
     128
     129        return (*this);
     130    }
     131
     132    Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2)
     133    {
     134        this->defaultValue_[0] = param1;
     135        this->bAddedDefaultValue_[0] = true;
     136        this->defaultValue_[1] = param2;
     137        this->bAddedDefaultValue_[1] = true;
     138
     139        return (*this);
     140    }
     141
     142    Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)
    136143    {
    137144        this->defaultValue_[0] = param1;
     
    141148        this->defaultValue_[2] = param3;
    142149        this->bAddedDefaultValue_[2] = true;
    143     }
    144 
    145     void Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)
     150
     151        return (*this);
     152    }
     153
     154    Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)
    146155    {
    147156        this->defaultValue_[0] = param1;
     
    153162        this->defaultValue_[3] = param4;
    154163        this->bAddedDefaultValue_[3] = true;
    155     }
    156 
    157     void Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)
     164
     165        return (*this);
     166    }
     167
     168    Executor& Executor::setDefaultValues(const MultiTypeMath& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)
    158169    {
    159170        this->defaultValue_[0] = param1;
     
    167178        this->defaultValue_[4] = param5;
    168179        this->bAddedDefaultValue_[4] = true;
    169     }
    170 
    171     void Executor::setDefaultValue(unsigned int index, const MultiTypeMath& param)
     180
     181        return (*this);
     182    }
     183
     184    Executor& Executor::setDefaultValue(unsigned int index, const MultiTypeMath& param)
    172185    {
    173186        if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS)
     
    176189            this->bAddedDefaultValue_[index] = true;
    177190        }
     191        return (*this);
    178192    }
    179193
Note: See TracChangeset for help on using the changeset viewer.