Changeset 967 for code/branches/core2/src/orxonox/core/Functor.h
- Timestamp:
- Mar 31, 2008, 12:25:09 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/core/Functor.h
r955 r967 103 103 std::string getTypenameParam(unsigned int param) const { return (param >= 0 && param < 5) ? this->typeParam_[param] : ""; } 104 104 std::string getTypenameReturnvalue() const { return this->typeReturnvalue_; } 105 106 virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const = 0; 105 107 106 108 protected: … … 278 280 279 281 282 #define FUNCTOR_EVALUATE_PARAM(numparams) FUNCTOR_EVALUATE_PARAM##numparams 283 #define FUNCTOR_EVALUATE_PARAM0 284 #define FUNCTOR_EVALUATE_PARAM1 \ 285 if (index == 0) param = (P1)param 286 #define FUNCTOR_EVALUATE_PARAM2 \ 287 if (index == 0) param = (P1)param; \ 288 else if (index == 1) param = (P2)param 289 #define FUNCTOR_EVALUATE_PARAM3 \ 290 if (index == 0) param = (P1)param; \ 291 else if (index == 1) param = (P2)param; \ 292 else if (index == 2) param = (P3)param 293 #define FUNCTOR_EVALUATE_PARAM4 \ 294 if (index == 0) param = (P1)param; \ 295 else if (index == 1) param = (P2)param; \ 296 else if (index == 2) param = (P3)param; \ 297 else if (index == 3) param = (P4)param 298 #define FUNCTOR_EVALUATE_PARAM5 \ 299 if (index == 0) param = (P1)param; \ 300 else if (index == 1) param = (P2)param; \ 301 else if (index == 2) param = (P3)param; \ 302 else if (index == 3) param = (P4)param; \ 303 else if (index == 4) param = (P5)param 304 305 306 280 307 281 308 … … 301 328 } \ 302 329 \ 330 virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \ 331 { \ 332 FUNCTOR_EVALUATE_PARAM(numparams); \ 333 } \ 334 \ 303 335 private: \ 304 336 FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)); \ … … 340 372 } \ 341 373 \ 374 virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \ 375 { \ 376 FUNCTOR_EVALUATE_PARAM(numparams); \ 377 } \ 378 \ 342 379 private: \ 343 380 FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)); \ … … 365 402 { \ 366 403 FUNCTOR_STORE_RETURNVALUE(returnvalue, (*object.*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \ 404 } \ 405 \ 406 virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \ 407 { \ 408 FUNCTOR_EVALUATE_PARAM(numparams); \ 367 409 } \ 368 410 \
Note: See TracChangeset
for help on using the changeset viewer.