Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 31, 2008, 12:25:09 AM (16 years ago)
Author:
landauf
Message:

hum, i forgot what i was doing there… oh wait, i remember… it had something to do with executor evaluation. strange thing, no wonder my brain has a leak or something… what's that SVN thing all around my cursor? what's a cursor anyway? oh, and what am i doing here? i feel like having breakfast and it's all dark… stupid clock change…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/core/Functor.h

    r955 r967  
    103103            std::string getTypenameParam(unsigned int param) const { return (param >= 0 && param < 5) ? this->typeParam_[param] : ""; }
    104104            std::string getTypenameReturnvalue() const { return this->typeReturnvalue_; }
     105
     106            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const = 0;
    105107
    106108        protected:
     
    278280
    279281
     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
    280307
    281308
     
    301328            } \
    302329    \
     330            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \
     331            { \
     332                FUNCTOR_EVALUATE_PARAM(numparams); \
     333            } \
     334    \
    303335        private: \
    304336            FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)); \
     
    340372            } \
    341373    \
     374            virtual void evaluateParam(unsigned int index, MultiTypeMath& param) const \
     375            { \
     376                FUNCTOR_EVALUATE_PARAM(numparams); \
     377            } \
     378    \
    342379        private: \
    343380            FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer_)(FUNCTOR_FUNCTION_PARAMS(numparams)); \
     
    365402            { \
    366403                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); \
    367409            } \
    368410    \
Note: See TracChangeset for help on using the changeset viewer.