General tricks used in this code
(a) Error messages are generated by typdefing an array of negative size to generate compile-time errors. (b) Warning messages on MSVC are generated by declaring unused variables, and enabling the "variable XXX is never used" warning. (c) Unions are used in a few compiler-specific cases to perform illegal casts. (d) For Microsoft and Intel, when adjusting the 'this' pointer, it's cast to (char *) first to ensure that the correct number of *bytes* are added.
///////////////////////////////////////////////////////////////////////////// Helper templates
Name |
Description |
An outer class, FastDelegateN<>, handles the invoking and creates the necessary typedefs. This class does everything else. |
|
Name |
Description |
![]() |
DelegateMemento - Evil version For compilers where data pointers are at least as big as code pointers, it is possible to store the function pointer in the this pointer, using another horrible_cast. In this case the DelegateMemento implementation is simple: +--pThis --+-- pMemFunc-+-- Meaning---------------------+ | 0 | 0 | Empty | | !=0 | !=0* | Static function or method call| +----------+------------+-------------------------------+
| |
![]() | ||
![]() |
N=1 Specialization to allow use of FastDelegate< R ( Param1 ) > instead of FastDelegate1 < Param1, R > | |
![]() |
N=2 Specialization to allow use of FastDelegate< R ( Param1, Param2 ) > instead of FastDelegate2 < Param1, Param2, R > | |
![]() |
N=3 Specialization to allow use of FastDelegate< R ( Param1, Param2, Param3 ) > instead of FastDelegate3 < Param1, Param2, Param3, R > | |
![]() |
N=4 Specialization to allow use of FastDelegate< R ( Param1, Param2, Param3, Param4 ) > instead of FastDelegate4 < Param1, Param2, Param3, Param4, R > | |
![]() |
N=5 Specialization to allow use of FastDelegate< R ( Param1, Param2, Param3, Param4, Param5 ) > instead of FastDelegate5 < Param1, Param2, Param3, Param4, Param5, R > | |
![]() |
N=6 Specialization to allow use of FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6 ) > instead of FastDelegate6 < Param1, Param2, Param3, Param4, Param5, Param6, R > | |
![]() |
N=7 Specialization to allow use of FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7 ) > instead of FastDelegate7 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, R > | |
![]() |
N=8 Specialization to allow use of FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8 ) > instead of FastDelegate8 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, R > | |
![]() |
N=11 Specialization to allow use of FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11 ) > instead of FastDelegate11 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, R > | |
![]() |
N=12 Specialization to allow use of FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12 ) > instead of FastDelegate12 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, R > | |
![]() |
N=13 Specialization to allow use of FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13 ) > instead of FastDelegate13 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, R > | |
![]() |
N=0 | |
![]() |
N=1 | |
![]() |
N=11 | |
![]() |
N=12 | |
![]() |
N=13 | |
![]() |
N=2 | |
![]() |
N=3 | |
![]() |
N=4 | |
![]() |
N=5 | |
![]() |
N=6 | |
![]() |
N=7 | |
![]() |
N=8 |
Name |
Description |
Copyright (c) 2015. All rights reserved.
|
What do you think about this topic? Send feedback!
|