Changeset 1716 for code/branches/core3/src/core
- Timestamp:
- Sep 6, 2008, 4:21:56 PM (16 years ago)
- Location:
- code/branches/core3/src/core
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/core/CommandEvaluation.cc
r1586 r1716 218 218 } 219 219 220 void CommandEvaluation::setEvaluatedParameter(unsigned int index, MultiType Mathparam)220 void CommandEvaluation::setEvaluatedParameter(unsigned int index, MultiType param) 221 221 { 222 222 if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS) … … 224 224 } 225 225 226 MultiType MathCommandEvaluation::getEvaluatedParameter(unsigned int index) const226 MultiType CommandEvaluation::getEvaluatedParameter(unsigned int index) const 227 227 { 228 228 if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS) … … 240 240 } 241 241 242 MultiType MathCommandEvaluation::getReturnvalue() const242 MultiType CommandEvaluation::getReturnvalue() const 243 243 { 244 244 if (this->function_) 245 245 return this->function_->getReturnvalue(); 246 246 247 return MultiType Math();247 return MultiType(); 248 248 } 249 249 -
code/branches/core3/src/core/CommandEvaluation.h
r1505 r1716 37 37 #include "ArgumentCompletionListElement.h" 38 38 #include "util/SubString.h" 39 #include "util/MultiType Math.h"39 #include "util/MultiType.h" 40 40 41 41 namespace orxonox … … 81 81 { return (this->additionalParameter_ != "") ? (" " + this->additionalParameter_) : ""; } 82 82 83 void setEvaluatedParameter(unsigned int index, MultiType Mathparam);84 MultiType MathgetEvaluatedParameter(unsigned int index) const;83 void setEvaluatedParameter(unsigned int index, MultiType param); 84 MultiType getEvaluatedParameter(unsigned int index) const; 85 85 86 86 bool hasReturnvalue() const; 87 MultiType MathgetReturnvalue() const;87 MultiType getReturnvalue() const; 88 88 89 89 private: … … 115 115 116 116 bool bEvaluatedParams_; 117 MultiType Mathparam_[5];117 MultiType param_[5]; 118 118 }; 119 119 } -
code/branches/core3/src/core/ConfigValueContainer.cc
r1658 r1716 64 64 @brief Does some special initialization for single config-values. 65 65 */ 66 void ConfigValueContainer::initValue(const MultiType Math& defvalue)66 void ConfigValueContainer::initValue(const MultiType& defvalue) 67 67 { 68 68 this->value_ = defvalue; … … 82 82 for (unsigned int i = 0; i < this->valueVector_.size(); i++) 83 83 { 84 ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i] .toString(), this->value_.isA(MT_string));85 this->defvalueStringVector_.push_back(this->valueVector_[i] .toString());84 ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType(MT_string)); 85 this->defvalueStringVector_.push_back(this->valueVector_[i]); 86 86 } 87 87 … … 103 103 @return True if the new value was successfully assigned 104 104 */ 105 bool ConfigValueContainer::set(const MultiType Math& input)106 { 107 if (this->bIsVector_) 108 { 109 return this->callFunctionWithIndex(&ConfigValueContainer::set, input .toString());105 bool ConfigValueContainer::set(const MultiType& input) 106 { 107 if (this->bIsVector_) 108 { 109 return this->callFunctionWithIndex(&ConfigValueContainer::set, input); 110 110 } 111 111 else … … 113 113 if (this->tset(input)) 114 114 { 115 ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, input .toString(), this->value_.isA(MT_string));115 ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, input, this->value_.isType(MT_string)); 116 116 return true; 117 117 } … … 126 126 @return True if the new value was successfully assigned 127 127 */ 128 bool ConfigValueContainer::set(unsigned int index, const MultiType Math& input)128 bool ConfigValueContainer::set(unsigned int index, const MultiType& input) 129 129 { 130 130 if (this->bIsVector_) … … 132 132 if (this->tset(index, input)) 133 133 { 134 ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, index, input .toString(), this->value_.isA(MT_string));134 ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, index, input, this->value_.isType(MT_string)); 135 135 return true; 136 136 } … … 148 148 @return True if the new value was successfully assigned 149 149 */ 150 bool ConfigValueContainer::tset(const MultiTypeMath& input) 151 { 152 if (this->bIsVector_) 153 { 154 return this->callFunctionWithIndex(&ConfigValueContainer::tset, input.toString()); 155 } 156 else 157 { 158 MultiTypeMath temp = this->value_; 159 if (temp.assimilate(input)) 160 { 161 this->value_ = temp; 150 bool ConfigValueContainer::tset(const MultiType& input) 151 { 152 if (this->bIsVector_) 153 { 154 return this->callFunctionWithIndex(&ConfigValueContainer::tset, input); 155 } 156 else 157 { 158 // MultiType temp = this->value_; 159 // if (temp.assimilate(input)) 160 // { 161 // this->value_ = temp; 162 this->value_ = input; 162 163 if (this->identifier_) 163 164 this->identifier_->updateConfigValues(); 164 165 165 166 return true; 166 }167 // } 167 168 } 168 169 return false; … … 175 176 @return True if the new value was successfully assigned 176 177 */ 177 bool ConfigValueContainer::tset(unsigned int index, const MultiType Math& input)178 bool ConfigValueContainer::tset(unsigned int index, const MultiType& input) 178 179 { 179 180 if (this->bIsVector_) … … 189 190 for (unsigned int i = this->valueVector_.size(); i <= index; i++) 190 191 { 191 this->valueVector_.push_back(MultiType Math());192 this->valueVector_.push_back(MultiType()); 192 193 } 193 194 } 194 195 195 MultiTypeMath temp = this->value_; 196 if (temp.assimilate(input)) 197 { 198 this->valueVector_[index] = temp; 196 // MultiType temp = this->value_; 197 // if (temp.assimilate(input)) 198 // { 199 // this->valueVector_[index] = temp; 200 this->valueVector_[index] = input; 199 201 200 202 if (this->identifier_) … … 202 204 203 205 return true; 204 }206 // } 205 207 } 206 208 else … … 216 218 @return True if the new entry was successfully added 217 219 */ 218 bool ConfigValueContainer::add(const MultiType Math& input)220 bool ConfigValueContainer::add(const MultiType& input) 219 221 { 220 222 if (this->bIsVector_) … … 239 241 this->valueVector_.erase(this->valueVector_.begin() + index); 240 242 for (unsigned int i = index; i < this->valueVector_.size(); i++) 241 ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.is A(MT_string));243 ConfigFileManager::getInstance()->setValue(this->type_, this->sectionname_, this->varname_, i, this->valueVector_[i], this->value_.isType(MT_string)); 242 244 ConfigFileManager::getInstance()->deleteVectorEntries(this->type_, this->sectionname_, this->varname_, this->valueVector_.size()); 243 245 … … 275 277 { 276 278 if (!this->bIsVector_) 277 this->value_ .fromString(ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, this->defvalueString_, this->value_.isA(MT_string)));279 this->value_ = ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, this->defvalueString_, this->value_.isType(MT_string)); 278 280 else 279 281 { … … 283 285 if (i < this->defvalueStringVector_.size()) 284 286 { 285 this->value_ .fromString(ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isA(MT_string)));287 this->value_ = ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, this->defvalueStringVector_[i], this->value_.isType(MT_string)); 286 288 } 287 289 else 288 290 { 289 this->value_ .fromString(ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, MultiTypeMath(), this->value_.isA(MT_string)));291 this->value_ = ConfigFileManager::getInstance()->getValue(this->type_, this->sectionname_, this->varname_, i, MultiType(), this->value_.isType(MT_string)); 290 292 } 291 293 … … 301 303 @return The returnvalue of the functioncall 302 304 */ 303 bool ConfigValueContainer::callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType Math&), const std::string& input)305 bool ConfigValueContainer::callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType&), const std::string& input) 304 306 { 305 307 SubString token(input, " ", SubString::WhiteSpaces, true, '\\', false, '"', false, '(', ')', false, '\0'); -
code/branches/core3/src/core/ConfigValueContainer.h
r1611 r1716 50 50 51 51 #include "util/Math.h" 52 #include "util/MultiType Math.h"52 #include "util/MultiType.h" 53 53 #include "ConfigFileManager.h" 54 54 … … 124 124 this->value_ = V(); 125 125 for (unsigned int i = 0; i < defvalue.size(); i++) 126 this->valueVector_.push_back(MultiType Math(defvalue[i]));126 this->valueVector_.push_back(MultiType(defvalue[i])); 127 127 128 128 this->initVector(); … … 247 247 } 248 248 249 bool set(const MultiType Math& input);250 bool tset(const MultiType Math& input);251 252 bool set(unsigned int index, const MultiType Math& input);253 bool tset(unsigned int index, const MultiType Math& input);254 bool add(const MultiType Math& input);249 bool set(const MultiType& input); 250 bool tset(const MultiType& input); 251 252 bool set(unsigned int index, const MultiType& input); 253 bool tset(unsigned int index, const MultiType& input); 254 bool add(const MultiType& input); 255 255 bool remove(unsigned int index); 256 256 … … 260 260 /** @brief Converts the config-value to a string. @return The string */ 261 261 inline std::string toString() const 262 { return this->value_ .toString(); }262 { return this->value_; } 263 263 /** @brief Returns the typename of the assigned config-value. @return The typename */ 264 264 inline std::string getTypename() const … … 267 267 private: 268 268 void init(ConfigFileType type, Identifier* identifier, const std::string& varname); 269 void initValue(const MultiType Math& defvalue);269 void initValue(const MultiType& defvalue); 270 270 void initVector(); 271 bool callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType Math&), const std::string& input);271 bool callFunctionWithIndex(bool (ConfigValueContainer::* function) (unsigned int, const MultiType&), const std::string& input); 272 272 273 273 bool bIsVector_; //!< True if the container contains a std::vector … … 280 280 std::vector<std::string> defvalueStringVector_; //!< A vector, containg the strings of the default-values in case we're storing a vector 281 281 282 MultiType Mathvalue_; //!< The value283 std::vector<MultiType Math>valueVector_; //!< A vector, containg the values in case we're storing a vector282 MultiType value_; //!< The value 283 std::vector<MultiType> valueVector_; //!< A vector, containg the values in case we're storing a vector 284 284 285 285 bool bAddedDescription_; //!< True if a description was added -
code/branches/core3/src/core/ConsoleCommand.h
r1594 r1716 93 93 inline ConsoleCommand& descriptionReturnvalue(const std::string& description) 94 94 { this->ExecutorStatic::setDescriptionReturnvalue(description); return (*this); } 95 inline ConsoleCommand& defaultValues(const MultiType Math& param1)95 inline ConsoleCommand& defaultValues(const MultiType& param1) 96 96 { this->ExecutorStatic::setDefaultValues(param1); return (*this); } 97 inline ConsoleCommand& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2)97 inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2) 98 98 { this->ExecutorStatic::setDefaultValues(param1, param2); return (*this); } 99 inline ConsoleCommand& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)99 inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3) 100 100 { this->ExecutorStatic::setDefaultValues(param1, param2, param3); return (*this); } 101 inline ConsoleCommand& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)101 inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) 102 102 { this->ExecutorStatic::setDefaultValues(param1, param2, param3, param4); return (*this); } 103 inline ConsoleCommand& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)103 inline ConsoleCommand& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) 104 104 { this->ExecutorStatic::setDefaultValues(param1, param2, param3, param4, param5); return (*this); } 105 inline ConsoleCommand& defaultValue(unsigned int index, const MultiType Math& param)105 inline ConsoleCommand& defaultValue(unsigned int index, const MultiType& param) 106 106 { this->ExecutorStatic::setDefaultValue(index, param); return (*this); } 107 107 -
code/branches/core3/src/core/Executor.cc
r1505 r1716 65 65 } 66 66 67 bool Executor::evaluate(const std::string& params, MultiType Mathparam[5], const std::string& delimiter) const67 bool Executor::evaluate(const std::string& params, MultiType param[5], const std::string& delimiter) const 68 68 { 69 69 unsigned int paramCount = this->functor_->getParamCount(); … … 171 171 } 172 172 173 Executor& Executor::setDefaultValues(const MultiType Math& param1)174 { 175 this->defaultValue_[0] = param1; 176 this->bAddedDefaultValue_[0] = true; 177 178 return (*this); 179 } 180 181 Executor& Executor::setDefaultValues(const MultiType Math& param1, const MultiTypeMath& param2)182 { 183 this->defaultValue_[0] = param1; 184 this->bAddedDefaultValue_[0] = true; 185 this->defaultValue_[1] = param2; 186 this->bAddedDefaultValue_[1] = true; 187 188 return (*this); 189 } 190 191 Executor& Executor::setDefaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)173 Executor& Executor::setDefaultValues(const MultiType& param1) 174 { 175 this->defaultValue_[0] = param1; 176 this->bAddedDefaultValue_[0] = true; 177 178 return (*this); 179 } 180 181 Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2) 182 { 183 this->defaultValue_[0] = param1; 184 this->bAddedDefaultValue_[0] = true; 185 this->defaultValue_[1] = param2; 186 this->bAddedDefaultValue_[1] = true; 187 188 return (*this); 189 } 190 191 Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3) 192 192 { 193 193 this->defaultValue_[0] = param1; … … 201 201 } 202 202 203 Executor& Executor::setDefaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)203 Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) 204 204 { 205 205 this->defaultValue_[0] = param1; … … 215 215 } 216 216 217 Executor& Executor::setDefaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)217 Executor& Executor::setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) 218 218 { 219 219 this->defaultValue_[0] = param1; … … 231 231 } 232 232 233 Executor& Executor::setDefaultValue(unsigned int index, const MultiType Math& param)233 Executor& Executor::setDefaultValue(unsigned int index, const MultiType& param) 234 234 { 235 235 if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS) -
code/branches/core3/src/core/Executor.h
r1586 r1716 64 64 { \ 65 65 COUT(5) << "Calling Executor " << this->name_ << " through parser with one parameter, using whole string: " << params << std::endl; \ 66 EXECUTOR_PARSE_FUNCTORCALL(mode)(EXECUTOR_PARSE_OBJECT(mode, 1) MultiType Math(params)); \66 EXECUTOR_PARSE_FUNCTORCALL(mode)(EXECUTOR_PARSE_OBJECT(mode, 1) MultiType(params)); \ 67 67 } \ 68 68 else if (this->bAddedDefaultValue_[0]) \ … … 90 90 } \ 91 91 \ 92 MultiType Mathparam[MAX_FUNCTOR_ARGUMENTS]; \92 MultiType param[MAX_FUNCTOR_ARGUMENTS]; \ 93 93 COUT(5) << "Calling Executor " << this->name_ << " through parser with " << paramCount << " parameters, using " << tokens.size() << " tokens ("; \ 94 94 for (unsigned int i = 0; i < tokens.size() && i < MAX_FUNCTOR_ARGUMENTS; i++) \ … … 145 145 inline void operator()() const 146 146 { (*this->functor_)(this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 147 inline void operator()(const MultiType Math& param1) const147 inline void operator()(const MultiType& param1) const 148 148 { (*this->functor_)(param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 149 inline void operator()(const MultiType Math& param1, const MultiTypeMath& param2) const149 inline void operator()(const MultiType& param1, const MultiType& param2) const 150 150 { (*this->functor_)(param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 151 inline void operator()(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) const151 inline void operator()(const MultiType& param1, const MultiType& param2, const MultiType& param3) const 152 152 { (*this->functor_)(param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); } 153 inline void operator()(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) const153 inline void operator()(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const 154 154 { (*this->functor_)(param1, param2, param3, param4, this->defaultValue_[4]); } 155 inline void operator()(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) const155 inline void operator()(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const 156 156 { (*this->functor_)(param1, param2, param3, param4, param5); } 157 157 158 158 bool parse(const std::string& params, const std::string& delimiter = " ") const; 159 159 160 bool evaluate(const std::string& params, MultiType Mathparam[5], const std::string& delimiter = " ") const;160 bool evaluate(const std::string& params, MultiType param[5], const std::string& delimiter = " ") const; 161 161 162 162 Executor& setDescription(const std::string& description); … … 177 177 inline FunctionType getType() const 178 178 { return this->functor_->getType(); } 179 inline MultiType MathgetReturnvalue() const179 inline MultiType getReturnvalue() const 180 180 { return this->functor_->getReturnvalue(); } 181 181 inline std::string getTypenameParam(unsigned int param) const … … 189 189 { return this->name_; } 190 190 191 Executor& setDefaultValues(const MultiType Math& param1);192 Executor& setDefaultValues(const MultiType Math& param1, const MultiTypeMath& param2);193 Executor& setDefaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3);194 Executor& setDefaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4);195 Executor& setDefaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5);196 Executor& setDefaultValue(unsigned int index, const MultiType Math& param);197 198 inline MultiType MathgetDefaultValue(unsigned int index) const191 Executor& setDefaultValues(const MultiType& param1); 192 Executor& setDefaultValues(const MultiType& param1, const MultiType& param2); 193 Executor& setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3); 194 Executor& setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4); 195 Executor& setDefaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5); 196 Executor& setDefaultValue(unsigned int index, const MultiType& param); 197 198 inline MultiType getDefaultValue(unsigned int index) const 199 199 { 200 200 if (index >= 0 && index < MAX_FUNCTOR_ARGUMENTS) … … 216 216 Functor* functor_; 217 217 std::string name_; 218 MultiType MathdefaultValue_[MAX_FUNCTOR_ARGUMENTS];218 MultiType defaultValue_[MAX_FUNCTOR_ARGUMENTS]; 219 219 bool bAddedDefaultValue_[MAX_FUNCTOR_ARGUMENTS]; 220 220 … … 245 245 inline void operator()(T* object) const 246 246 { (*((FunctorMember<T>*)this->functor_))(object, this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 247 inline void operator()(T* object, const MultiType Math& param1) const247 inline void operator()(T* object, const MultiType& param1) const 248 248 { (*((FunctorMember<T>*)this->functor_))(object, param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 249 inline void operator()(T* object, const MultiType Math& param1, const MultiTypeMath& param2) const249 inline void operator()(T* object, const MultiType& param1, const MultiType& param2) const 250 250 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 251 inline void operator()(T* object, const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) const251 inline void operator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3) const 252 252 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); } 253 inline void operator()(T* object, const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) const253 inline void operator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const 254 254 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, this->defaultValue_[4]); } 255 inline void operator()(T* object, const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) const255 inline void operator()(T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const 256 256 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, param5); } 257 257 … … 259 259 inline void operator()(const T* object) const 260 260 { (*((FunctorMember<T>*)this->functor_))(object, this->defaultValue_[0], this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 261 inline void operator()(const T* object, const MultiType Math& param1) const261 inline void operator()(const T* object, const MultiType& param1) const 262 262 { (*((FunctorMember<T>*)this->functor_))(object, param1, this->defaultValue_[1], this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 263 inline void operator()(const T* object, const MultiType Math& param1, const MultiTypeMath& param2) const263 inline void operator()(const T* object, const MultiType& param1, const MultiType& param2) const 264 264 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, this->defaultValue_[2], this->defaultValue_[3], this->defaultValue_[4]); } 265 inline void operator()(const T* object, const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) const265 inline void operator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3) const 266 266 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, this->defaultValue_[3], this->defaultValue_[4]); } 267 inline void operator()(const T* object, const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) const267 inline void operator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) const 268 268 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, this->defaultValue_[4]); } 269 inline void operator()(const T* object, const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) const269 inline void operator()(const T* object, const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) const 270 270 { (*((FunctorMember<T>*)this->functor_))(object, param1, param2, param3, param4, param5); } 271 271 -
code/branches/core3/src/core/Functor.h
r1592 r1716 33 33 #include "CorePrereqs.h" 34 34 35 #include "util/MultiType Math.h"35 #include "util/MultiType.h" 36 36 #include "util/Debug.h" 37 37 … … 95 95 virtual ~Functor() {} 96 96 97 virtual void operator()(const MultiType Math& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;97 virtual void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0; 98 98 99 99 inline unsigned int getParamCount() const { return this->numParams_; } 100 100 inline bool hasReturnvalue() const { return this->hasReturnValue_; } 101 101 inline FunctionType getType() const { return this->type_; } 102 inline MultiType MathgetReturnvalue() const { return this->returnedValue_; }102 inline MultiType getReturnvalue() const { return this->returnedValue_; } 103 103 104 104 std::string getTypenameParam(unsigned int param) const { return (param >= 0 && param < 5) ? this->typeParam_[param] : ""; } 105 105 std::string getTypenameReturnvalue() const { return this->typeReturnvalue_; } 106 106 107 virtual void evaluateParam(unsigned int index, MultiType Math& param) const = 0;107 virtual void evaluateParam(unsigned int index, MultiType& param) const = 0; 108 108 109 109 protected: … … 111 111 bool hasReturnValue_; 112 112 FunctionType type_; 113 MultiType MathreturnedValue_;113 MultiType returnedValue_; 114 114 115 115 std::string typeReturnvalue_; … … 121 121 public: 122 122 virtual ~FunctorStatic() {} 123 virtual void operator()(const MultiType Math& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;123 virtual void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0; 124 124 }; 125 125 … … 136 136 virtual ~FunctorMember() {} 137 137 138 virtual void operator()(T* object, const MultiType Math& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;139 virtual void operator()(const T* object, const MultiType Math& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) = 0;140 141 virtual void operator()(const MultiType Math& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null)138 virtual void operator()(T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0; 139 virtual void operator()(const T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) = 0; 140 141 virtual void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) 142 142 { 143 143 if (this->bConstObject_) … … 280 280 281 281 282 282 /* 283 283 #define FUNCTOR_EVALUATE_PARAM(numparams) FUNCTOR_EVALUATE_PARAM##numparams 284 284 #define FUNCTOR_EVALUATE_PARAM0 … … 303 303 else if (index == 3) { P4 temp = param; param = temp; } \ 304 304 else if (index == 4) { P5 temp = param; param = temp; } 305 305 */ 306 #define FUNCTOR_EVALUATE_PARAM(numparams) FUNCTOR_EVALUATE_PARAM##numparams 307 #define FUNCTOR_EVALUATE_PARAM0 308 #define FUNCTOR_EVALUATE_PARAM1 \ 309 if (index == 0) { param.convert<P1>(); } 310 #define FUNCTOR_EVALUATE_PARAM2 \ 311 if (index == 0) { param.convert<P1>(); } \ 312 else if (index == 1) { param.convert<P2>(); } 313 #define FUNCTOR_EVALUATE_PARAM3 \ 314 if (index == 0) { param.convert<P1>(); } \ 315 else if (index == 1) { param.convert<P2>(); } \ 316 else if (index == 2) { param.convert<P3>(); } 317 #define FUNCTOR_EVALUATE_PARAM4 \ 318 if (index == 0) { param.convert<P1>(); } \ 319 else if (index == 1) { param.convert<P2>(); } \ 320 else if (index == 2) { param.convert<P3>(); } \ 321 else if (index == 3) { param.convert<P4>(); } 322 #define FUNCTOR_EVALUATE_PARAM5 \ 323 if (index == 0) { param.convert<P1>(); } \ 324 else if (index == 1) { param.convert<P2>(); } \ 325 else if (index == 2) { param.convert<P3>(); } \ 326 else if (index == 3) { param.convert<P4>(); } \ 327 else if (index == 4) { param.convert<P5>(); } 306 328 307 329 … … 324 346 } \ 325 347 \ 326 void operator()(const MultiType Math& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \348 void operator()(const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \ 327 349 { \ 328 350 FUNCTOR_STORE_RETURNVALUE(returnvalue, (*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \ 329 351 } \ 330 352 \ 331 virtual void evaluateParam(unsigned int index, MultiType Math& param) const \353 virtual void evaluateParam(unsigned int index, MultiType& param) const \ 332 354 { \ 333 355 FUNCTOR_EVALUATE_PARAM(numparams); \ … … 362 384 } \ 363 385 \ 364 void operator()(T* object, const MultiType Math& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \386 void operator()(T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \ 365 387 { \ 366 388 FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \ 367 389 } \ 368 390 \ 369 void operator()(const T* object, const MultiType Math& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \391 void operator()(const T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \ 370 392 { \ 371 393 COUT(1) << "An error occurred in Functor.h:" << std::endl; \ … … 373 395 } \ 374 396 \ 375 virtual void evaluateParam(unsigned int index, MultiType Math& param) const \397 virtual void evaluateParam(unsigned int index, MultiType& param) const \ 376 398 { \ 377 399 FUNCTOR_EVALUATE_PARAM(numparams); \ … … 395 417 } \ 396 418 \ 397 void operator()(T* object, const MultiType Math& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \419 void operator()(T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \ 398 420 { \ 399 421 FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \ 400 422 } \ 401 423 \ 402 void operator()(const T* object, const MultiType Math& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \424 void operator()(const T* object, const MultiType& param1 = MT_null, const MultiType& param2 = MT_null, const MultiType& param3 = MT_null, const MultiType& param4 = MT_null, const MultiType& param5 = MT_null) \ 403 425 { \ 404 426 FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \ 405 427 } \ 406 428 \ 407 virtual void evaluateParam(unsigned int index, MultiType Math& param) const \429 virtual void evaluateParam(unsigned int index, MultiType& param) const \ 408 430 { \ 409 431 FUNCTOR_EVALUATE_PARAM(numparams); \ -
code/branches/core3/src/core/XMLPort.h
r1610 r1716 34 34 #include "util/Debug.h" 35 35 #include "util/XMLIncludes.h" 36 #include "util/MultiType Math.h"36 #include "util/MultiType.h" 37 37 #include "tinyxml/ticpp.h" 38 38 #include "Executor.h" … … 107 107 virtual const std::string& getDescription() = 0; 108 108 109 virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiType Math& param) = 0;110 virtual XMLPortParamContainer& defaultValues(const MultiType Math& param1) = 0;111 virtual XMLPortParamContainer& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2) = 0;112 virtual XMLPortParamContainer& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3) = 0;113 virtual XMLPortParamContainer& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4) = 0;114 virtual XMLPortParamContainer& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5) = 0;109 virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiType& param) = 0; 110 virtual XMLPortParamContainer& defaultValues(const MultiType& param1) = 0; 111 virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2) = 0; 112 virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3) = 0; 113 virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) = 0; 114 virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) = 0; 115 115 116 116 protected: … … 197 197 { return this->loadexecutor_->getDescription(); } 198 198 199 virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiType Math& param)199 virtual XMLPortParamContainer& defaultValue(unsigned int index, const MultiType& param) 200 200 { 201 201 if (!this->loadexecutor_->defaultValueSet(index)) … … 203 203 return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_); 204 204 } 205 virtual XMLPortParamContainer& defaultValues(const MultiType Math& param1)205 virtual XMLPortParamContainer& defaultValues(const MultiType& param1) 206 206 { 207 207 if (!this->loadexecutor_->defaultValueSet(0)) … … 209 209 return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_); 210 210 } 211 virtual XMLPortParamContainer& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2)211 virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2) 212 212 { 213 213 if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1))) … … 215 215 return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_); 216 216 } 217 virtual XMLPortParamContainer& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3)217 virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3) 218 218 { 219 219 if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2))) … … 221 221 return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_); 222 222 } 223 virtual XMLPortParamContainer& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4)223 virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4) 224 224 { 225 225 if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2)) || (!this->loadexecutor_->defaultValueSet(3))) … … 227 227 return this->portIfWaitingForDefaultValues(this->parseResult_, this->parseParams_); 228 228 } 229 virtual XMLPortParamContainer& defaultValues(const MultiType Math& param1, const MultiTypeMath& param2, const MultiTypeMath& param3, const MultiTypeMath& param4, const MultiTypeMath& param5)229 virtual XMLPortParamContainer& defaultValues(const MultiType& param1, const MultiType& param2, const MultiType& param3, const MultiType& param4, const MultiType& param5) 230 230 { 231 231 if ((!this->loadexecutor_->defaultValueSet(0)) || (!this->loadexecutor_->defaultValueSet(1)) || (!this->loadexecutor_->defaultValueSet(2)) || (!this->loadexecutor_->defaultValueSet(3)) || (!this->loadexecutor_->defaultValueSet(4))) -
code/branches/core3/src/core/input/InputManager.cc
r1596 r1716 321 321 if (joySticksSize_) 322 322 { 323 std::vector< MultiTypeMath> coeffPos;324 std::vector< MultiTypeMath> coeffNeg;325 std::vector< MultiTypeMath> zero;323 std::vector<double> coeffPos; 324 std::vector<double> coeffNeg; 325 std::vector<int> zero; 326 326 coeffPos.resize(24); 327 327 coeffNeg.resize(24);
Note: See TracChangeset
for help on using the changeset viewer.