Changeset 5830 for code/branches/core5/src/libraries
- Timestamp:
- Sep 28, 2009, 10:05:08 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/libraries/core/Functor.h
r5828 r5830 191 191 192 192 193 #define FUNCTOR_TEMPLATE(ismember, returnvalue, numparams) FUNCTOR_TEMPLATE##ismember##returnvalue##numparams 194 #define FUNCTOR_TEMPLATE000 195 #define FUNCTOR_TEMPLATE001 template <class P1> 196 #define FUNCTOR_TEMPLATE002 template <class P1, class P2> 197 #define FUNCTOR_TEMPLATE003 template <class P1, class P2, class P3> 198 #define FUNCTOR_TEMPLATE004 template <class P1, class P2, class P3, class P4> 199 #define FUNCTOR_TEMPLATE005 template <class P1, class P2, class P3, class P4, class P5> 200 #define FUNCTOR_TEMPLATE010 template <class R> 201 #define FUNCTOR_TEMPLATE011 template <class R, class P1> 202 #define FUNCTOR_TEMPLATE012 template <class R, class P1, class P2> 203 #define FUNCTOR_TEMPLATE013 template <class R, class P1, class P2, class P3> 204 #define FUNCTOR_TEMPLATE014 template <class R, class P1, class P2, class P3, class P4> 205 #define FUNCTOR_TEMPLATE015 template <class R, class P1, class P2, class P3, class P4, class P5> 206 #define FUNCTOR_TEMPLATE100 template <class T> 207 #define FUNCTOR_TEMPLATE101 template <class T, class P1> 208 #define FUNCTOR_TEMPLATE102 template <class T, class P1, class P2> 209 #define FUNCTOR_TEMPLATE103 template <class T, class P1, class P2, class P3> 210 #define FUNCTOR_TEMPLATE104 template <class T, class P1, class P2, class P3, class P4> 211 #define FUNCTOR_TEMPLATE105 template <class T, class P1, class P2, class P3, class P4, class P5> 212 #define FUNCTOR_TEMPLATE110 template <class T, class R> 213 #define FUNCTOR_TEMPLATE111 template <class T, class R, class P1> 214 #define FUNCTOR_TEMPLATE112 template <class T, class R, class P1, class P2> 215 #define FUNCTOR_TEMPLATE113 template <class T, class R, class P1, class P2, class P3> 216 #define FUNCTOR_TEMPLATE114 template <class T, class R, class P1, class P2, class P3, class P4> 217 #define FUNCTOR_TEMPLATE115 template <class T, class R, class P1, class P2, class P3, class P4, class P5> 193 #define FUNCTOR_TEMPLATE(ismember, returnvalue, numparams, additionalobject) FUNCTOR_TEMPLATE##ismember##returnvalue##numparams(additionalobject) 194 #define FUNCTOR_TEMPLATE000(additionalobject) 195 #define FUNCTOR_TEMPLATE001(additionalobject) template <class P1> 196 #define FUNCTOR_TEMPLATE002(additionalobject) template <class P1, class P2> 197 #define FUNCTOR_TEMPLATE003(additionalobject) template <class P1, class P2, class P3> 198 #define FUNCTOR_TEMPLATE004(additionalobject) template <class P1, class P2, class P3, class P4> 199 #define FUNCTOR_TEMPLATE005(additionalobject) template <class P1, class P2, class P3, class P4, class P5> 200 #define FUNCTOR_TEMPLATE010(additionalobject) template <class R> 201 #define FUNCTOR_TEMPLATE011(additionalobject) template <class R, class P1> 202 #define FUNCTOR_TEMPLATE012(additionalobject) template <class R, class P1, class P2> 203 #define FUNCTOR_TEMPLATE013(additionalobject) template <class R, class P1, class P2, class P3> 204 #define FUNCTOR_TEMPLATE014(additionalobject) template <class R, class P1, class P2, class P3, class P4> 205 #define FUNCTOR_TEMPLATE015(additionalobject) template <class R, class P1, class P2, class P3, class P4, class P5> 206 #define FUNCTOR_TEMPLATE100(additionalobject) template <class T FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 207 #define FUNCTOR_TEMPLATE101(additionalobject) template <class T, class P1 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 208 #define FUNCTOR_TEMPLATE102(additionalobject) template <class T, class P1, class P2 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 209 #define FUNCTOR_TEMPLATE103(additionalobject) template <class T, class P1, class P2, class P3 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 210 #define FUNCTOR_TEMPLATE104(additionalobject) template <class T, class P1, class P2, class P3, class P4 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 211 #define FUNCTOR_TEMPLATE105(additionalobject) template <class T, class P1, class P2, class P3, class P4, class P5 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 212 #define FUNCTOR_TEMPLATE110(additionalobject) template <class T, class R FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 213 #define FUNCTOR_TEMPLATE111(additionalobject) template <class T, class R, class P1 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 214 #define FUNCTOR_TEMPLATE112(additionalobject) template <class T, class R, class P1, class P2 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 215 #define FUNCTOR_TEMPLATE113(additionalobject) template <class T, class R, class P1, class P2, class P3 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 216 #define FUNCTOR_TEMPLATE114(additionalobject) template <class T, class R, class P1, class P2, class P3, class P4 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 217 #define FUNCTOR_TEMPLATE115(additionalobject) template <class T, class R, class P1, class P2, class P3, class P4, class P5 FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) > 218 219 220 221 #define FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT(additionalobject) FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT##additionalobject 222 #define FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT0 223 #define FUNCTOR_TEMPLATE_ADDITIONAL_OBJECT1 , class O 218 224 219 225 … … 317 323 318 324 #define CREATE_STATIC_FUNCTOR(returnvalue, numparams) \ 319 FUNCTOR_TEMPLATE(0, returnvalue, numparams ) \325 FUNCTOR_TEMPLATE(0, returnvalue, numparams, 0) \ 320 326 class FunctorStatic##returnvalue##numparams : public FunctorStatic \ 321 327 { \ … … 347 353 \ 348 354 \ 349 FUNCTOR_TEMPLATE(0, returnvalue, numparams ) \355 FUNCTOR_TEMPLATE(0, returnvalue, numparams, 0) \ 350 356 inline FunctorStatic##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(0, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \ 351 357 { \ … … 358 364 359 365 #define CREATE_MEMBER_FUNCTOR(returnvalue, numparams) \ 360 FUNCTOR_TEMPLATE(1, returnvalue, numparams ) \366 FUNCTOR_TEMPLATE(1, returnvalue, numparams, 0) \ 361 367 class FunctorMember##returnvalue##numparams : public FunctorMember<T> \ 362 368 { \ … … 391 397 \ 392 398 \ 393 FUNCTOR_TEMPLATE(1, returnvalue, numparams ) \399 FUNCTOR_TEMPLATE(1, returnvalue, numparams, 0) \ 394 400 class FunctorConstMember##returnvalue##numparams : public FunctorMember<T> \ 395 401 { \ … … 423 429 \ 424 430 \ 425 FUNCTOR_TEMPLATE(1, returnvalue, numparams ) \431 FUNCTOR_TEMPLATE(1, returnvalue, numparams, 0) \ 426 432 inline FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams))) \ 427 433 { \ … … 430 436 \ 431 437 \ 432 FUNCTOR_TEMPLATE(1, returnvalue, numparams ) \438 FUNCTOR_TEMPLATE(1, returnvalue, numparams, 0) \ 433 439 inline FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)) const) \ 434 440 { \ … … 436 442 } \ 437 443 \ 438 FUNCTOR_TEMPLATE(1, returnvalue, numparams ) \439 inline FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)), T* object) \444 FUNCTOR_TEMPLATE(1, returnvalue, numparams, 1) \ 445 inline FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)), O* object) \ 440 446 { \ 441 447 FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* functor = new FunctorMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams) (functionPointer); \ … … 445 451 \ 446 452 \ 447 FUNCTOR_TEMPLATE(1, returnvalue, numparams ) \448 inline FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)) const, T* object) \453 FUNCTOR_TEMPLATE(1, returnvalue, numparams, 1) \ 454 inline FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* createFunctor(FUNCTOR_FUNCTION_RETURNVALUE(returnvalue) (T::*functionPointer)(FUNCTOR_FUNCTION_PARAMS(numparams)) const, O* object) \ 449 455 { \ 450 456 FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams)* functor = new FunctorConstMember##returnvalue##numparams FUNCTOR_TEMPLATE_CLASSES(1, returnvalue, numparams) (functionPointer); \
Note: See TracChangeset
for help on using the changeset viewer.