mirror of
https://github.com/alliedmodders/metamod-source.git
synced 2025-01-18 07:52:32 +01:00
It seems to work, but it's not reentrant yet.
--HG-- extra : convert_revision : svn%3Ac2935e3e-5518-0410-8daf-afa5dab7d4e3/trunk%40124
This commit is contained in:
parent
67039543cd
commit
a4299bd097
@ -1,11 +1,11 @@
|
||||
// FastDelegate.h
|
||||
// FastDelegate.h
|
||||
// Efficient delegates in C++ that generate only two lines of asm code!
|
||||
// Documentation is found at http://www.codeproject.com/cpp/FastDelegate.asp
|
||||
//
|
||||
// - Don Clugston, Mar 2004.
|
||||
// Major contributions were made by Jody Hagins.
|
||||
// History:
|
||||
// 24-Apr-04 1.0 Submitted to CodeProject.
|
||||
// 24-Apr-04 1.0 Submitted to CodeProject.
|
||||
// 28-Apr-04 1.1 * Prevent most unsafe uses of evil static function hack.
|
||||
// * Improved syntax for horrible_cast (thanks Paul Bludov).
|
||||
// * Tested on Metrowerks MWCC and Intel ICL (IA32)
|
||||
@ -13,7 +13,7 @@
|
||||
// 27-Jun-04 1.2 * Now works on Borland C++ Builder 5.5
|
||||
// * Now works on /clr "managed C++" code on VC7, VC7.1
|
||||
// * Comeau C++ now compiles without warnings.
|
||||
// * Prevent the virtual inheritance case from being used on
|
||||
// * Prevent the virtual inheritance case from being used on
|
||||
// VC6 and earlier, which generate incorrect code.
|
||||
// * Improved warning and error messages. Non-standard hacks
|
||||
// now have compile-time checks to make them safer.
|
||||
@ -37,7 +37,7 @@
|
||||
// * Standardised all the compiler-specific workarounds.
|
||||
// * MFP conversion now works for CodePlay (but not yet supported in the full code).
|
||||
// * Now compiles without warnings on _any_ compiler, including BCC 5.5.1
|
||||
// * New syntax: FastDelegate< int (char *, double) >.
|
||||
// * New syntax: FastDelegate< int (char *, double) >.
|
||||
|
||||
#ifndef FASTDELEGATE_H
|
||||
#define FASTDELEGATE_H
|
||||
@ -58,7 +58,7 @@
|
||||
// Uncomment the following #define for optimally-sized delegates.
|
||||
// In this case, the generated asm code is almost identical to the code you'd get
|
||||
// if the compiler had native support for delegates.
|
||||
// It will not work on systems where sizeof(dataptr) < sizeof(codeptr).
|
||||
// It will not work on systems where sizeof(dataptr) < sizeof(codeptr).
|
||||
// Thus, it will not work for DOS compilers using the medium model.
|
||||
// It will also probably fail on some DSP systems.
|
||||
#define FASTDELEGATE_USESTATICFUNCTIONHACK
|
||||
@ -86,7 +86,7 @@
|
||||
|
||||
// Does the compiler uses Microsoft's member function pointer structure?
|
||||
// If so, it needs special treatment.
|
||||
// Metrowerks CodeWarrior, Intel, and CodePlay fraudulently define Microsoft's
|
||||
// Metrowerks CodeWarrior, Intel, and CodePlay fraudulently define Microsoft's
|
||||
// identifier, _MSC_VER. We need to filter Metrowerks out.
|
||||
#if defined(_MSC_VER) && !defined(__MWERKS__)
|
||||
#define FASTDLGT_MICROSOFT_MFP
|
||||
@ -112,7 +112,7 @@
|
||||
#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__ // Workaround GCC bug #8271
|
||||
#ifdef __GNUC__ // Workaround GCC bug #8271
|
||||
// At present, GCC doesn't recognize constness of MFPs in templates
|
||||
#define FASTDELEGATE_GCC_BUG_8271
|
||||
#endif
|
||||
@ -140,10 +140,10 @@ namespace fastdelegate {
|
||||
namespace detail { // we'll hide the implementation details in a nested namespace.
|
||||
|
||||
// implicit_cast< >
|
||||
// I believe this was originally going to be in the C++ standard but
|
||||
// I believe this was originally going to be in the C++ standard but
|
||||
// was left out by accident. It's even milder than static_cast.
|
||||
// I use it instead of static_cast<> to emphasize that I'm not doing
|
||||
// anything nasty.
|
||||
// anything nasty.
|
||||
// Usage is identical to static_cast<>
|
||||
template <class OutputClass, class InputClass>
|
||||
inline OutputClass implicit_cast(InputClass input){
|
||||
@ -151,11 +151,11 @@ inline OutputClass implicit_cast(InputClass input){
|
||||
}
|
||||
|
||||
// horrible_cast< >
|
||||
// This is truly evil. It completely subverts C++'s type system, allowing you
|
||||
// to cast from any class to any other class. Technically, using a union
|
||||
// This is truly evil. It completely subverts C++'s type system, allowing you
|
||||
// to cast from any class to any other class. Technically, using a union
|
||||
// to perform the cast is undefined behaviour (even in C). But we can see if
|
||||
// it is OK by checking that the union is the same size as each of its members.
|
||||
// horrible_cast<> should only be used for compiler-specific workarounds.
|
||||
// horrible_cast<> should only be used for compiler-specific workarounds.
|
||||
// Usage is identical to reinterpret_cast<>.
|
||||
|
||||
// This union is declared outside the horrible_cast because BCC 5.5.1
|
||||
@ -172,7 +172,7 @@ inline OutputClass horrible_cast(const InputClass input){
|
||||
// Cause a compile-time error if in, out and u are not the same size.
|
||||
// If the compile fails here, it means the compiler has peculiar
|
||||
// unions which would prevent the cast from working.
|
||||
typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u)
|
||||
typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u)
|
||||
&& sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1];
|
||||
u.in = input;
|
||||
return u.out;
|
||||
@ -203,9 +203,9 @@ inline OutputClass horrible_cast(const InputClass input){
|
||||
// Workaround for (2): On VC6, the code for calling a void function is
|
||||
// identical to the code for calling a non-void function in which the
|
||||
// return value is never used, provided the return value is returned
|
||||
// in the EAX register, rather than on the stack.
|
||||
// in the EAX register, rather than on the stack.
|
||||
// This is true for most fundamental types such as int, enum, void *.
|
||||
// Const void * is the safest option since it doesn't participate
|
||||
// Const void * is the safest option since it doesn't participate
|
||||
// in any automatic conversions. But on a 16-bit compiler it might
|
||||
// cause extra code to be generated, so we disable it for all compilers
|
||||
// except for VC6 (and VC5).
|
||||
@ -251,15 +251,15 @@ struct VoidToDefaultVoid<void> { typedef DefaultVoid type; };
|
||||
#ifdef FASTDLGT_MICROSOFT_MFP
|
||||
|
||||
#ifdef FASTDLGT_HASINHERITANCE_KEYWORDS
|
||||
// For Microsoft and Intel, we want to ensure that it's the most efficient type of MFP
|
||||
// (4 bytes), even when the /vmg option is used. Declaring an empty class
|
||||
// For Microsoft and Intel, we want to ensure that it's the most efficient type of MFP
|
||||
// (4 bytes), even when the /vmg option is used. Declaring an empty class
|
||||
// would give 16 byte pointers in this case....
|
||||
class __single_inheritance GenericClass;
|
||||
#endif
|
||||
// ...but for Codeplay, an empty class *always* gives 4 byte pointers.
|
||||
// If compiled with the /clr option ("managed C++"), the JIT compiler thinks
|
||||
// it needs to load GenericClass before it can call any of its functions,
|
||||
// (compiles OK but crashes at runtime!), so we need to declare an
|
||||
// (compiles OK but crashes at runtime!), so we need to declare an
|
||||
// empty class to make it happy.
|
||||
// Codeplay and VC4 can't cope with the unknown_inheritance case either.
|
||||
class GenericClass {};
|
||||
@ -272,41 +272,41 @@ const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)());
|
||||
|
||||
// SimplifyMemFunc< >::Convert()
|
||||
//
|
||||
// A template function that converts an arbitrary member function pointer into the
|
||||
// A template function that converts an arbitrary member function pointer into the
|
||||
// simplest possible form of member function pointer, using a supplied 'this' pointer.
|
||||
// According to the standard, this can be done legally with reinterpret_cast<>.
|
||||
// For (non-standard) compilers which use member function pointers which vary in size
|
||||
// depending on the class, we need to use knowledge of the internal structure of a
|
||||
// For (non-standard) compilers which use member function pointers which vary in size
|
||||
// depending on the class, we need to use knowledge of the internal structure of a
|
||||
// member function pointer, as used by the compiler. Template specialization is used
|
||||
// to distinguish between the sizes. Because some compilers don't support partial
|
||||
// to distinguish between the sizes. Because some compilers don't support partial
|
||||
// template specialisation, I use full specialisation of a wrapper struct.
|
||||
|
||||
// general case -- don't know how to convert it. Force a compile failure
|
||||
template <int N>
|
||||
struct SimplifyMemFunc {
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
// Unsupported member function type -- force a compile failure.
|
||||
// (it's illegal to have a array with negative size).
|
||||
typedef char ERROR_Unsupported_member_function_pointer_on_this_compiler[N-100];
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
// For compilers where all member func ptrs are the same size, everything goes here.
|
||||
// For non-standard compilers, only single_inheritance classes go here.
|
||||
template <>
|
||||
struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE> {
|
||||
struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE> {
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
#if defined __DMC__
|
||||
// Digital Mars doesn't allow you to cast between abitrary PMF's,
|
||||
#if defined __DMC__
|
||||
// Digital Mars doesn't allow you to cast between abitrary PMF's,
|
||||
// even though the standard says you can. The 32-bit compiler lets you
|
||||
// static_cast through an int, but the DOS compiler doesn't.
|
||||
bound_func = horrible_cast<GenericMemFuncType>(function_to_bind);
|
||||
#else
|
||||
#else
|
||||
bound_func = reinterpret_cast<GenericMemFuncType>(function_to_bind);
|
||||
#endif
|
||||
return reinterpret_cast<GenericClass *>(pthis);
|
||||
@ -334,13 +334,13 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE> {
|
||||
template<>
|
||||
struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
// We need to use a horrible_cast to do this conversion.
|
||||
// In MSVC, a multiple inheritance member pointer is internally defined as:
|
||||
union {
|
||||
XFuncType func;
|
||||
struct {
|
||||
struct {
|
||||
GenericMemFuncType funcaddress; // points to the actual member function
|
||||
int delta; // #BYTES to be added to the 'this' pointer
|
||||
}s;
|
||||
@ -349,7 +349,7 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
|
||||
typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)? 1 : -1];
|
||||
u.func = function_to_bind;
|
||||
bound_func = u.s.funcaddress;
|
||||
return reinterpret_cast<GenericClass *>(reinterpret_cast<char *>(pthis) + u.s.delta);
|
||||
return reinterpret_cast<GenericClass *>(reinterpret_cast<char *>(pthis) + u.s.delta);
|
||||
}
|
||||
};
|
||||
|
||||
@ -358,10 +358,10 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
|
||||
// enable conversion to a closure pointer. Earlier versions of this code didn't
|
||||
// work for all cases, and generated a compile-time error instead.
|
||||
// But a very clever hack invented by John M. Dlugosz solves this problem.
|
||||
// My code is somewhat different to his: I have no asm code, and I make no
|
||||
// My code is somewhat different to his: I have no asm code, and I make no
|
||||
// assumptions about the calling convention that is used.
|
||||
|
||||
// In VC++ and ICL, a virtual_inheritance member pointer
|
||||
// In VC++ and ICL, a virtual_inheritance member pointer
|
||||
// is internally defined as:
|
||||
struct MicrosoftVirtualMFP {
|
||||
void (GenericClass::*codeptr)(); // points to the actual member function
|
||||
@ -389,7 +389,7 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 2*sizeof(int) >
|
||||
{
|
||||
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
union {
|
||||
XFuncType func;
|
||||
@ -406,7 +406,7 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 2*sizeof(int) >
|
||||
typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)
|
||||
&& sizeof(function_to_bind)==sizeof(u.ProbeFunc)
|
||||
&& sizeof(u2.virtfunc)==sizeof(u2.s) ? 1 : -1];
|
||||
// Unfortunately, taking the address of a MF prevents it from being inlined, so
|
||||
// Unfortunately, taking the address of a MF prevents it from being inlined, so
|
||||
// this next line can't be completely optimised away by the compiler.
|
||||
u2.virtfunc = &GenericVirtualClass::GetThis;
|
||||
u.s.codeptr = u2.s.codeptr;
|
||||
@ -423,55 +423,55 @@ template <>
|
||||
struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
{
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
// There is an apalling but obscure compiler bug in MSVC6 and earlier:
|
||||
// vtable_index and 'vtordisp' are always set to 0 in the
|
||||
// vtable_index and 'vtordisp' are always set to 0 in the
|
||||
// unknown_inheritance case!
|
||||
// This means that an incorrect function could be called!!!
|
||||
// Compiling with the /vmg option leads to potentially incorrect code.
|
||||
// This is probably the reason that the IDE has a user interface for specifying
|
||||
// the /vmg option, but it is disabled - you can only specify /vmg on
|
||||
// the /vmg option, but it is disabled - you can only specify /vmg on
|
||||
// the command line. In VC1.5 and earlier, the compiler would ICE if it ever
|
||||
// encountered this situation.
|
||||
// It is OK to use the /vmg option if /vmm or /vms is specified.
|
||||
|
||||
// Fortunately, the wrong function is only called in very obscure cases.
|
||||
// It only occurs when a derived class overrides a virtual function declared
|
||||
// in a virtual base class, and the member function
|
||||
// It only occurs when a derived class overrides a virtual function declared
|
||||
// in a virtual base class, and the member function
|
||||
// points to the *Derived* version of that function. The problem can be
|
||||
// completely averted in 100% of cases by using the *Base class* for the
|
||||
// completely averted in 100% of cases by using the *Base class* for the
|
||||
// member fpointer. Ie, if you use the base class as an interface, you'll
|
||||
// stay out of trouble.
|
||||
// Occasionally, you might want to point directly to a derived class function
|
||||
// that isn't an override of a base class. In this case, both vtable_index
|
||||
// that isn't an override of a base class. In this case, both vtable_index
|
||||
// and 'vtordisp' are zero, but a virtual_inheritance pointer will be generated.
|
||||
// We can generate correct code in this case. To prevent an incorrect call from
|
||||
// ever being made, on MSVC6 we generate a warning, and call a function to
|
||||
// make the program crash instantly.
|
||||
// ever being made, on MSVC6 we generate a warning, and call a function to
|
||||
// make the program crash instantly.
|
||||
typedef char ERROR_VC6CompilerBug[-100];
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#else
|
||||
#else
|
||||
|
||||
// Nasty hack for Microsoft and Intel (IA32 and Itanium)
|
||||
// unknown_inheritance classes go here
|
||||
// unknown_inheritance classes go here
|
||||
// This is probably the ugliest bit of code I've ever written. Look at the casts!
|
||||
// There is a compiler bug in MSVC6 which prevents it from using this code.
|
||||
template <>
|
||||
struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
{
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
// The member function pointer is 16 bytes long. We can't use a normal cast, but
|
||||
// we can use a union to do the conversion.
|
||||
union {
|
||||
XFuncType func;
|
||||
// In VC++ and ICL, an unknown_inheritance member pointer
|
||||
// In VC++ and ICL, an unknown_inheritance member pointer
|
||||
// is internally defined as:
|
||||
struct {
|
||||
GenericMemFuncType m_funcaddress; // points to the actual member function
|
||||
@ -486,13 +486,13 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
bound_func = u.s.funcaddress;
|
||||
int virtual_delta = 0;
|
||||
if (u.s.vtable_index) { // Virtual inheritance is used
|
||||
// First, get to the vtable.
|
||||
// First, get to the vtable.
|
||||
// It is 'vtordisp' bytes from the start of the class.
|
||||
const int * vtable = *reinterpret_cast<const int *const*>(
|
||||
reinterpret_cast<const char *>(pthis) + u.s.vtordisp );
|
||||
|
||||
// 'vtable_index' tells us where in the table we should be looking.
|
||||
virtual_delta = u.s.vtordisp + *reinterpret_cast<const int *>(
|
||||
virtual_delta = u.s.vtordisp + *reinterpret_cast<const int *>(
|
||||
reinterpret_cast<const char *>(vtable) + u.s.vtable_index);
|
||||
}
|
||||
// The int at 'virtual_delta' gives us the amount to add to 'this'.
|
||||
@ -518,7 +518,7 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
// It knows nothing about the calling convention or number of arguments used by
|
||||
// the function pointed to.
|
||||
// It supplies comparison operators so that it can be stored in STL collections.
|
||||
// It cannot be set to anything other than null, nor invoked directly:
|
||||
// It cannot be set to anything other than null, nor invoked directly:
|
||||
// it must be converted to a specific delegate.
|
||||
|
||||
// Implementation:
|
||||
@ -526,7 +526,7 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
// DelegateMemento - Safe version
|
||||
//
|
||||
// This implementation is standard-compliant, but a bit tricky.
|
||||
// A static function pointer is stored inside the class.
|
||||
// A static function pointer is stored inside the class.
|
||||
// Here are the valid values:
|
||||
// +-- Static pointer --+--pThis --+-- pMemFunc-+-- Meaning------+
|
||||
// | 0 | 0 | 0 | Empty |
|
||||
@ -539,18 +539,18 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
|
||||
// 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
|
||||
// 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|
|
||||
// +----------+------------+-------------------------------+
|
||||
// Note that the Sun C++ and MSVC documentation explicitly state that they
|
||||
// Note that the Sun C++ and MSVC documentation explicitly state that they
|
||||
// support static_cast between void * and function pointers.
|
||||
|
||||
class DelegateMemento {
|
||||
protected:
|
||||
protected:
|
||||
// the data is protected, not private, because many
|
||||
// compilers have problems with template friends.
|
||||
typedef void (detail::GenericClass::*GenericMemFuncType)(); // arbitrary MFP.
|
||||
@ -593,11 +593,11 @@ public:
|
||||
inline bool IsLess(const DelegateMemento &right) const {
|
||||
// deal with static function pointers first
|
||||
#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
|
||||
if (m_pStaticFunction !=0 || right.m_pStaticFunction!=0)
|
||||
if (m_pStaticFunction !=0 || right.m_pStaticFunction!=0)
|
||||
return m_pStaticFunction < right.m_pStaticFunction;
|
||||
#endif
|
||||
if (m_pthis !=right.m_pthis) return m_pthis < right.m_pthis;
|
||||
// There are no ordering operators for member function pointers,
|
||||
// There are no ordering operators for member function pointers,
|
||||
// but we can fake one by comparing each byte. The resulting ordering is
|
||||
// arbitrary (and compiler-dependent), but it permits storage in ordered STL containers.
|
||||
return memcmp(&m_pFunction, &right.m_pFunction, sizeof(m_pFunction)) < 0;
|
||||
@ -607,7 +607,7 @@ public:
|
||||
{ return m_pFunction==0; }
|
||||
public:
|
||||
DelegateMemento & operator = (const DelegateMemento &right) {
|
||||
SetMementoFrom(right);
|
||||
SetMementoFrom(right);
|
||||
return *this;
|
||||
}
|
||||
inline bool operator <(const DelegateMemento &right) {
|
||||
@ -616,8 +616,8 @@ public:
|
||||
inline bool operator >(const DelegateMemento &right) {
|
||||
return right.IsLess(*this);
|
||||
}
|
||||
DelegateMemento (const DelegateMemento &right) :
|
||||
m_pthis(right.m_pthis), m_pFunction(right.m_pFunction)
|
||||
DelegateMemento (const DelegateMemento &right) :
|
||||
m_pthis(right.m_pthis), m_pFunction(right.m_pFunction)
|
||||
#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
|
||||
, m_pStaticFunction (right.m_pStaticFunction)
|
||||
#endif
|
||||
@ -638,8 +638,8 @@ protected:
|
||||
// A private wrapper class that adds function signatures to DelegateMemento.
|
||||
// It's the class that does most of the actual work.
|
||||
// The signatures are specified by:
|
||||
// GenericMemFunc: must be a type of GenericClass member function pointer.
|
||||
// StaticFuncPtr: must be a type of function pointer with the same signature
|
||||
// GenericMemFunc: must be a type of GenericClass member function pointer.
|
||||
// StaticFuncPtr: must be a type of function pointer with the same signature
|
||||
// as GenericMemFunc.
|
||||
// UnvoidStaticFuncPtr: is the same as StaticFuncPtr, except on VC6
|
||||
// where it never returns void (returns DefaultVoid instead).
|
||||
@ -655,8 +655,8 @@ class ClosurePtr : public DelegateMemento {
|
||||
public:
|
||||
// These functions are for setting the delegate to a member function.
|
||||
|
||||
// Here's the clever bit: we convert an arbitrary member function into a
|
||||
// standard form. XMemFunc should be a member function of class X, but I can't
|
||||
// Here's the clever bit: we convert an arbitrary member function into a
|
||||
// standard form. XMemFunc should be a member function of class X, but I can't
|
||||
// enforce that here. It needs to be enforced by the wrapper class.
|
||||
template < class X, class XMemFunc >
|
||||
inline void bindmemfunc(X *pthis, XMemFunc function_to_bind ) {
|
||||
@ -667,7 +667,7 @@ public:
|
||||
#endif
|
||||
}
|
||||
// For const member functions, we only need a const class pointer.
|
||||
// Since we know that the member function is const, it's safe to
|
||||
// Since we know that the member function is const, it's safe to
|
||||
// remove the const qualifier from the 'this' pointer with a const_cast.
|
||||
// VC6 has problems if we just overload 'bindmemfunc', so we give it a different name.
|
||||
template < class X, class XMemFunc>
|
||||
@ -717,47 +717,47 @@ public:
|
||||
m_pthis=reinterpret_cast<GenericClass *>(pParent);
|
||||
}
|
||||
}
|
||||
// For static functions, the 'static_function_invoker' class in the parent
|
||||
// will be called. The parent then needs to call GetStaticFunction() to find out
|
||||
// For static functions, the 'static_function_invoker' class in the parent
|
||||
// will be called. The parent then needs to call GetStaticFunction() to find out
|
||||
// the actual function to invoke.
|
||||
template < class DerivedClass, class ParentInvokerSig >
|
||||
inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
|
||||
inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
|
||||
StaticFuncPtr function_to_bind ) {
|
||||
bindmemfunc(pParent, static_function_invoker);
|
||||
m_pStaticFunction=reinterpret_cast<GenericFuncPtr>(function_to_bind);
|
||||
}
|
||||
inline UnvoidStaticFuncPtr GetStaticFunction() const {
|
||||
return reinterpret_cast<UnvoidStaticFuncPtr>(m_pStaticFunction);
|
||||
inline UnvoidStaticFuncPtr GetStaticFunction() const {
|
||||
return reinterpret_cast<UnvoidStaticFuncPtr>(m_pStaticFunction);
|
||||
}
|
||||
#else
|
||||
|
||||
// ClosurePtr<> - 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
|
||||
// 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. Invocation isn't any faster, but it saves 4 bytes, and
|
||||
// speeds up comparison and assignment. If C++ provided direct language support
|
||||
// for delegates, they would produce asm code that was almost identical to this.
|
||||
// Note that the Sun C++ and MSVC documentation explicitly state that they
|
||||
// Note that the Sun C++ and MSVC documentation explicitly state that they
|
||||
// support static_cast between void * and function pointers.
|
||||
|
||||
template< class DerivedClass >
|
||||
inline void CopyFrom (DerivedClass *pParent, const DelegateMemento &right) {
|
||||
SetMementoFrom(right);
|
||||
}
|
||||
// For static functions, the 'static_function_invoker' class in the parent
|
||||
// will be called. The parent then needs to call GetStaticFunction() to find out
|
||||
// For static functions, the 'static_function_invoker' class in the parent
|
||||
// will be called. The parent then needs to call GetStaticFunction() to find out
|
||||
// the actual function to invoke.
|
||||
// ******** EVIL, EVIL CODE! *******
|
||||
template < class DerivedClass, class ParentInvokerSig>
|
||||
inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
|
||||
inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
|
||||
StaticFuncPtr function_to_bind) {
|
||||
// We'll be ignoring the 'this' pointer, but we need to make sure we pass
|
||||
// a valid value to bindmemfunc().
|
||||
bindmemfunc(pParent, static_function_invoker);
|
||||
|
||||
// WARNING! Evil hack. We store the function in the 'this' pointer!
|
||||
// Ensure that there's a compilation failure if function pointers
|
||||
// Ensure that there's a compilation failure if function pointers
|
||||
// and data pointers have different sizes.
|
||||
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
|
||||
typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1];
|
||||
@ -772,7 +772,7 @@ public:
|
||||
// We're just returning the 'this' pointer, converted into
|
||||
// a function pointer!
|
||||
inline UnvoidStaticFuncPtr GetStaticFunction() const {
|
||||
// Ensure that there's a compilation failure if function pointers
|
||||
// Ensure that there's a compilation failure if function pointers
|
||||
// and data pointers have different sizes.
|
||||
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
|
||||
typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1];
|
||||
@ -794,7 +794,7 @@ public:
|
||||
|
||||
|
||||
// Once we have the member function conversion templates, it's easy to make the
|
||||
// wrapper classes. So that they will work with as many compilers as possible,
|
||||
// wrapper classes. So that they will work with as many compilers as possible,
|
||||
// the classes are of the form
|
||||
// FastDelegate3<int, char *, double>
|
||||
// They can cope with any combination of parameters. The max number of parameters
|
||||
@ -805,7 +805,7 @@ public:
|
||||
|
||||
// Because of the weird rule about the class of derived member function pointers,
|
||||
// you sometimes need to apply a downcast to the 'this' pointer.
|
||||
// This is the reason for the use of "implicit_cast<X*>(pthis)" in the code below.
|
||||
// This is the reason for the use of "implicit_cast<X*>(pthis)" in the code below.
|
||||
// If CDerivedClass is derived from CBaseClass, but doesn't override SimpleVirtualFunction,
|
||||
// without this trick you'd need to write:
|
||||
// MyDelegate(static_cast<CBaseClass *>(&d), &CDerivedClass::SimpleVirtualFunction);
|
||||
@ -862,7 +862,7 @@ public:
|
||||
FastDelegate0(DesiredRetType (*function_to_bind)() ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)()) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate0::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate0::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() () const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -927,7 +927,7 @@ public:
|
||||
FastDelegate1(DesiredRetType (*function_to_bind)(Param1 p1) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate1::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate1::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -992,7 +992,7 @@ public:
|
||||
FastDelegate2(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate2::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate2::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1057,7 +1057,7 @@ public:
|
||||
FastDelegate3(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate3::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate3::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1122,7 +1122,7 @@ public:
|
||||
FastDelegate4(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate4::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate4::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1187,7 +1187,7 @@ public:
|
||||
FastDelegate5(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate5::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate5::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1252,7 +1252,7 @@ public:
|
||||
FastDelegate6(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate6::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate6::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1317,7 +1317,7 @@ public:
|
||||
FastDelegate7(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate7::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate7::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1382,7 +1382,7 @@ public:
|
||||
FastDelegate8(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate8::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate8::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1447,7 +1447,7 @@ public:
|
||||
FastDelegate9(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate9::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate9::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1512,7 +1512,7 @@ public:
|
||||
FastDelegate10(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate10::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate10::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1577,7 +1577,7 @@ public:
|
||||
FastDelegate11(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate11::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate11::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1642,7 +1642,7 @@ public:
|
||||
FastDelegate12(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate12::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate12::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1707,7 +1707,7 @@ public:
|
||||
FastDelegate13(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate13::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate13::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1772,7 +1772,7 @@ public:
|
||||
FastDelegate14(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate14::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate14::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1837,7 +1837,7 @@ public:
|
||||
FastDelegate15(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate15::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate15::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1902,7 +1902,7 @@ public:
|
||||
FastDelegate16(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate16::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate16::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1921,10 +1921,270 @@ private: // Invoker for static functions
|
||||
return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16); }
|
||||
};
|
||||
|
||||
//N=17
|
||||
template<class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class RetType=detail::DefaultVoid>
|
||||
class FastDelegate17 {
|
||||
private:
|
||||
typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
|
||||
typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17);
|
||||
typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17);
|
||||
typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17);
|
||||
detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> m_Closure;
|
||||
public:
|
||||
// Typedefs to aid generic programming
|
||||
typedef FastDelegate17 type;
|
||||
|
||||
// Construction and comparison functions
|
||||
FastDelegate17() { clear(); }
|
||||
FastDelegate17(const FastDelegate17 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
void operator = (const FastDelegate17 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
bool operator ==(const FastDelegate17 &x) const {
|
||||
return m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator !=(const FastDelegate17 &x) const {
|
||||
return !m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator <(const FastDelegate17 &x) const {
|
||||
return m_Closure.IsLess(x.m_Closure); }
|
||||
bool operator >(const FastDelegate17 &x) const {
|
||||
return x.m_Closure.IsLess(m_Closure); }
|
||||
// Binding to non-const member functions
|
||||
template < class X, class Y >
|
||||
FastDelegate17(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) ) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17)) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
// Binding to const member functions.
|
||||
template < class X, class Y >
|
||||
FastDelegate17(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
|
||||
// Static functions. We convert them into a member function call.
|
||||
// Note that this also provides a conversion from static functions.
|
||||
FastDelegate17(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate17::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); }
|
||||
inline bool operator ! () const { // Is it bound to anything?
|
||||
return !m_Closure; }
|
||||
inline bool empty() const {
|
||||
return !m_Closure; }
|
||||
void clear() { m_Closure.clear();}
|
||||
// Conversion to and from the DelegateMemento storage class
|
||||
const DelegateMemento & GetMemento() { return m_Closure; }
|
||||
void SetMemento(const DelegateMemento &any) { m_Closure.CopyFrom(this, any); }
|
||||
|
||||
private: // Invoker for static functions
|
||||
RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) const {
|
||||
return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); }
|
||||
};
|
||||
|
||||
//N=18
|
||||
template<class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class RetType=detail::DefaultVoid>
|
||||
class FastDelegate18 {
|
||||
private:
|
||||
typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
|
||||
typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18);
|
||||
typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18);
|
||||
typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18);
|
||||
detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> m_Closure;
|
||||
public:
|
||||
// Typedefs to aid generic programming
|
||||
typedef FastDelegate18 type;
|
||||
|
||||
// Construction and comparison functions
|
||||
FastDelegate18() { clear(); }
|
||||
FastDelegate18(const FastDelegate18 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
void operator = (const FastDelegate18 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
bool operator ==(const FastDelegate18 &x) const {
|
||||
return m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator !=(const FastDelegate18 &x) const {
|
||||
return !m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator <(const FastDelegate18 &x) const {
|
||||
return m_Closure.IsLess(x.m_Closure); }
|
||||
bool operator >(const FastDelegate18 &x) const {
|
||||
return x.m_Closure.IsLess(m_Closure); }
|
||||
// Binding to non-const member functions
|
||||
template < class X, class Y >
|
||||
FastDelegate18(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) ) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18)) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
// Binding to const member functions.
|
||||
template < class X, class Y >
|
||||
FastDelegate18(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
|
||||
// Static functions. We convert them into a member function call.
|
||||
// Note that this also provides a conversion from static functions.
|
||||
FastDelegate18(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate18::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18); }
|
||||
inline bool operator ! () const { // Is it bound to anything?
|
||||
return !m_Closure; }
|
||||
inline bool empty() const {
|
||||
return !m_Closure; }
|
||||
void clear() { m_Closure.clear();}
|
||||
// Conversion to and from the DelegateMemento storage class
|
||||
const DelegateMemento & GetMemento() { return m_Closure; }
|
||||
void SetMemento(const DelegateMemento &any) { m_Closure.CopyFrom(this, any); }
|
||||
|
||||
private: // Invoker for static functions
|
||||
RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) const {
|
||||
return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18); }
|
||||
};
|
||||
|
||||
//N=19
|
||||
template<class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class RetType=detail::DefaultVoid>
|
||||
class FastDelegate19 {
|
||||
private:
|
||||
typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
|
||||
typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19);
|
||||
typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19);
|
||||
typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19);
|
||||
detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> m_Closure;
|
||||
public:
|
||||
// Typedefs to aid generic programming
|
||||
typedef FastDelegate19 type;
|
||||
|
||||
// Construction and comparison functions
|
||||
FastDelegate19() { clear(); }
|
||||
FastDelegate19(const FastDelegate19 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
void operator = (const FastDelegate19 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
bool operator ==(const FastDelegate19 &x) const {
|
||||
return m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator !=(const FastDelegate19 &x) const {
|
||||
return !m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator <(const FastDelegate19 &x) const {
|
||||
return m_Closure.IsLess(x.m_Closure); }
|
||||
bool operator >(const FastDelegate19 &x) const {
|
||||
return x.m_Closure.IsLess(m_Closure); }
|
||||
// Binding to non-const member functions
|
||||
template < class X, class Y >
|
||||
FastDelegate19(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) ) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19)) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
// Binding to const member functions.
|
||||
template < class X, class Y >
|
||||
FastDelegate19(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
|
||||
// Static functions. We convert them into a member function call.
|
||||
// Note that this also provides a conversion from static functions.
|
||||
FastDelegate19(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate19::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19); }
|
||||
inline bool operator ! () const { // Is it bound to anything?
|
||||
return !m_Closure; }
|
||||
inline bool empty() const {
|
||||
return !m_Closure; }
|
||||
void clear() { m_Closure.clear();}
|
||||
// Conversion to and from the DelegateMemento storage class
|
||||
const DelegateMemento & GetMemento() { return m_Closure; }
|
||||
void SetMemento(const DelegateMemento &any) { m_Closure.CopyFrom(this, any); }
|
||||
|
||||
private: // Invoker for static functions
|
||||
RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) const {
|
||||
return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19); }
|
||||
};
|
||||
|
||||
//N=20
|
||||
template<class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20, class RetType=detail::DefaultVoid>
|
||||
class FastDelegate20 {
|
||||
private:
|
||||
typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
|
||||
typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20);
|
||||
typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20);
|
||||
typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20);
|
||||
detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> m_Closure;
|
||||
public:
|
||||
// Typedefs to aid generic programming
|
||||
typedef FastDelegate20 type;
|
||||
|
||||
// Construction and comparison functions
|
||||
FastDelegate20() { clear(); }
|
||||
FastDelegate20(const FastDelegate20 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
void operator = (const FastDelegate20 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
bool operator ==(const FastDelegate20 &x) const {
|
||||
return m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator !=(const FastDelegate20 &x) const {
|
||||
return !m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator <(const FastDelegate20 &x) const {
|
||||
return m_Closure.IsLess(x.m_Closure); }
|
||||
bool operator >(const FastDelegate20 &x) const {
|
||||
return x.m_Closure.IsLess(m_Closure); }
|
||||
// Binding to non-const member functions
|
||||
template < class X, class Y >
|
||||
FastDelegate20(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) ) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20)) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
// Binding to const member functions.
|
||||
template < class X, class Y >
|
||||
FastDelegate20(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
|
||||
// Static functions. We convert them into a member function call.
|
||||
// Note that this also provides a conversion from static functions.
|
||||
FastDelegate20(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate20::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20); }
|
||||
inline bool operator ! () const { // Is it bound to anything?
|
||||
return !m_Closure; }
|
||||
inline bool empty() const {
|
||||
return !m_Closure; }
|
||||
void clear() { m_Closure.clear();}
|
||||
// Conversion to and from the DelegateMemento storage class
|
||||
const DelegateMemento & GetMemento() { return m_Closure; }
|
||||
void SetMemento(const DelegateMemento &any) { m_Closure.CopyFrom(this, any); }
|
||||
|
||||
private: // Invoker for static functions
|
||||
RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) const {
|
||||
return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20); }
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Fast Delegates, part 4:
|
||||
//
|
||||
//
|
||||
// FastDelegate<> class (Original author: Jody Hagins)
|
||||
// Allows boost::function style syntax like:
|
||||
// FastDelegate< double (int, long) >
|
||||
@ -1962,7 +2222,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -1974,7 +2234,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2000,7 +2260,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2012,7 +2272,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2038,7 +2298,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2050,7 +2310,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2076,7 +2336,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2088,7 +2348,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2114,7 +2374,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2126,7 +2386,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2152,7 +2412,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2164,7 +2424,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2190,7 +2450,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2202,7 +2462,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2228,7 +2488,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2240,7 +2500,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2266,7 +2526,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2278,7 +2538,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2304,7 +2564,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2316,7 +2576,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2342,7 +2602,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2354,7 +2614,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2380,7 +2640,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2392,7 +2652,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2418,7 +2678,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2430,7 +2690,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2456,7 +2716,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2468,7 +2728,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2494,7 +2754,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2506,7 +2766,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2532,7 +2792,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2544,7 +2804,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2570,7 +2830,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2582,7 +2842,159 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
//N=17
|
||||
// Specialization to allow use of
|
||||
// FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17 ) >
|
||||
// instead of
|
||||
// FastDelegate17 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, R >
|
||||
template<typename R, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17>
|
||||
class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17 ) >
|
||||
// Inherit from FastDelegate17 so that it can be treated just
|
||||
// like a FastDelegate17
|
||||
: public FastDelegate17 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, R >
|
||||
{
|
||||
public:
|
||||
// Make using the base type a bit easier via typedef.
|
||||
typedef FastDelegate17 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, R > BaseType;
|
||||
|
||||
// Allow users access to the specific type of this delegate.
|
||||
typedef FastDelegate SelfType;
|
||||
|
||||
// Mimic the base class constructors.
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(const Y *pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17 ) const)
|
||||
: BaseType(pthis, function_to_bind)
|
||||
{ }
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
//N=18
|
||||
// Specialization to allow use of
|
||||
// FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18 ) >
|
||||
// instead of
|
||||
// FastDelegate18 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, R >
|
||||
template<typename R, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18>
|
||||
class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18 ) >
|
||||
// Inherit from FastDelegate18 so that it can be treated just
|
||||
// like a FastDelegate18
|
||||
: public FastDelegate18 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, R >
|
||||
{
|
||||
public:
|
||||
// Make using the base type a bit easier via typedef.
|
||||
typedef FastDelegate18 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, R > BaseType;
|
||||
|
||||
// Allow users access to the specific type of this delegate.
|
||||
typedef FastDelegate SelfType;
|
||||
|
||||
// Mimic the base class constructors.
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(const Y *pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18 ) const)
|
||||
: BaseType(pthis, function_to_bind)
|
||||
{ }
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
//N=19
|
||||
// Specialization to allow use of
|
||||
// FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19 ) >
|
||||
// instead of
|
||||
// FastDelegate19 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, R >
|
||||
template<typename R, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19>
|
||||
class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19 ) >
|
||||
// Inherit from FastDelegate19 so that it can be treated just
|
||||
// like a FastDelegate19
|
||||
: public FastDelegate19 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, R >
|
||||
{
|
||||
public:
|
||||
// Make using the base type a bit easier via typedef.
|
||||
typedef FastDelegate19 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, R > BaseType;
|
||||
|
||||
// Allow users access to the specific type of this delegate.
|
||||
typedef FastDelegate SelfType;
|
||||
|
||||
// Mimic the base class constructors.
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(const Y *pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19 ) const)
|
||||
: BaseType(pthis, function_to_bind)
|
||||
{ }
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
//N=20
|
||||
// Specialization to allow use of
|
||||
// FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20 ) >
|
||||
// instead of
|
||||
// FastDelegate20 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, R >
|
||||
template<typename R, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20>
|
||||
class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20 ) >
|
||||
// Inherit from FastDelegate20 so that it can be treated just
|
||||
// like a FastDelegate20
|
||||
: public FastDelegate20 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, R >
|
||||
{
|
||||
public:
|
||||
// Make using the base type a bit easier via typedef.
|
||||
typedef FastDelegate20 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, R > BaseType;
|
||||
|
||||
// Allow users access to the specific type of this delegate.
|
||||
typedef FastDelegate SelfType;
|
||||
|
||||
// Mimic the base class constructors.
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(const Y *pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20 ) const)
|
||||
: BaseType(pthis, function_to_bind)
|
||||
{ }
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2600,7 +3012,7 @@ public:
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Also declare overloads of a MakeDelegate() global function to
|
||||
// Also declare overloads of a MakeDelegate() global function to
|
||||
// reduce the need for typedefs.
|
||||
// We need seperate overloads for const and non-const member functions.
|
||||
// Also, because of the weird rule about the class of derived member function pointers,
|
||||
@ -2615,282 +3027,346 @@ public:
|
||||
|
||||
#ifdef FASTDLGT_VC6
|
||||
#define FASTDLGT_RETTYPE detail::VoidToDefaultVoid<RetType>::type
|
||||
#else
|
||||
#else
|
||||
#define FASTDLGT_RETTYPE RetType
|
||||
#endif
|
||||
|
||||
//N=0
|
||||
template <class X, class Y, class RetType>
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)()) {
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)()) {
|
||||
return FastDelegate0<FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class RetType>
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)() const) {
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)() const) {
|
||||
return FastDelegate0<FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class RetType>
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)()) {
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)()) {
|
||||
return FastDelegate0<FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=1
|
||||
template <class X, class Y, class Param1, class RetType>
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1)) {
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1)) {
|
||||
return FastDelegate1<Param1, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class RetType>
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1) const) {
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1) const) {
|
||||
return FastDelegate1<Param1, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class RetType>
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1)) {
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1)) {
|
||||
return FastDelegate1<Param1, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=2
|
||||
template <class X, class Y, class Param1, class Param2, class RetType>
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2)) {
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2)) {
|
||||
return FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class RetType>
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2) const) {
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2) const) {
|
||||
return FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class RetType>
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2)) {
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2)) {
|
||||
return FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=3
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class RetType>
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3)) {
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3)) {
|
||||
return FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class RetType>
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3) const) {
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3) const) {
|
||||
return FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class RetType>
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3)) {
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3)) {
|
||||
return FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=4
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class RetType>
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
|
||||
return FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class RetType>
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const) {
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const) {
|
||||
return FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class RetType>
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
|
||||
return FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=5
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class RetType>
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
|
||||
return FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class RetType>
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const) {
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const) {
|
||||
return FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class RetType>
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
|
||||
return FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=6
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class RetType>
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
|
||||
return FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class RetType>
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const) {
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const) {
|
||||
return FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class RetType>
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
|
||||
return FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=7
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class RetType>
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
|
||||
return FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class RetType>
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const) {
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const) {
|
||||
return FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class RetType>
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
|
||||
return FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=8
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class RetType>
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
|
||||
return FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class RetType>
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const) {
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const) {
|
||||
return FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class RetType>
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
|
||||
return FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=9
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class RetType>
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9)) {
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9)) {
|
||||
return FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class RetType>
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9) const) {
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9) const) {
|
||||
return FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class RetType>
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9)) {
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9)) {
|
||||
return FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=10
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class RetType>
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10)) {
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10)) {
|
||||
return FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class RetType>
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10) const) {
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10) const) {
|
||||
return FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class RetType>
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10)) {
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10)) {
|
||||
return FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=11
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class RetType>
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11)) {
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11)) {
|
||||
return FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class RetType>
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11) const) {
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11) const) {
|
||||
return FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class RetType>
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11)) {
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11)) {
|
||||
return FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=12
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class RetType>
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12)) {
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12)) {
|
||||
return FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class RetType>
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12) const) {
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12) const) {
|
||||
return FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class RetType>
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12)) {
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12)) {
|
||||
return FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=13
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class RetType>
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13)) {
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13)) {
|
||||
return FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class RetType>
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13) const) {
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13) const) {
|
||||
return FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class RetType>
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13)) {
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13)) {
|
||||
return FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=14
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class RetType>
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14)) {
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14)) {
|
||||
return FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class RetType>
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14) const) {
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14) const) {
|
||||
return FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class RetType>
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14)) {
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14)) {
|
||||
return FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=15
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class RetType>
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15)) {
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15)) {
|
||||
return FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class RetType>
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15) const) {
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15) const) {
|
||||
return FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class RetType>
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15)) {
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15)) {
|
||||
return FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=16
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class RetType>
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16)) {
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16)) {
|
||||
return FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class RetType>
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16) const) {
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16) const) {
|
||||
return FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class RetType>
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16)) {
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16)) {
|
||||
return FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=17
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class RetType>
|
||||
FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17)) {
|
||||
return FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class RetType>
|
||||
FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) const) {
|
||||
return FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class RetType>
|
||||
FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17)) {
|
||||
return FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=18
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class RetType>
|
||||
FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18)) {
|
||||
return FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class RetType>
|
||||
FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) const) {
|
||||
return FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class RetType>
|
||||
FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18)) {
|
||||
return FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=19
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class RetType>
|
||||
FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19)) {
|
||||
return FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class RetType>
|
||||
FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) const) {
|
||||
return FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class RetType>
|
||||
FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19)) {
|
||||
return FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=20
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20, class RetType>
|
||||
FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20)) {
|
||||
return FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20, class RetType>
|
||||
FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) const) {
|
||||
return FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20, class RetType>
|
||||
FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20)) {
|
||||
return FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
|
||||
// clean up after ourselves...
|
||||
#undef FASTDLGT_RETTYPE
|
||||
|
@ -1,11 +1,11 @@
|
||||
// FastDelegate.h
|
||||
// FastDelegate.h
|
||||
// Efficient delegates in C++ that generate only two lines of asm code!
|
||||
// Documentation is found at http://www.codeproject.com/cpp/FastDelegate.asp
|
||||
//
|
||||
// - Don Clugston, Mar 2004.
|
||||
// Major contributions were made by Jody Hagins.
|
||||
// History:
|
||||
// 24-Apr-04 1.0 Submitted to CodeProject.
|
||||
// 24-Apr-04 1.0 Submitted to CodeProject.
|
||||
// 28-Apr-04 1.1 * Prevent most unsafe uses of evil static function hack.
|
||||
// * Improved syntax for horrible_cast (thanks Paul Bludov).
|
||||
// * Tested on Metrowerks MWCC and Intel ICL (IA32)
|
||||
@ -13,7 +13,7 @@
|
||||
// 27-Jun-04 1.2 * Now works on Borland C++ Builder 5.5
|
||||
// * Now works on /clr "managed C++" code on VC7, VC7.1
|
||||
// * Comeau C++ now compiles without warnings.
|
||||
// * Prevent the virtual inheritance case from being used on
|
||||
// * Prevent the virtual inheritance case from being used on
|
||||
// VC6 and earlier, which generate incorrect code.
|
||||
// * Improved warning and error messages. Non-standard hacks
|
||||
// now have compile-time checks to make them safer.
|
||||
@ -37,7 +37,7 @@
|
||||
// * Standardised all the compiler-specific workarounds.
|
||||
// * MFP conversion now works for CodePlay (but not yet supported in the full code).
|
||||
// * Now compiles without warnings on _any_ compiler, including BCC 5.5.1
|
||||
// * New syntax: FastDelegate< int (char *, double) >.
|
||||
// * New syntax: FastDelegate< int (char *, double) >.
|
||||
|
||||
#ifndef FASTDELEGATE_H
|
||||
#define FASTDELEGATE_H
|
||||
@ -58,7 +58,7 @@
|
||||
// Uncomment the following #define for optimally-sized delegates.
|
||||
// In this case, the generated asm code is almost identical to the code you'd get
|
||||
// if the compiler had native support for delegates.
|
||||
// It will not work on systems where sizeof(dataptr) < sizeof(codeptr).
|
||||
// It will not work on systems where sizeof(dataptr) < sizeof(codeptr).
|
||||
// Thus, it will not work for DOS compilers using the medium model.
|
||||
// It will also probably fail on some DSP systems.
|
||||
#define FASTDELEGATE_USESTATICFUNCTIONHACK
|
||||
@ -86,7 +86,7 @@
|
||||
|
||||
// Does the compiler uses Microsoft's member function pointer structure?
|
||||
// If so, it needs special treatment.
|
||||
// Metrowerks CodeWarrior, Intel, and CodePlay fraudulently define Microsoft's
|
||||
// Metrowerks CodeWarrior, Intel, and CodePlay fraudulently define Microsoft's
|
||||
// identifier, _MSC_VER. We need to filter Metrowerks out.
|
||||
#if defined(_MSC_VER) && !defined(__MWERKS__)
|
||||
#define FASTDLGT_MICROSOFT_MFP
|
||||
@ -112,7 +112,7 @@
|
||||
#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__ // Workaround GCC bug #8271
|
||||
#ifdef __GNUC__ // Workaround GCC bug #8271
|
||||
// At present, GCC doesn't recognize constness of MFPs in templates
|
||||
#define FASTDELEGATE_GCC_BUG_8271
|
||||
#endif
|
||||
@ -140,10 +140,10 @@ namespace fastdelegate {
|
||||
namespace detail { // we'll hide the implementation details in a nested namespace.
|
||||
|
||||
// implicit_cast< >
|
||||
// I believe this was originally going to be in the C++ standard but
|
||||
// I believe this was originally going to be in the C++ standard but
|
||||
// was left out by accident. It's even milder than static_cast.
|
||||
// I use it instead of static_cast<> to emphasize that I'm not doing
|
||||
// anything nasty.
|
||||
// anything nasty.
|
||||
// Usage is identical to static_cast<>
|
||||
template <class OutputClass, class InputClass>
|
||||
inline OutputClass implicit_cast(InputClass input){
|
||||
@ -151,11 +151,11 @@ inline OutputClass implicit_cast(InputClass input){
|
||||
}
|
||||
|
||||
// horrible_cast< >
|
||||
// This is truly evil. It completely subverts C++'s type system, allowing you
|
||||
// to cast from any class to any other class. Technically, using a union
|
||||
// This is truly evil. It completely subverts C++'s type system, allowing you
|
||||
// to cast from any class to any other class. Technically, using a union
|
||||
// to perform the cast is undefined behaviour (even in C). But we can see if
|
||||
// it is OK by checking that the union is the same size as each of its members.
|
||||
// horrible_cast<> should only be used for compiler-specific workarounds.
|
||||
// horrible_cast<> should only be used for compiler-specific workarounds.
|
||||
// Usage is identical to reinterpret_cast<>.
|
||||
|
||||
// This union is declared outside the horrible_cast because BCC 5.5.1
|
||||
@ -172,7 +172,7 @@ inline OutputClass horrible_cast(const InputClass input){
|
||||
// Cause a compile-time error if in, out and u are not the same size.
|
||||
// If the compile fails here, it means the compiler has peculiar
|
||||
// unions which would prevent the cast from working.
|
||||
typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u)
|
||||
typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u)
|
||||
&& sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1];
|
||||
u.in = input;
|
||||
return u.out;
|
||||
@ -203,9 +203,9 @@ inline OutputClass horrible_cast(const InputClass input){
|
||||
// Workaround for (2): On VC6, the code for calling a void function is
|
||||
// identical to the code for calling a non-void function in which the
|
||||
// return value is never used, provided the return value is returned
|
||||
// in the EAX register, rather than on the stack.
|
||||
// in the EAX register, rather than on the stack.
|
||||
// This is true for most fundamental types such as int, enum, void *.
|
||||
// Const void * is the safest option since it doesn't participate
|
||||
// Const void * is the safest option since it doesn't participate
|
||||
// in any automatic conversions. But on a 16-bit compiler it might
|
||||
// cause extra code to be generated, so we disable it for all compilers
|
||||
// except for VC6 (and VC5).
|
||||
@ -251,15 +251,15 @@ struct VoidToDefaultVoid<void> { typedef DefaultVoid type; };
|
||||
#ifdef FASTDLGT_MICROSOFT_MFP
|
||||
|
||||
#ifdef FASTDLGT_HASINHERITANCE_KEYWORDS
|
||||
// For Microsoft and Intel, we want to ensure that it's the most efficient type of MFP
|
||||
// (4 bytes), even when the /vmg option is used. Declaring an empty class
|
||||
// For Microsoft and Intel, we want to ensure that it's the most efficient type of MFP
|
||||
// (4 bytes), even when the /vmg option is used. Declaring an empty class
|
||||
// would give 16 byte pointers in this case....
|
||||
class __single_inheritance GenericClass;
|
||||
#endif
|
||||
// ...but for Codeplay, an empty class *always* gives 4 byte pointers.
|
||||
// If compiled with the /clr option ("managed C++"), the JIT compiler thinks
|
||||
// it needs to load GenericClass before it can call any of its functions,
|
||||
// (compiles OK but crashes at runtime!), so we need to declare an
|
||||
// (compiles OK but crashes at runtime!), so we need to declare an
|
||||
// empty class to make it happy.
|
||||
// Codeplay and VC4 can't cope with the unknown_inheritance case either.
|
||||
class GenericClass {};
|
||||
@ -272,41 +272,41 @@ const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)());
|
||||
|
||||
// SimplifyMemFunc< >::Convert()
|
||||
//
|
||||
// A template function that converts an arbitrary member function pointer into the
|
||||
// A template function that converts an arbitrary member function pointer into the
|
||||
// simplest possible form of member function pointer, using a supplied 'this' pointer.
|
||||
// According to the standard, this can be done legally with reinterpret_cast<>.
|
||||
// For (non-standard) compilers which use member function pointers which vary in size
|
||||
// depending on the class, we need to use knowledge of the internal structure of a
|
||||
// For (non-standard) compilers which use member function pointers which vary in size
|
||||
// depending on the class, we need to use knowledge of the internal structure of a
|
||||
// member function pointer, as used by the compiler. Template specialization is used
|
||||
// to distinguish between the sizes. Because some compilers don't support partial
|
||||
// to distinguish between the sizes. Because some compilers don't support partial
|
||||
// template specialisation, I use full specialisation of a wrapper struct.
|
||||
|
||||
// general case -- don't know how to convert it. Force a compile failure
|
||||
template <int N>
|
||||
struct SimplifyMemFunc {
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
// Unsupported member function type -- force a compile failure.
|
||||
// (it's illegal to have a array with negative size).
|
||||
typedef char ERROR_Unsupported_member_function_pointer_on_this_compiler[N-100];
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
// For compilers where all member func ptrs are the same size, everything goes here.
|
||||
// For non-standard compilers, only single_inheritance classes go here.
|
||||
template <>
|
||||
struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE> {
|
||||
struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE> {
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
#if defined __DMC__
|
||||
// Digital Mars doesn't allow you to cast between abitrary PMF's,
|
||||
#if defined __DMC__
|
||||
// Digital Mars doesn't allow you to cast between abitrary PMF's,
|
||||
// even though the standard says you can. The 32-bit compiler lets you
|
||||
// static_cast through an int, but the DOS compiler doesn't.
|
||||
bound_func = horrible_cast<GenericMemFuncType>(function_to_bind);
|
||||
#else
|
||||
#else
|
||||
bound_func = reinterpret_cast<GenericMemFuncType>(function_to_bind);
|
||||
#endif
|
||||
return reinterpret_cast<GenericClass *>(pthis);
|
||||
@ -334,13 +334,13 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE> {
|
||||
template<>
|
||||
struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
// We need to use a horrible_cast to do this conversion.
|
||||
// In MSVC, a multiple inheritance member pointer is internally defined as:
|
||||
union {
|
||||
XFuncType func;
|
||||
struct {
|
||||
struct {
|
||||
GenericMemFuncType funcaddress; // points to the actual member function
|
||||
int delta; // #BYTES to be added to the 'this' pointer
|
||||
}s;
|
||||
@ -349,7 +349,7 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
|
||||
typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)? 1 : -1];
|
||||
u.func = function_to_bind;
|
||||
bound_func = u.s.funcaddress;
|
||||
return reinterpret_cast<GenericClass *>(reinterpret_cast<char *>(pthis) + u.s.delta);
|
||||
return reinterpret_cast<GenericClass *>(reinterpret_cast<char *>(pthis) + u.s.delta);
|
||||
}
|
||||
};
|
||||
|
||||
@ -358,10 +358,10 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
|
||||
// enable conversion to a closure pointer. Earlier versions of this code didn't
|
||||
// work for all cases, and generated a compile-time error instead.
|
||||
// But a very clever hack invented by John M. Dlugosz solves this problem.
|
||||
// My code is somewhat different to his: I have no asm code, and I make no
|
||||
// My code is somewhat different to his: I have no asm code, and I make no
|
||||
// assumptions about the calling convention that is used.
|
||||
|
||||
// In VC++ and ICL, a virtual_inheritance member pointer
|
||||
// In VC++ and ICL, a virtual_inheritance member pointer
|
||||
// is internally defined as:
|
||||
struct MicrosoftVirtualMFP {
|
||||
void (GenericClass::*codeptr)(); // points to the actual member function
|
||||
@ -389,7 +389,7 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 2*sizeof(int) >
|
||||
{
|
||||
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
union {
|
||||
XFuncType func;
|
||||
@ -406,7 +406,7 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 2*sizeof(int) >
|
||||
typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)
|
||||
&& sizeof(function_to_bind)==sizeof(u.ProbeFunc)
|
||||
&& sizeof(u2.virtfunc)==sizeof(u2.s) ? 1 : -1];
|
||||
// Unfortunately, taking the address of a MF prevents it from being inlined, so
|
||||
// Unfortunately, taking the address of a MF prevents it from being inlined, so
|
||||
// this next line can't be completely optimised away by the compiler.
|
||||
u2.virtfunc = &GenericVirtualClass::GetThis;
|
||||
u.s.codeptr = u2.s.codeptr;
|
||||
@ -423,55 +423,55 @@ template <>
|
||||
struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
{
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
// There is an apalling but obscure compiler bug in MSVC6 and earlier:
|
||||
// vtable_index and 'vtordisp' are always set to 0 in the
|
||||
// vtable_index and 'vtordisp' are always set to 0 in the
|
||||
// unknown_inheritance case!
|
||||
// This means that an incorrect function could be called!!!
|
||||
// Compiling with the /vmg option leads to potentially incorrect code.
|
||||
// This is probably the reason that the IDE has a user interface for specifying
|
||||
// the /vmg option, but it is disabled - you can only specify /vmg on
|
||||
// the /vmg option, but it is disabled - you can only specify /vmg on
|
||||
// the command line. In VC1.5 and earlier, the compiler would ICE if it ever
|
||||
// encountered this situation.
|
||||
// It is OK to use the /vmg option if /vmm or /vms is specified.
|
||||
|
||||
// Fortunately, the wrong function is only called in very obscure cases.
|
||||
// It only occurs when a derived class overrides a virtual function declared
|
||||
// in a virtual base class, and the member function
|
||||
// It only occurs when a derived class overrides a virtual function declared
|
||||
// in a virtual base class, and the member function
|
||||
// points to the *Derived* version of that function. The problem can be
|
||||
// completely averted in 100% of cases by using the *Base class* for the
|
||||
// completely averted in 100% of cases by using the *Base class* for the
|
||||
// member fpointer. Ie, if you use the base class as an interface, you'll
|
||||
// stay out of trouble.
|
||||
// Occasionally, you might want to point directly to a derived class function
|
||||
// that isn't an override of a base class. In this case, both vtable_index
|
||||
// that isn't an override of a base class. In this case, both vtable_index
|
||||
// and 'vtordisp' are zero, but a virtual_inheritance pointer will be generated.
|
||||
// We can generate correct code in this case. To prevent an incorrect call from
|
||||
// ever being made, on MSVC6 we generate a warning, and call a function to
|
||||
// make the program crash instantly.
|
||||
// ever being made, on MSVC6 we generate a warning, and call a function to
|
||||
// make the program crash instantly.
|
||||
typedef char ERROR_VC6CompilerBug[-100];
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#else
|
||||
#else
|
||||
|
||||
// Nasty hack for Microsoft and Intel (IA32 and Itanium)
|
||||
// unknown_inheritance classes go here
|
||||
// unknown_inheritance classes go here
|
||||
// This is probably the ugliest bit of code I've ever written. Look at the casts!
|
||||
// There is a compiler bug in MSVC6 which prevents it from using this code.
|
||||
template <>
|
||||
struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
{
|
||||
template <class X, class XFuncType, class GenericMemFuncType>
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||
GenericMemFuncType &bound_func) {
|
||||
// The member function pointer is 16 bytes long. We can't use a normal cast, but
|
||||
// we can use a union to do the conversion.
|
||||
union {
|
||||
XFuncType func;
|
||||
// In VC++ and ICL, an unknown_inheritance member pointer
|
||||
// In VC++ and ICL, an unknown_inheritance member pointer
|
||||
// is internally defined as:
|
||||
struct {
|
||||
GenericMemFuncType m_funcaddress; // points to the actual member function
|
||||
@ -486,13 +486,13 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
bound_func = u.s.funcaddress;
|
||||
int virtual_delta = 0;
|
||||
if (u.s.vtable_index) { // Virtual inheritance is used
|
||||
// First, get to the vtable.
|
||||
// First, get to the vtable.
|
||||
// It is 'vtordisp' bytes from the start of the class.
|
||||
const int * vtable = *reinterpret_cast<const int *const*>(
|
||||
reinterpret_cast<const char *>(pthis) + u.s.vtordisp );
|
||||
|
||||
// 'vtable_index' tells us where in the table we should be looking.
|
||||
virtual_delta = u.s.vtordisp + *reinterpret_cast<const int *>(
|
||||
virtual_delta = u.s.vtordisp + *reinterpret_cast<const int *>(
|
||||
reinterpret_cast<const char *>(vtable) + u.s.vtable_index);
|
||||
}
|
||||
// The int at 'virtual_delta' gives us the amount to add to 'this'.
|
||||
@ -518,7 +518,7 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
// It knows nothing about the calling convention or number of arguments used by
|
||||
// the function pointed to.
|
||||
// It supplies comparison operators so that it can be stored in STL collections.
|
||||
// It cannot be set to anything other than null, nor invoked directly:
|
||||
// It cannot be set to anything other than null, nor invoked directly:
|
||||
// it must be converted to a specific delegate.
|
||||
|
||||
// Implementation:
|
||||
@ -526,7 +526,7 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
// DelegateMemento - Safe version
|
||||
//
|
||||
// This implementation is standard-compliant, but a bit tricky.
|
||||
// A static function pointer is stored inside the class.
|
||||
// A static function pointer is stored inside the class.
|
||||
// Here are the valid values:
|
||||
// +-- Static pointer --+--pThis --+-- pMemFunc-+-- Meaning------+
|
||||
// | 0 | 0 | 0 | Empty |
|
||||
@ -539,18 +539,18 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||
|
||||
// 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
|
||||
// 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|
|
||||
// +----------+------------+-------------------------------+
|
||||
// Note that the Sun C++ and MSVC documentation explicitly state that they
|
||||
// Note that the Sun C++ and MSVC documentation explicitly state that they
|
||||
// support static_cast between void * and function pointers.
|
||||
|
||||
class DelegateMemento {
|
||||
protected:
|
||||
protected:
|
||||
// the data is protected, not private, because many
|
||||
// compilers have problems with template friends.
|
||||
typedef void (detail::GenericClass::*GenericMemFuncType)(); // arbitrary MFP.
|
||||
@ -593,11 +593,11 @@ public:
|
||||
inline bool IsLess(const DelegateMemento &right) const {
|
||||
// deal with static function pointers first
|
||||
#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
|
||||
if (m_pStaticFunction !=0 || right.m_pStaticFunction!=0)
|
||||
if (m_pStaticFunction !=0 || right.m_pStaticFunction!=0)
|
||||
return m_pStaticFunction < right.m_pStaticFunction;
|
||||
#endif
|
||||
if (m_pthis !=right.m_pthis) return m_pthis < right.m_pthis;
|
||||
// There are no ordering operators for member function pointers,
|
||||
// There are no ordering operators for member function pointers,
|
||||
// but we can fake one by comparing each byte. The resulting ordering is
|
||||
// arbitrary (and compiler-dependent), but it permits storage in ordered STL containers.
|
||||
return memcmp(&m_pFunction, &right.m_pFunction, sizeof(m_pFunction)) < 0;
|
||||
@ -607,7 +607,7 @@ public:
|
||||
{ return m_pFunction==0; }
|
||||
public:
|
||||
DelegateMemento & operator = (const DelegateMemento &right) {
|
||||
SetMementoFrom(right);
|
||||
SetMementoFrom(right);
|
||||
return *this;
|
||||
}
|
||||
inline bool operator <(const DelegateMemento &right) {
|
||||
@ -616,8 +616,8 @@ public:
|
||||
inline bool operator >(const DelegateMemento &right) {
|
||||
return right.IsLess(*this);
|
||||
}
|
||||
DelegateMemento (const DelegateMemento &right) :
|
||||
m_pthis(right.m_pthis), m_pFunction(right.m_pFunction)
|
||||
DelegateMemento (const DelegateMemento &right) :
|
||||
m_pthis(right.m_pthis), m_pFunction(right.m_pFunction)
|
||||
#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
|
||||
, m_pStaticFunction (right.m_pStaticFunction)
|
||||
#endif
|
||||
@ -638,8 +638,8 @@ protected:
|
||||
// A private wrapper class that adds function signatures to DelegateMemento.
|
||||
// It's the class that does most of the actual work.
|
||||
// The signatures are specified by:
|
||||
// GenericMemFunc: must be a type of GenericClass member function pointer.
|
||||
// StaticFuncPtr: must be a type of function pointer with the same signature
|
||||
// GenericMemFunc: must be a type of GenericClass member function pointer.
|
||||
// StaticFuncPtr: must be a type of function pointer with the same signature
|
||||
// as GenericMemFunc.
|
||||
// UnvoidStaticFuncPtr: is the same as StaticFuncPtr, except on VC6
|
||||
// where it never returns void (returns DefaultVoid instead).
|
||||
@ -655,8 +655,8 @@ class ClosurePtr : public DelegateMemento {
|
||||
public:
|
||||
// These functions are for setting the delegate to a member function.
|
||||
|
||||
// Here's the clever bit: we convert an arbitrary member function into a
|
||||
// standard form. XMemFunc should be a member function of class X, but I can't
|
||||
// Here's the clever bit: we convert an arbitrary member function into a
|
||||
// standard form. XMemFunc should be a member function of class X, but I can't
|
||||
// enforce that here. It needs to be enforced by the wrapper class.
|
||||
template < class X, class XMemFunc >
|
||||
inline void bindmemfunc(X *pthis, XMemFunc function_to_bind ) {
|
||||
@ -667,7 +667,7 @@ public:
|
||||
#endif
|
||||
}
|
||||
// For const member functions, we only need a const class pointer.
|
||||
// Since we know that the member function is const, it's safe to
|
||||
// Since we know that the member function is const, it's safe to
|
||||
// remove the const qualifier from the 'this' pointer with a const_cast.
|
||||
// VC6 has problems if we just overload 'bindmemfunc', so we give it a different name.
|
||||
template < class X, class XMemFunc>
|
||||
@ -717,47 +717,47 @@ public:
|
||||
m_pthis=reinterpret_cast<GenericClass *>(pParent);
|
||||
}
|
||||
}
|
||||
// For static functions, the 'static_function_invoker' class in the parent
|
||||
// will be called. The parent then needs to call GetStaticFunction() to find out
|
||||
// For static functions, the 'static_function_invoker' class in the parent
|
||||
// will be called. The parent then needs to call GetStaticFunction() to find out
|
||||
// the actual function to invoke.
|
||||
template < class DerivedClass, class ParentInvokerSig >
|
||||
inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
|
||||
inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
|
||||
StaticFuncPtr function_to_bind ) {
|
||||
bindmemfunc(pParent, static_function_invoker);
|
||||
m_pStaticFunction=reinterpret_cast<GenericFuncPtr>(function_to_bind);
|
||||
}
|
||||
inline UnvoidStaticFuncPtr GetStaticFunction() const {
|
||||
return reinterpret_cast<UnvoidStaticFuncPtr>(m_pStaticFunction);
|
||||
inline UnvoidStaticFuncPtr GetStaticFunction() const {
|
||||
return reinterpret_cast<UnvoidStaticFuncPtr>(m_pStaticFunction);
|
||||
}
|
||||
#else
|
||||
|
||||
// ClosurePtr<> - 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
|
||||
// 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. Invocation isn't any faster, but it saves 4 bytes, and
|
||||
// speeds up comparison and assignment. If C++ provided direct language support
|
||||
// for delegates, they would produce asm code that was almost identical to this.
|
||||
// Note that the Sun C++ and MSVC documentation explicitly state that they
|
||||
// Note that the Sun C++ and MSVC documentation explicitly state that they
|
||||
// support static_cast between void * and function pointers.
|
||||
|
||||
template< class DerivedClass >
|
||||
inline void CopyFrom (DerivedClass *pParent, const DelegateMemento &right) {
|
||||
SetMementoFrom(right);
|
||||
}
|
||||
// For static functions, the 'static_function_invoker' class in the parent
|
||||
// will be called. The parent then needs to call GetStaticFunction() to find out
|
||||
// For static functions, the 'static_function_invoker' class in the parent
|
||||
// will be called. The parent then needs to call GetStaticFunction() to find out
|
||||
// the actual function to invoke.
|
||||
// ******** EVIL, EVIL CODE! *******
|
||||
template < class DerivedClass, class ParentInvokerSig>
|
||||
inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
|
||||
inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
|
||||
StaticFuncPtr function_to_bind) {
|
||||
// We'll be ignoring the 'this' pointer, but we need to make sure we pass
|
||||
// a valid value to bindmemfunc().
|
||||
bindmemfunc(pParent, static_function_invoker);
|
||||
|
||||
// WARNING! Evil hack. We store the function in the 'this' pointer!
|
||||
// Ensure that there's a compilation failure if function pointers
|
||||
// Ensure that there's a compilation failure if function pointers
|
||||
// and data pointers have different sizes.
|
||||
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
|
||||
typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1];
|
||||
@ -772,7 +772,7 @@ public:
|
||||
// We're just returning the 'this' pointer, converted into
|
||||
// a function pointer!
|
||||
inline UnvoidStaticFuncPtr GetStaticFunction() const {
|
||||
// Ensure that there's a compilation failure if function pointers
|
||||
// Ensure that there's a compilation failure if function pointers
|
||||
// and data pointers have different sizes.
|
||||
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
|
||||
typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1];
|
||||
@ -794,7 +794,7 @@ public:
|
||||
|
||||
|
||||
// Once we have the member function conversion templates, it's easy to make the
|
||||
// wrapper classes. So that they will work with as many compilers as possible,
|
||||
// wrapper classes. So that they will work with as many compilers as possible,
|
||||
// the classes are of the form
|
||||
// FastDelegate3<int, char *, double>
|
||||
// They can cope with any combination of parameters. The max number of parameters
|
||||
@ -805,7 +805,7 @@ public:
|
||||
|
||||
// Because of the weird rule about the class of derived member function pointers,
|
||||
// you sometimes need to apply a downcast to the 'this' pointer.
|
||||
// This is the reason for the use of "implicit_cast<X*>(pthis)" in the code below.
|
||||
// This is the reason for the use of "implicit_cast<X*>(pthis)" in the code below.
|
||||
// If CDerivedClass is derived from CBaseClass, but doesn't override SimpleVirtualFunction,
|
||||
// without this trick you'd need to write:
|
||||
// MyDelegate(static_cast<CBaseClass *>(&d), &CDerivedClass::SimpleVirtualFunction);
|
||||
@ -862,7 +862,7 @@ public:
|
||||
FastDelegate0(DesiredRetType (*function_to_bind)() ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)()) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate0::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate0::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() () const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -927,7 +927,7 @@ public:
|
||||
FastDelegate1(DesiredRetType (*function_to_bind)(Param1 p1) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate1::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate1::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -992,7 +992,7 @@ public:
|
||||
FastDelegate2(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate2::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate2::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1057,7 +1057,7 @@ public:
|
||||
FastDelegate3(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate3::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate3::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1122,7 +1122,7 @@ public:
|
||||
FastDelegate4(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate4::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate4::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1187,7 +1187,7 @@ public:
|
||||
FastDelegate5(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate5::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate5::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1252,7 +1252,7 @@ public:
|
||||
FastDelegate6(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate6::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate6::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1317,7 +1317,7 @@ public:
|
||||
FastDelegate7(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate7::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate7::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1382,7 +1382,7 @@ public:
|
||||
FastDelegate8(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate8::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate8::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1447,7 +1447,7 @@ public:
|
||||
FastDelegate9(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate9::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate9::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1512,7 +1512,7 @@ public:
|
||||
FastDelegate10(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate10::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate10::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1577,7 +1577,7 @@ public:
|
||||
FastDelegate11(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate11::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate11::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1642,7 +1642,7 @@ public:
|
||||
FastDelegate12(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate12::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate12::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1707,7 +1707,7 @@ public:
|
||||
FastDelegate13(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate13::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate13::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1772,7 +1772,7 @@ public:
|
||||
FastDelegate14(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate14::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate14::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1837,7 +1837,7 @@ public:
|
||||
FastDelegate15(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate15::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate15::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1902,7 +1902,7 @@ public:
|
||||
FastDelegate16(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate16::InvokeStaticFunction,
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate16::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
@ -1921,10 +1921,270 @@ private: // Invoker for static functions
|
||||
return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16); }
|
||||
};
|
||||
|
||||
//N=17
|
||||
template<class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class RetType=detail::DefaultVoid>
|
||||
class FastDelegate17 {
|
||||
private:
|
||||
typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
|
||||
typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17);
|
||||
typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17);
|
||||
typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17);
|
||||
detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> m_Closure;
|
||||
public:
|
||||
// Typedefs to aid generic programming
|
||||
typedef FastDelegate17 type;
|
||||
|
||||
// Construction and comparison functions
|
||||
FastDelegate17() { clear(); }
|
||||
FastDelegate17(const FastDelegate17 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
void operator = (const FastDelegate17 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
bool operator ==(const FastDelegate17 &x) const {
|
||||
return m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator !=(const FastDelegate17 &x) const {
|
||||
return !m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator <(const FastDelegate17 &x) const {
|
||||
return m_Closure.IsLess(x.m_Closure); }
|
||||
bool operator >(const FastDelegate17 &x) const {
|
||||
return x.m_Closure.IsLess(m_Closure); }
|
||||
// Binding to non-const member functions
|
||||
template < class X, class Y >
|
||||
FastDelegate17(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) ) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17)) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
// Binding to const member functions.
|
||||
template < class X, class Y >
|
||||
FastDelegate17(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
|
||||
// Static functions. We convert them into a member function call.
|
||||
// Note that this also provides a conversion from static functions.
|
||||
FastDelegate17(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate17::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); }
|
||||
inline bool operator ! () const { // Is it bound to anything?
|
||||
return !m_Closure; }
|
||||
inline bool empty() const {
|
||||
return !m_Closure; }
|
||||
void clear() { m_Closure.clear();}
|
||||
// Conversion to and from the DelegateMemento storage class
|
||||
const DelegateMemento & GetMemento() { return m_Closure; }
|
||||
void SetMemento(const DelegateMemento &any) { m_Closure.CopyFrom(this, any); }
|
||||
|
||||
private: // Invoker for static functions
|
||||
RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) const {
|
||||
return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17); }
|
||||
};
|
||||
|
||||
//N=18
|
||||
template<class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class RetType=detail::DefaultVoid>
|
||||
class FastDelegate18 {
|
||||
private:
|
||||
typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
|
||||
typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18);
|
||||
typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18);
|
||||
typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18);
|
||||
detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> m_Closure;
|
||||
public:
|
||||
// Typedefs to aid generic programming
|
||||
typedef FastDelegate18 type;
|
||||
|
||||
// Construction and comparison functions
|
||||
FastDelegate18() { clear(); }
|
||||
FastDelegate18(const FastDelegate18 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
void operator = (const FastDelegate18 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
bool operator ==(const FastDelegate18 &x) const {
|
||||
return m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator !=(const FastDelegate18 &x) const {
|
||||
return !m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator <(const FastDelegate18 &x) const {
|
||||
return m_Closure.IsLess(x.m_Closure); }
|
||||
bool operator >(const FastDelegate18 &x) const {
|
||||
return x.m_Closure.IsLess(m_Closure); }
|
||||
// Binding to non-const member functions
|
||||
template < class X, class Y >
|
||||
FastDelegate18(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) ) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18)) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
// Binding to const member functions.
|
||||
template < class X, class Y >
|
||||
FastDelegate18(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
|
||||
// Static functions. We convert them into a member function call.
|
||||
// Note that this also provides a conversion from static functions.
|
||||
FastDelegate18(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate18::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18); }
|
||||
inline bool operator ! () const { // Is it bound to anything?
|
||||
return !m_Closure; }
|
||||
inline bool empty() const {
|
||||
return !m_Closure; }
|
||||
void clear() { m_Closure.clear();}
|
||||
// Conversion to and from the DelegateMemento storage class
|
||||
const DelegateMemento & GetMemento() { return m_Closure; }
|
||||
void SetMemento(const DelegateMemento &any) { m_Closure.CopyFrom(this, any); }
|
||||
|
||||
private: // Invoker for static functions
|
||||
RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) const {
|
||||
return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18); }
|
||||
};
|
||||
|
||||
//N=19
|
||||
template<class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class RetType=detail::DefaultVoid>
|
||||
class FastDelegate19 {
|
||||
private:
|
||||
typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
|
||||
typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19);
|
||||
typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19);
|
||||
typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19);
|
||||
detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> m_Closure;
|
||||
public:
|
||||
// Typedefs to aid generic programming
|
||||
typedef FastDelegate19 type;
|
||||
|
||||
// Construction and comparison functions
|
||||
FastDelegate19() { clear(); }
|
||||
FastDelegate19(const FastDelegate19 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
void operator = (const FastDelegate19 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
bool operator ==(const FastDelegate19 &x) const {
|
||||
return m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator !=(const FastDelegate19 &x) const {
|
||||
return !m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator <(const FastDelegate19 &x) const {
|
||||
return m_Closure.IsLess(x.m_Closure); }
|
||||
bool operator >(const FastDelegate19 &x) const {
|
||||
return x.m_Closure.IsLess(m_Closure); }
|
||||
// Binding to non-const member functions
|
||||
template < class X, class Y >
|
||||
FastDelegate19(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) ) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19)) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
// Binding to const member functions.
|
||||
template < class X, class Y >
|
||||
FastDelegate19(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
|
||||
// Static functions. We convert them into a member function call.
|
||||
// Note that this also provides a conversion from static functions.
|
||||
FastDelegate19(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate19::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19); }
|
||||
inline bool operator ! () const { // Is it bound to anything?
|
||||
return !m_Closure; }
|
||||
inline bool empty() const {
|
||||
return !m_Closure; }
|
||||
void clear() { m_Closure.clear();}
|
||||
// Conversion to and from the DelegateMemento storage class
|
||||
const DelegateMemento & GetMemento() { return m_Closure; }
|
||||
void SetMemento(const DelegateMemento &any) { m_Closure.CopyFrom(this, any); }
|
||||
|
||||
private: // Invoker for static functions
|
||||
RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) const {
|
||||
return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19); }
|
||||
};
|
||||
|
||||
//N=20
|
||||
template<class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20, class RetType=detail::DefaultVoid>
|
||||
class FastDelegate20 {
|
||||
private:
|
||||
typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
|
||||
typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20);
|
||||
typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20);
|
||||
typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20);
|
||||
detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> m_Closure;
|
||||
public:
|
||||
// Typedefs to aid generic programming
|
||||
typedef FastDelegate20 type;
|
||||
|
||||
// Construction and comparison functions
|
||||
FastDelegate20() { clear(); }
|
||||
FastDelegate20(const FastDelegate20 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
void operator = (const FastDelegate20 &x) {
|
||||
m_Closure.CopyFrom(this, x.m_Closure); }
|
||||
bool operator ==(const FastDelegate20 &x) const {
|
||||
return m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator !=(const FastDelegate20 &x) const {
|
||||
return !m_Closure.IsEqual(x.m_Closure); }
|
||||
bool operator <(const FastDelegate20 &x) const {
|
||||
return m_Closure.IsLess(x.m_Closure); }
|
||||
bool operator >(const FastDelegate20 &x) const {
|
||||
return x.m_Closure.IsLess(m_Closure); }
|
||||
// Binding to non-const member functions
|
||||
template < class X, class Y >
|
||||
FastDelegate20(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) ) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20)) {
|
||||
m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
|
||||
// Binding to const member functions.
|
||||
template < class X, class Y >
|
||||
FastDelegate20(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
|
||||
template < class X, class Y >
|
||||
inline void bind(const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) const) {
|
||||
m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
|
||||
// Static functions. We convert them into a member function call.
|
||||
// Note that this also provides a conversion from static functions.
|
||||
FastDelegate20(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) ) {
|
||||
bind(function_to_bind); }
|
||||
inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20)) {
|
||||
m_Closure.bindstaticfunc(this, &FastDelegate20::InvokeStaticFunction,
|
||||
function_to_bind); }
|
||||
RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) const { // Invoke the delegate
|
||||
// this next line is the only one that violates the standard
|
||||
return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20); }
|
||||
inline bool operator ! () const { // Is it bound to anything?
|
||||
return !m_Closure; }
|
||||
inline bool empty() const {
|
||||
return !m_Closure; }
|
||||
void clear() { m_Closure.clear();}
|
||||
// Conversion to and from the DelegateMemento storage class
|
||||
const DelegateMemento & GetMemento() { return m_Closure; }
|
||||
void SetMemento(const DelegateMemento &any) { m_Closure.CopyFrom(this, any); }
|
||||
|
||||
private: // Invoker for static functions
|
||||
RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) const {
|
||||
return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20); }
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Fast Delegates, part 4:
|
||||
//
|
||||
//
|
||||
// FastDelegate<> class (Original author: Jody Hagins)
|
||||
// Allows boost::function style syntax like:
|
||||
// FastDelegate< double (int, long) >
|
||||
@ -1962,7 +2222,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -1974,7 +2234,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2000,7 +2260,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2012,7 +2272,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2038,7 +2298,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2050,7 +2310,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2076,7 +2336,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2088,7 +2348,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2114,7 +2374,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2126,7 +2386,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2152,7 +2412,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2164,7 +2424,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2190,7 +2450,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2202,7 +2462,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2228,7 +2488,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2240,7 +2500,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2266,7 +2526,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2278,7 +2538,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2304,7 +2564,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2316,7 +2576,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2342,7 +2602,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2354,7 +2614,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2380,7 +2640,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2392,7 +2652,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2418,7 +2678,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2430,7 +2690,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2456,7 +2716,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2468,7 +2728,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2494,7 +2754,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2506,7 +2766,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2532,7 +2792,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2544,7 +2804,7 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2570,7 +2830,7 @@ public:
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
@ -2582,7 +2842,159 @@ public:
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
//N=17
|
||||
// Specialization to allow use of
|
||||
// FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17 ) >
|
||||
// instead of
|
||||
// FastDelegate17 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, R >
|
||||
template<typename R, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17>
|
||||
class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17 ) >
|
||||
// Inherit from FastDelegate17 so that it can be treated just
|
||||
// like a FastDelegate17
|
||||
: public FastDelegate17 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, R >
|
||||
{
|
||||
public:
|
||||
// Make using the base type a bit easier via typedef.
|
||||
typedef FastDelegate17 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, R > BaseType;
|
||||
|
||||
// Allow users access to the specific type of this delegate.
|
||||
typedef FastDelegate SelfType;
|
||||
|
||||
// Mimic the base class constructors.
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(const Y *pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17 ) const)
|
||||
: BaseType(pthis, function_to_bind)
|
||||
{ }
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
//N=18
|
||||
// Specialization to allow use of
|
||||
// FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18 ) >
|
||||
// instead of
|
||||
// FastDelegate18 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, R >
|
||||
template<typename R, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18>
|
||||
class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18 ) >
|
||||
// Inherit from FastDelegate18 so that it can be treated just
|
||||
// like a FastDelegate18
|
||||
: public FastDelegate18 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, R >
|
||||
{
|
||||
public:
|
||||
// Make using the base type a bit easier via typedef.
|
||||
typedef FastDelegate18 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, R > BaseType;
|
||||
|
||||
// Allow users access to the specific type of this delegate.
|
||||
typedef FastDelegate SelfType;
|
||||
|
||||
// Mimic the base class constructors.
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(const Y *pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18 ) const)
|
||||
: BaseType(pthis, function_to_bind)
|
||||
{ }
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
//N=19
|
||||
// Specialization to allow use of
|
||||
// FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19 ) >
|
||||
// instead of
|
||||
// FastDelegate19 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, R >
|
||||
template<typename R, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19>
|
||||
class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19 ) >
|
||||
// Inherit from FastDelegate19 so that it can be treated just
|
||||
// like a FastDelegate19
|
||||
: public FastDelegate19 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, R >
|
||||
{
|
||||
public:
|
||||
// Make using the base type a bit easier via typedef.
|
||||
typedef FastDelegate19 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, R > BaseType;
|
||||
|
||||
// Allow users access to the specific type of this delegate.
|
||||
typedef FastDelegate SelfType;
|
||||
|
||||
// Mimic the base class constructors.
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(const Y *pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19 ) const)
|
||||
: BaseType(pthis, function_to_bind)
|
||||
{ }
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
//N=20
|
||||
// Specialization to allow use of
|
||||
// FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20 ) >
|
||||
// instead of
|
||||
// FastDelegate20 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, R >
|
||||
template<typename R, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20>
|
||||
class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20 ) >
|
||||
// Inherit from FastDelegate20 so that it can be treated just
|
||||
// like a FastDelegate20
|
||||
: public FastDelegate20 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, R >
|
||||
{
|
||||
public:
|
||||
// Make using the base type a bit easier via typedef.
|
||||
typedef FastDelegate20 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, R > BaseType;
|
||||
|
||||
// Allow users access to the specific type of this delegate.
|
||||
typedef FastDelegate SelfType;
|
||||
|
||||
// Mimic the base class constructors.
|
||||
FastDelegate() : BaseType() { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(Y * pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20 ))
|
||||
: BaseType(pthis, function_to_bind) { }
|
||||
|
||||
template < class X, class Y >
|
||||
FastDelegate(const Y *pthis,
|
||||
R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20 ) const)
|
||||
: BaseType(pthis, function_to_bind)
|
||||
{ }
|
||||
|
||||
FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20 ))
|
||||
: BaseType(function_to_bind) { }
|
||||
void operator = (const BaseType &x) {
|
||||
*static_cast<BaseType*>(this) = x; }
|
||||
};
|
||||
|
||||
@ -2600,7 +3012,7 @@ public:
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Also declare overloads of a MakeDelegate() global function to
|
||||
// Also declare overloads of a MakeDelegate() global function to
|
||||
// reduce the need for typedefs.
|
||||
// We need seperate overloads for const and non-const member functions.
|
||||
// Also, because of the weird rule about the class of derived member function pointers,
|
||||
@ -2615,282 +3027,346 @@ public:
|
||||
|
||||
#ifdef FASTDLGT_VC6
|
||||
#define FASTDLGT_RETTYPE detail::VoidToDefaultVoid<RetType>::type
|
||||
#else
|
||||
#else
|
||||
#define FASTDLGT_RETTYPE RetType
|
||||
#endif
|
||||
|
||||
//N=0
|
||||
template <class X, class Y, class RetType>
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)()) {
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)()) {
|
||||
return FastDelegate0<FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class RetType>
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)() const) {
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)() const) {
|
||||
return FastDelegate0<FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class RetType>
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)()) {
|
||||
FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)()) {
|
||||
return FastDelegate0<FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=1
|
||||
template <class X, class Y, class Param1, class RetType>
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1)) {
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1)) {
|
||||
return FastDelegate1<Param1, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class RetType>
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1) const) {
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1) const) {
|
||||
return FastDelegate1<Param1, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class RetType>
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1)) {
|
||||
FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1)) {
|
||||
return FastDelegate1<Param1, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=2
|
||||
template <class X, class Y, class Param1, class Param2, class RetType>
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2)) {
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2)) {
|
||||
return FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class RetType>
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2) const) {
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2) const) {
|
||||
return FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class RetType>
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2)) {
|
||||
FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2)) {
|
||||
return FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=3
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class RetType>
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3)) {
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3)) {
|
||||
return FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class RetType>
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3) const) {
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3) const) {
|
||||
return FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class RetType>
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3)) {
|
||||
FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3)) {
|
||||
return FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=4
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class RetType>
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
|
||||
return FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class RetType>
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const) {
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) const) {
|
||||
return FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class RetType>
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
|
||||
FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
|
||||
return FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=5
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class RetType>
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
|
||||
return FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class RetType>
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const) {
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) const) {
|
||||
return FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class RetType>
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
|
||||
FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
|
||||
return FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=6
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class RetType>
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
|
||||
return FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class RetType>
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const) {
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) const) {
|
||||
return FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class RetType>
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
|
||||
FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
|
||||
return FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=7
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class RetType>
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
|
||||
return FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class RetType>
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const) {
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) const) {
|
||||
return FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class RetType>
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
|
||||
FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
|
||||
return FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=8
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class RetType>
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
|
||||
return FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class RetType>
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const) {
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) const) {
|
||||
return FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class RetType>
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
|
||||
FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
|
||||
return FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=9
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class RetType>
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9)) {
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9)) {
|
||||
return FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class RetType>
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9) const) {
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9) const) {
|
||||
return FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class RetType>
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9)) {
|
||||
FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9)) {
|
||||
return FastDelegate9<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=10
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class RetType>
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10)) {
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10)) {
|
||||
return FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class RetType>
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10) const) {
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10) const) {
|
||||
return FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class RetType>
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10)) {
|
||||
FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10)) {
|
||||
return FastDelegate10<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=11
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class RetType>
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11)) {
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11)) {
|
||||
return FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class RetType>
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11) const) {
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11) const) {
|
||||
return FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class RetType>
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11)) {
|
||||
FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11)) {
|
||||
return FastDelegate11<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=12
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class RetType>
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12)) {
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12)) {
|
||||
return FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class RetType>
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12) const) {
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12) const) {
|
||||
return FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class RetType>
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12)) {
|
||||
FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12)) {
|
||||
return FastDelegate12<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=13
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class RetType>
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13)) {
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13)) {
|
||||
return FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class RetType>
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13) const) {
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13) const) {
|
||||
return FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class RetType>
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13)) {
|
||||
FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13)) {
|
||||
return FastDelegate13<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=14
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class RetType>
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14)) {
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14)) {
|
||||
return FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class RetType>
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14) const) {
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14) const) {
|
||||
return FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class RetType>
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14)) {
|
||||
FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14)) {
|
||||
return FastDelegate14<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=15
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class RetType>
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15)) {
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15)) {
|
||||
return FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class RetType>
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15) const) {
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15) const) {
|
||||
return FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class RetType>
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15)) {
|
||||
FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15)) {
|
||||
return FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=16
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class RetType>
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16)) {
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16)) {
|
||||
return FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class RetType>
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16) const) {
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16) const) {
|
||||
return FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class RetType>
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16)) {
|
||||
FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16)) {
|
||||
return FastDelegate16<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=17
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class RetType>
|
||||
FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17)) {
|
||||
return FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class RetType>
|
||||
FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17) const) {
|
||||
return FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class RetType>
|
||||
FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17)) {
|
||||
return FastDelegate17<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=18
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class RetType>
|
||||
FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18)) {
|
||||
return FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class RetType>
|
||||
FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18) const) {
|
||||
return FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class RetType>
|
||||
FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18)) {
|
||||
return FastDelegate18<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=19
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class RetType>
|
||||
FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19)) {
|
||||
return FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class RetType>
|
||||
FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19) const) {
|
||||
return FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class RetType>
|
||||
FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19)) {
|
||||
return FastDelegate19<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
//N=20
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20, class RetType>
|
||||
FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20)) {
|
||||
return FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class X, class Y, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20, class RetType>
|
||||
FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20) const) {
|
||||
return FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE>(x, func);
|
||||
}
|
||||
|
||||
template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20, class RetType>
|
||||
FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE> MakeDelegate(RetType (*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10, Param11 p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15, Param16 p16, Param17 p17, Param18 p18, Param19 p19, Param20 p20)) {
|
||||
return FastDelegate20<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, FASTDLGT_RETTYPE>(func);
|
||||
}
|
||||
|
||||
|
||||
// clean up after ourselves...
|
||||
#undef FASTDLGT_RETTYPE
|
||||
|
@ -527,6 +527,62 @@ namespace SourceHook
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
|
||||
// GCC & MSVC 7.1 need this, MSVC 7.0 doesn't like it
|
||||
#if SH_COMP != SH_COMP_MSVC || _MSC_VER > 1300
|
||||
@ -769,6 +825,62 @@ namespace SourceHook
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, ...), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, ...) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, ...) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, ...) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, ...), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, ...) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, ...) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, ...) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, ...), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, ...) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, ...) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, ...) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, ...), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, ...) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, ...) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, ...) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -16,7 +16,13 @@
|
||||
#ifndef __SOURCEHOOK_H__
|
||||
#define __SOURCEHOOK_H__
|
||||
|
||||
#define SH_IFACE_VERSION 2
|
||||
// Interface revisions:
|
||||
// 1 - Initial revision
|
||||
// 2 - Changed to virtual functions for iterators and all queries
|
||||
// 3 - Added "hook loop status variable"
|
||||
// Future: Thread safe interface?
|
||||
|
||||
#define SH_IFACE_VERSION 3
|
||||
#define SH_IMPL_VERSION 2
|
||||
|
||||
#ifndef SH_GLOB_SHPTR
|
||||
@ -134,7 +140,7 @@ namespace SourceHook
|
||||
HA_Unregister //!< Clear the saved pointer
|
||||
};
|
||||
|
||||
class IHookManagerInfo;
|
||||
struct IHookManagerInfo;
|
||||
|
||||
/**
|
||||
* @brief Pointer to hook manager interface function
|
||||
@ -229,7 +235,8 @@ namespace SourceHook
|
||||
|
||||
~AutoHookIter()
|
||||
{
|
||||
m_pList->ReleaseIter(m_pIter);
|
||||
if (m_pList)
|
||||
m_pList->ReleaseIter(m_pIter);
|
||||
}
|
||||
|
||||
bool End()
|
||||
@ -252,6 +259,10 @@ namespace SourceHook
|
||||
return m_pIter->ThisPtrOffs();
|
||||
}
|
||||
|
||||
void SetToZero()
|
||||
{
|
||||
m_pList = 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<class B> struct CallClass
|
||||
@ -262,6 +273,15 @@ namespace SourceHook
|
||||
|
||||
typedef CallClass<void> GenericCallClass;
|
||||
|
||||
/**
|
||||
* @brief SH informs the loop in the hook manager about its status through this
|
||||
*/
|
||||
enum HookLoopStatus
|
||||
{
|
||||
HLS_Continue=0,
|
||||
HLS_Stop
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The main SourceHook interface
|
||||
*/
|
||||
@ -346,6 +366,8 @@ namespace SourceHook
|
||||
virtual void* &GetIfacePtrRef() = 0; //!< Gets the reference to the interface this pointer
|
||||
virtual void SetOrigRet(const void *ptr) = 0; //!< Sets the original return pointer
|
||||
virtual void SetOverrideRet(const void *ptr) = 0; //!< Sets the override result pointer
|
||||
virtual HookLoopStatus &GetStatusVarRef(IIface *pIface) = 0; //!< gets the reference to the hook status loop variable
|
||||
virtual void HookLoopDone() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
@ -407,10 +429,10 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
|
||||
#if SH_COMP == SH_COMP_MSVC
|
||||
# define SH_SETUP_MFP(mfp) \
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr->GetOrigEntry();
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr_origentry;
|
||||
#elif SH_COMP == SH_COMP_GCC
|
||||
# define SH_SETUP_MFP(mfp) \
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr->GetOrigEntry(); \
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr_origentry; \
|
||||
reinterpret_cast<void**>(&mfp)[1] = 0;
|
||||
#else
|
||||
# error Not supported yet.
|
||||
@ -510,6 +532,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
IVfnPtr *vfnptr = ms_HI->FindVfnPtr(ourvfnptr); \
|
||||
SH_ASSERT(vfnptr, ("Called with vfnptr 0x%p which couldn't be found in the list", ourvfnptr)); \
|
||||
\
|
||||
void *vfnptr_origentry = vfnptr->GetOrigEntry(); \
|
||||
/* ... and the iface */ \
|
||||
IIface *ifinfo = vfnptr->FindIface(reinterpret_cast<void*>(this)); \
|
||||
if (!ifinfo) \
|
||||
@ -522,6 +545,8 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
/* 2) Declare some vars and set it up */ \
|
||||
IHookList *prelist = ifinfo->GetPreHooks(); \
|
||||
IHookList *postlist = ifinfo->GetPostHooks(); \
|
||||
HookLoopStatus &hls = SH_GLOB_SHPTR->GetStatusVarRef(ifinfo); \
|
||||
hls = HLS_Continue; \
|
||||
rettype orig_ret; \
|
||||
rettype override_ret; \
|
||||
rettype plugin_ret; \
|
||||
@ -534,19 +559,28 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
SH_GLOB_SHPTR->SetOverrideRet(NULL);
|
||||
|
||||
#define SH_CALL_HOOKS(post, params) \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
if (hls == HLS_Continue) \
|
||||
{ \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
plugin_ret = reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
if (cur_res >= MRES_OVERRIDE) \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
{ \
|
||||
override_ret = plugin_ret; \
|
||||
SH_GLOB_SHPTR->SetOverrideRet(&override_ret); \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
hls = HLS_Continue; \
|
||||
plugin_ret = reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
if (cur_res >= MRES_OVERRIDE) \
|
||||
{ \
|
||||
override_ret = plugin_ret; \
|
||||
SH_GLOB_SHPTR->SetOverrideRet(&override_ret); \
|
||||
} \
|
||||
if (hls == HLS_Stop) \
|
||||
{ \
|
||||
iter.SetToZero(); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -555,7 +589,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
{ \
|
||||
rettype (EmptyClass::*mfp)paramtypes; \
|
||||
SH_SETUP_MFP(mfp); \
|
||||
orig_ret = (reinterpret_cast<EmptyClass*>(ifinfo->GetPtr())->*mfp)params; \
|
||||
orig_ret = (reinterpret_cast<EmptyClass*>(this)->*mfp)params; \
|
||||
} \
|
||||
else \
|
||||
orig_ret = override_ret;
|
||||
@ -579,6 +613,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
IVfnPtr *vfnptr = ms_HI->FindVfnPtr(ourvfnptr); \
|
||||
SH_ASSERT(vfnptr, ("Called with vfnptr 0x%p which couldn't be found in the list", ourvfnptr)); \
|
||||
\
|
||||
void *vfnptr_origentry = vfnptr->GetOrigEntry(); \
|
||||
/* ... and the iface */ \
|
||||
IIface *ifinfo = vfnptr->FindIface(reinterpret_cast<void*>(this)); \
|
||||
if (!ifinfo) \
|
||||
@ -593,6 +628,8 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
IHookList *prelist = ifinfo->GetPreHooks(); \
|
||||
IHookList *postlist = ifinfo->GetPostHooks(); \
|
||||
META_RES &cur_res = SH_GLOB_SHPTR->GetCurResRef(); \
|
||||
HookLoopStatus &hls = SH_GLOB_SHPTR->GetStatusVarRef(ifinfo); \
|
||||
hls = HLS_Continue; \
|
||||
META_RES &prev_res = SH_GLOB_SHPTR->GetPrevResRef(); \
|
||||
META_RES &status = SH_GLOB_SHPTR->GetStatusRef(); \
|
||||
void* &ifptr = SH_GLOB_SHPTR->GetIfacePtrRef(); \
|
||||
@ -601,15 +638,24 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
SH_GLOB_SHPTR->SetOrigRet(NULL);
|
||||
|
||||
#define SH_CALL_HOOKS_void(post, params) \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
if (hls == HLS_Continue) \
|
||||
{ \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
{ \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
hls = HLS_Continue; \
|
||||
reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
if (hls == HLS_Stop) \
|
||||
{ \
|
||||
iter.SetToZero(); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SH_CALL_ORIG_void(ifacetype, ifacefunc, paramtypes, params) \
|
||||
@ -617,7 +663,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
{ \
|
||||
void (EmptyClass::*mfp)paramtypes; \
|
||||
SH_SETUP_MFP(mfp); \
|
||||
(reinterpret_cast<EmptyClass*>(ifinfo->GetPtr())->*mfp)params; \
|
||||
(reinterpret_cast<EmptyClass*>(this)->*mfp)params; \
|
||||
}
|
||||
|
||||
#define SH_RETURN_void()
|
||||
|
@ -16,7 +16,13 @@
|
||||
#ifndef __SOURCEHOOK_H__
|
||||
#define __SOURCEHOOK_H__
|
||||
|
||||
#define SH_IFACE_VERSION 2
|
||||
// Interface revisions:
|
||||
// 1 - Initial revision
|
||||
// 2 - Changed to virtual functions for iterators and all queries
|
||||
// 3 - Added "hook loop status variable"
|
||||
// Future: Thread safe interface?
|
||||
|
||||
#define SH_IFACE_VERSION 3
|
||||
#define SH_IMPL_VERSION 2
|
||||
|
||||
#ifndef SH_GLOB_SHPTR
|
||||
@ -134,7 +140,7 @@ namespace SourceHook
|
||||
HA_Unregister //!< Clear the saved pointer
|
||||
};
|
||||
|
||||
class IHookManagerInfo;
|
||||
struct IHookManagerInfo;
|
||||
|
||||
/**
|
||||
* @brief Pointer to hook manager interface function
|
||||
@ -229,7 +235,8 @@ namespace SourceHook
|
||||
|
||||
~AutoHookIter()
|
||||
{
|
||||
m_pList->ReleaseIter(m_pIter);
|
||||
if (m_pList)
|
||||
m_pList->ReleaseIter(m_pIter);
|
||||
}
|
||||
|
||||
bool End()
|
||||
@ -252,6 +259,10 @@ namespace SourceHook
|
||||
return m_pIter->ThisPtrOffs();
|
||||
}
|
||||
|
||||
void SetToZero()
|
||||
{
|
||||
m_pList = 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<class B> struct CallClass
|
||||
@ -262,6 +273,15 @@ namespace SourceHook
|
||||
|
||||
typedef CallClass<void> GenericCallClass;
|
||||
|
||||
/**
|
||||
* @brief SH informs the loop in the hook manager about its status through this
|
||||
*/
|
||||
enum HookLoopStatus
|
||||
{
|
||||
HLS_Continue=0,
|
||||
HLS_Stop
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The main SourceHook interface
|
||||
*/
|
||||
@ -346,6 +366,8 @@ namespace SourceHook
|
||||
virtual void* &GetIfacePtrRef() = 0; //!< Gets the reference to the interface this pointer
|
||||
virtual void SetOrigRet(const void *ptr) = 0; //!< Sets the original return pointer
|
||||
virtual void SetOverrideRet(const void *ptr) = 0; //!< Sets the override result pointer
|
||||
virtual HookLoopStatus &GetStatusVarRef(IIface *pIface) = 0; //!< gets the reference to the hook status loop variable
|
||||
virtual void HookLoopDone() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
@ -407,10 +429,10 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
|
||||
#if SH_COMP == SH_COMP_MSVC
|
||||
# define SH_SETUP_MFP(mfp) \
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr->GetOrigEntry();
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr_origentry;
|
||||
#elif SH_COMP == SH_COMP_GCC
|
||||
# define SH_SETUP_MFP(mfp) \
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr->GetOrigEntry(); \
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr_origentry; \
|
||||
reinterpret_cast<void**>(&mfp)[1] = 0;
|
||||
#else
|
||||
# error Not supported yet.
|
||||
@ -510,6 +532,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
IVfnPtr *vfnptr = ms_HI->FindVfnPtr(ourvfnptr); \
|
||||
SH_ASSERT(vfnptr, ("Called with vfnptr 0x%p which couldn't be found in the list", ourvfnptr)); \
|
||||
\
|
||||
void *vfnptr_origentry = vfnptr->GetOrigEntry(); \
|
||||
/* ... and the iface */ \
|
||||
IIface *ifinfo = vfnptr->FindIface(reinterpret_cast<void*>(this)); \
|
||||
if (!ifinfo) \
|
||||
@ -522,6 +545,8 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
/* 2) Declare some vars and set it up */ \
|
||||
IHookList *prelist = ifinfo->GetPreHooks(); \
|
||||
IHookList *postlist = ifinfo->GetPostHooks(); \
|
||||
HookLoopStatus &hls = SH_GLOB_SHPTR->GetStatusVarRef(ifinfo); \
|
||||
hls = HLS_Continue; \
|
||||
rettype orig_ret; \
|
||||
rettype override_ret; \
|
||||
rettype plugin_ret; \
|
||||
@ -534,19 +559,28 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
SH_GLOB_SHPTR->SetOverrideRet(NULL);
|
||||
|
||||
#define SH_CALL_HOOKS(post, params) \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
if (hls == HLS_Continue) \
|
||||
{ \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
plugin_ret = reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
if (cur_res >= MRES_OVERRIDE) \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
{ \
|
||||
override_ret = plugin_ret; \
|
||||
SH_GLOB_SHPTR->SetOverrideRet(&override_ret); \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
hls = HLS_Continue; \
|
||||
plugin_ret = reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
if (cur_res >= MRES_OVERRIDE) \
|
||||
{ \
|
||||
override_ret = plugin_ret; \
|
||||
SH_GLOB_SHPTR->SetOverrideRet(&override_ret); \
|
||||
} \
|
||||
if (hls == HLS_Stop) \
|
||||
{ \
|
||||
iter.SetToZero(); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -555,7 +589,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
{ \
|
||||
rettype (EmptyClass::*mfp)paramtypes; \
|
||||
SH_SETUP_MFP(mfp); \
|
||||
orig_ret = (reinterpret_cast<EmptyClass*>(ifinfo->GetPtr())->*mfp)params; \
|
||||
orig_ret = (reinterpret_cast<EmptyClass*>(this)->*mfp)params; \
|
||||
} \
|
||||
else \
|
||||
orig_ret = override_ret;
|
||||
@ -579,6 +613,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
IVfnPtr *vfnptr = ms_HI->FindVfnPtr(ourvfnptr); \
|
||||
SH_ASSERT(vfnptr, ("Called with vfnptr 0x%p which couldn't be found in the list", ourvfnptr)); \
|
||||
\
|
||||
void *vfnptr_origentry = vfnptr->GetOrigEntry(); \
|
||||
/* ... and the iface */ \
|
||||
IIface *ifinfo = vfnptr->FindIface(reinterpret_cast<void*>(this)); \
|
||||
if (!ifinfo) \
|
||||
@ -593,6 +628,8 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
IHookList *prelist = ifinfo->GetPreHooks(); \
|
||||
IHookList *postlist = ifinfo->GetPostHooks(); \
|
||||
META_RES &cur_res = SH_GLOB_SHPTR->GetCurResRef(); \
|
||||
HookLoopStatus &hls = SH_GLOB_SHPTR->GetStatusVarRef(ifinfo); \
|
||||
hls = HLS_Continue; \
|
||||
META_RES &prev_res = SH_GLOB_SHPTR->GetPrevResRef(); \
|
||||
META_RES &status = SH_GLOB_SHPTR->GetStatusRef(); \
|
||||
void* &ifptr = SH_GLOB_SHPTR->GetIfacePtrRef(); \
|
||||
@ -601,15 +638,24 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
SH_GLOB_SHPTR->SetOrigRet(NULL);
|
||||
|
||||
#define SH_CALL_HOOKS_void(post, params) \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
if (hls == HLS_Continue) \
|
||||
{ \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
{ \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
hls = HLS_Continue; \
|
||||
reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
if (hls == HLS_Stop) \
|
||||
{ \
|
||||
iter.SetToZero(); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SH_CALL_ORIG_void(ifacetype, ifacefunc, paramtypes, params) \
|
||||
@ -617,7 +663,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
{ \
|
||||
void (EmptyClass::*mfp)paramtypes; \
|
||||
SH_SETUP_MFP(mfp); \
|
||||
(reinterpret_cast<EmptyClass*>(ifinfo->GetPtr())->*mfp)params; \
|
||||
(reinterpret_cast<EmptyClass*>(this)->*mfp)params; \
|
||||
}
|
||||
|
||||
#define SH_RETURN_void()
|
||||
|
@ -527,6 +527,62 @@ namespace SourceHook
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
|
||||
// GCC & MSVC 7.1 need this, MSVC 7.0 doesn't like it
|
||||
#if SH_COMP != SH_COMP_MSVC || _MSC_VER > 1300
|
||||
@ -769,6 +825,62 @@ namespace SourceHook
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, ...), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, ...) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, ...) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, ...) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, ...), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, ...) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, ...) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, ...) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, ...), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, ...) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, ...) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, ...) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, ...), MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, ...) = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
template<class X, class Y, class RetType, class Param1, class Param2, class Param3, class Param4, class Param5, class Param6, class Param7, class Param8, class Param9, class Param10, class Param11, class Param12, class Param13, class Param14, class Param15, class Param16, class Param17, class Param18, class Param19, class Param20>
|
||||
inline void GetFuncInfo(Y *ptr, RetType(X::*mfp)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, ...) const, MemFuncInfo &out)
|
||||
{
|
||||
RetType(Y::*mfp2)(Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, Param16, Param17, Param18, Param19, Param20, ...) const = mfp;
|
||||
MFI_Impl<sizeof(mfp2)>::GetFuncInfo(mfp2, out);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -365,6 +365,8 @@ namespace SourceHook
|
||||
if (iface_iter->m_PostHooks.m_List.empty() && iface_iter->m_PreHooks.m_List.empty())
|
||||
{
|
||||
// There are no hooks on this iface anymore...
|
||||
if (m_CurIface == static_cast<IIface*>(&(*iface_iter)))
|
||||
m_HLS = HLS_Stop;
|
||||
|
||||
iface_iter = vfnptr_iter->m_Ifaces.erase(iface_iter);
|
||||
if (vfnptr_iter->m_Ifaces.empty())
|
||||
@ -577,6 +579,16 @@ namespace SourceHook
|
||||
return m_IfacePtr;
|
||||
}
|
||||
|
||||
HookLoopStatus &CSourceHookImpl::GetStatusVarRef(IIface *pIface)
|
||||
{
|
||||
m_CurIface = pIface;
|
||||
return m_HLS;
|
||||
}
|
||||
void CSourceHookImpl::HookLoopDone()
|
||||
{
|
||||
m_CurIface = NULL;
|
||||
}
|
||||
|
||||
////////////////////////////
|
||||
// CCallClassImpl
|
||||
////////////////////////////
|
||||
@ -762,6 +774,8 @@ namespace SourceHook
|
||||
pIter2->m_pNext->m_pPrev = pIter2->m_pPrev;
|
||||
if (pIter2->m_pPrev)
|
||||
pIter2->m_pPrev->m_pNext = pIter2->m_pNext;
|
||||
if (pIter2 == m_UsedIters)
|
||||
m_UsedIters = NULL;
|
||||
|
||||
// Link to m_FreeIters
|
||||
|
||||
|
@ -16,7 +16,13 @@
|
||||
#ifndef __SOURCEHOOK_H__
|
||||
#define __SOURCEHOOK_H__
|
||||
|
||||
#define SH_IFACE_VERSION 2
|
||||
// Interface revisions:
|
||||
// 1 - Initial revision
|
||||
// 2 - Changed to virtual functions for iterators and all queries
|
||||
// 3 - Added "hook loop status variable"
|
||||
// Future: Thread safe interface?
|
||||
|
||||
#define SH_IFACE_VERSION 3
|
||||
#define SH_IMPL_VERSION 2
|
||||
|
||||
#ifndef SH_GLOB_SHPTR
|
||||
@ -229,7 +235,8 @@ namespace SourceHook
|
||||
|
||||
~AutoHookIter()
|
||||
{
|
||||
m_pList->ReleaseIter(m_pIter);
|
||||
if (m_pList)
|
||||
m_pList->ReleaseIter(m_pIter);
|
||||
}
|
||||
|
||||
bool End()
|
||||
@ -252,6 +259,10 @@ namespace SourceHook
|
||||
return m_pIter->ThisPtrOffs();
|
||||
}
|
||||
|
||||
void SetToZero()
|
||||
{
|
||||
m_pList = 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<class B> struct CallClass
|
||||
@ -262,6 +273,15 @@ namespace SourceHook
|
||||
|
||||
typedef CallClass<void> GenericCallClass;
|
||||
|
||||
/**
|
||||
* @brief SH informs the loop in the hook manager about its status through this
|
||||
*/
|
||||
enum HookLoopStatus
|
||||
{
|
||||
HLS_Continue=0,
|
||||
HLS_Stop
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The main SourceHook interface
|
||||
*/
|
||||
@ -346,6 +366,8 @@ namespace SourceHook
|
||||
virtual void* &GetIfacePtrRef() = 0; //!< Gets the reference to the interface this pointer
|
||||
virtual void SetOrigRet(const void *ptr) = 0; //!< Sets the original return pointer
|
||||
virtual void SetOverrideRet(const void *ptr) = 0; //!< Sets the override result pointer
|
||||
virtual HookLoopStatus &GetStatusVarRef(IIface *pIface) = 0; //!< gets the reference to the hook status loop variable
|
||||
virtual void HookLoopDone() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
@ -407,10 +429,10 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
|
||||
#if SH_COMP == SH_COMP_MSVC
|
||||
# define SH_SETUP_MFP(mfp) \
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr->GetOrigEntry();
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr_origentry;
|
||||
#elif SH_COMP == SH_COMP_GCC
|
||||
# define SH_SETUP_MFP(mfp) \
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr->GetOrigEntry(); \
|
||||
reinterpret_cast<void**>(&mfp)[0] = vfnptr_origentry; \
|
||||
reinterpret_cast<void**>(&mfp)[1] = 0;
|
||||
#else
|
||||
# error Not supported yet.
|
||||
@ -510,6 +532,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
IVfnPtr *vfnptr = ms_HI->FindVfnPtr(ourvfnptr); \
|
||||
SH_ASSERT(vfnptr, ("Called with vfnptr 0x%p which couldn't be found in the list", ourvfnptr)); \
|
||||
\
|
||||
void *vfnptr_origentry = vfnptr->GetOrigEntry(); \
|
||||
/* ... and the iface */ \
|
||||
IIface *ifinfo = vfnptr->FindIface(reinterpret_cast<void*>(this)); \
|
||||
if (!ifinfo) \
|
||||
@ -522,6 +545,8 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
/* 2) Declare some vars and set it up */ \
|
||||
IHookList *prelist = ifinfo->GetPreHooks(); \
|
||||
IHookList *postlist = ifinfo->GetPostHooks(); \
|
||||
HookLoopStatus &hls = SH_GLOB_SHPTR->GetStatusVarRef(ifinfo); \
|
||||
hls = HLS_Continue; \
|
||||
rettype orig_ret; \
|
||||
rettype override_ret; \
|
||||
rettype plugin_ret; \
|
||||
@ -534,19 +559,28 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
SH_GLOB_SHPTR->SetOverrideRet(NULL);
|
||||
|
||||
#define SH_CALL_HOOKS(post, params) \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
if (hls == HLS_Continue) \
|
||||
{ \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
plugin_ret = reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
if (cur_res >= MRES_OVERRIDE) \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
{ \
|
||||
override_ret = plugin_ret; \
|
||||
SH_GLOB_SHPTR->SetOverrideRet(&override_ret); \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
hls = HLS_Continue; \
|
||||
plugin_ret = reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
if (cur_res >= MRES_OVERRIDE) \
|
||||
{ \
|
||||
override_ret = plugin_ret; \
|
||||
SH_GLOB_SHPTR->SetOverrideRet(&override_ret); \
|
||||
} \
|
||||
if (hls == HLS_Stop) \
|
||||
{ \
|
||||
iter.SetToZero(); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
@ -555,7 +589,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
{ \
|
||||
rettype (EmptyClass::*mfp)paramtypes; \
|
||||
SH_SETUP_MFP(mfp); \
|
||||
orig_ret = (reinterpret_cast<EmptyClass*>(ifinfo->GetPtr())->*mfp)params; \
|
||||
orig_ret = (reinterpret_cast<EmptyClass*>(this)->*mfp)params; \
|
||||
} \
|
||||
else \
|
||||
orig_ret = override_ret;
|
||||
@ -579,6 +613,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
IVfnPtr *vfnptr = ms_HI->FindVfnPtr(ourvfnptr); \
|
||||
SH_ASSERT(vfnptr, ("Called with vfnptr 0x%p which couldn't be found in the list", ourvfnptr)); \
|
||||
\
|
||||
void *vfnptr_origentry = vfnptr->GetOrigEntry(); \
|
||||
/* ... and the iface */ \
|
||||
IIface *ifinfo = vfnptr->FindIface(reinterpret_cast<void*>(this)); \
|
||||
if (!ifinfo) \
|
||||
@ -593,6 +628,8 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
IHookList *prelist = ifinfo->GetPreHooks(); \
|
||||
IHookList *postlist = ifinfo->GetPostHooks(); \
|
||||
META_RES &cur_res = SH_GLOB_SHPTR->GetCurResRef(); \
|
||||
HookLoopStatus &hls = SH_GLOB_SHPTR->GetStatusVarRef(ifinfo); \
|
||||
hls = HLS_Continue; \
|
||||
META_RES &prev_res = SH_GLOB_SHPTR->GetPrevResRef(); \
|
||||
META_RES &status = SH_GLOB_SHPTR->GetStatusRef(); \
|
||||
void* &ifptr = SH_GLOB_SHPTR->GetIfacePtrRef(); \
|
||||
@ -601,15 +638,24 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
SH_GLOB_SHPTR->SetOrigRet(NULL);
|
||||
|
||||
#define SH_CALL_HOOKS_void(post, params) \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
if (hls == HLS_Continue) \
|
||||
{ \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
prev_res = MRES_IGNORED; \
|
||||
for (AutoHookIter iter(post##list); !iter.End(); iter.Next()) \
|
||||
{ \
|
||||
cur_res = MRES_IGNORED; \
|
||||
ifptr = reinterpret_cast<void*>(reinterpret_cast<char*>(this) - iter.ThisPtrOffs()); \
|
||||
hls = HLS_Continue; \
|
||||
reinterpret_cast<CSHDelegate<FD>*>(iter.Handler())->GetDeleg() params; \
|
||||
prev_res = cur_res; \
|
||||
if (cur_res > status) \
|
||||
status = cur_res; \
|
||||
if (hls == HLS_Stop) \
|
||||
{ \
|
||||
iter.SetToZero(); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define SH_CALL_ORIG_void(ifacetype, ifacefunc, paramtypes, params) \
|
||||
@ -617,7 +663,7 @@ inline void SH_RELEASE_CALLCLASS_R(SourceHook::ISourceHook *shptr, SourceHook::C
|
||||
{ \
|
||||
void (EmptyClass::*mfp)paramtypes; \
|
||||
SH_SETUP_MFP(mfp); \
|
||||
(reinterpret_cast<EmptyClass*>(ifinfo->GetPtr())->*mfp)params; \
|
||||
(reinterpret_cast<EmptyClass*>(this)->*mfp)params; \
|
||||
}
|
||||
|
||||
#define SH_RETURN_void()
|
||||
|
@ -230,6 +230,8 @@ namespace SourceHook
|
||||
void SetPluginPaused(Plugin plug, bool paused);
|
||||
|
||||
META_RES m_Status, m_PrevRes, m_CurRes;
|
||||
HookLoopStatus m_HLS;
|
||||
IIface *m_CurIface;
|
||||
const void *m_OrigRet;
|
||||
const void *m_OverrideRet;
|
||||
void *m_IfacePtr;
|
||||
@ -345,6 +347,8 @@ namespace SourceHook
|
||||
virtual void* &GetIfacePtrRef(); //!< Gets the reference to the iface ptr
|
||||
virtual void SetOrigRet(const void *ptr); //!< Sets the original return pointer
|
||||
virtual void SetOverrideRet(const void *ptr); //!< Sets the override result pointer
|
||||
HookLoopStatus &GetStatusVarRef(IIface *pIface);
|
||||
void HookLoopDone();
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user