68#define FASTDELEGATE_USESTATICFUNCTIONHACK
81#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__VECTOR_C) && !defined(__ICL) && !defined(__BORLANDC__)
82#define FASTDLGT_ISMSVC
86#pragma warning(disable:4786)
95#if defined(_MSC_VER) && !defined(__MWERKS__)
96#define FASTDLGT_MICROSOFT_MFP
98#if !defined(__VECTOR_C)
100#define FASTDLGT_HASINHERITANCE_KEYWORDS
105#if defined(FASTDLGT_ISMSVC) && (_MSC_VER >=1310)
106#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX
110#if defined (__DMC__) || defined(__GNUC__) || defined(__ICL) || defined(__COMO__)
111#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX
115#if defined (__MWERKS__)
116#define FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX
121#define FASTDELEGATE_GCC_BUG_8271
143namespace fastdelegate {
152template <
class OutputClass,
class InputClass>
153inline OutputClass implicit_cast(InputClass input){
167template <
class OutputClass,
class InputClass>
173template <
class OutputClass,
class InputClass>
174inline OutputClass horrible_cast(
const InputClass input){
175 horrible_union<OutputClass, InputClass> u;
179 typedef int ERROR_CantUseHorrible_cast[
sizeof(InputClass)==
sizeof(u)
180 &&
sizeof(InputClass)==
sizeof(OutputClass) ? 1 : -1];
192#define FASTDELEGATEDECLARE(CLASSNAME) class CLASSNAME;
196#undef FASTDELEGATE_USESTATICFUNCTIONHACK
218typedef const void * DefaultVoid;
221typedef void DefaultVoid;
227struct DefaultVoidToVoid {
typedef T type; };
230struct DefaultVoidToVoid<DefaultVoid> {
typedef void type; };
235struct VoidToDefaultVoid {
typedef T type; };
238struct VoidToDefaultVoid<void> {
typedef DefaultVoid type; };
255#ifdef FASTDLGT_MICROSOFT_MFP
257#ifdef FASTDLGT_HASINHERITANCE_KEYWORDS
261 class __single_inheritance GenericClass;
269 class GenericClass {};
275const int SINGLE_MEMFUNCPTR_SIZE =
sizeof(void (GenericClass::*)());
290struct SimplifyMemFunc {
291 template <
class X,
class XFuncType,
class GenericMemFuncType>
292 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
293 GenericMemFuncType &bound_func) {
296 typedef char ERROR_Unsupported_member_function_pointer_on_this_compiler[N-100];
304struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE> {
305 template <
class X,
class XFuncType,
class GenericMemFuncType>
306 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
307 GenericMemFuncType &bound_func) {
312 bound_func = horrible_cast<GenericMemFuncType>(function_to_bind);
314 bound_func =
reinterpret_cast<GenericMemFuncType
>(function_to_bind);
316 return reinterpret_cast<GenericClass *
>(pthis);
330#ifdef FASTDLGT_MICROSOFT_MFP
339struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
340 template <
class X,
class XFuncType,
class GenericMemFuncType>
341 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
342 GenericMemFuncType &bound_func) {
348 GenericMemFuncType funcaddress;
353 typedef int ERROR_CantUsehorrible_cast[
sizeof(function_to_bind)==
sizeof(u.s)? 1 : -1];
354 u.func = function_to_bind;
355 bound_func = u.s.funcaddress;
356 return reinterpret_cast<GenericClass *
>(
reinterpret_cast<char *
>(pthis) + u.s.delta);
370struct MicrosoftVirtualMFP {
371 void (GenericClass::*codeptr)();
384struct GenericVirtualClass :
virtual public GenericClass
386 typedef GenericVirtualClass * (GenericVirtualClass::*ProbePtrType)();
387 GenericVirtualClass * GetThis() {
return this; }
392struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 2*
sizeof(int) >
395 template <
class X,
class XFuncType,
class GenericMemFuncType>
396 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
397 GenericMemFuncType &bound_func) {
400 GenericClass* (X::*ProbeFunc)();
401 MicrosoftVirtualMFP s;
403 u.func = function_to_bind;
404 bound_func =
reinterpret_cast<GenericMemFuncType
>(u.s.codeptr);
406 GenericVirtualClass::ProbePtrType virtfunc;
407 MicrosoftVirtualMFP s;
410 typedef int ERROR_CantUsehorrible_cast[
sizeof(function_to_bind)==
sizeof(u.s)
411 &&
sizeof(function_to_bind)==
sizeof(u.ProbeFunc)
412 &&
sizeof(u2.virtfunc)==
sizeof(u2.s) ? 1 : -1];
415 u2.virtfunc = &GenericVirtualClass::GetThis;
416 u.s.codeptr = u2.s.codeptr;
417 return (pthis->*u.ProbeFunc)();
427struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*
sizeof(int) >
429 template <
class X,
class XFuncType,
class GenericMemFuncType>
430 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
431 GenericMemFuncType &bound_func) {
456 typedef char ERROR_VC6CompilerBug[-100];
469struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*
sizeof(int) >
471 template <
class X,
class XFuncType,
class GenericMemFuncType>
472 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
473 GenericMemFuncType &bound_func) {
481 GenericMemFuncType m_funcaddress;
488 typedef int ERROR_CantUsehorrible_cast[
sizeof(XFuncType)==
sizeof(u.s)? 1 : -1];
489 u.func = function_to_bind;
490 bound_func = u.s.funcaddress;
491 int virtual_delta = 0;
492 if (u.s.vtable_index) {
495 const int * vtable = *
reinterpret_cast<const int *const*
>(
496 reinterpret_cast<const char *
>(pthis) + u.s.vtordisp );
499 virtual_delta = u.s.vtordisp + *
reinterpret_cast<const int *
>(
500 reinterpret_cast<const char *
>(vtable) + u.s.vtable_index);
504 return reinterpret_cast<GenericClass *
>(
505 reinterpret_cast<char *
>(pthis) + u.s.delta + virtual_delta);
560class DelegateMemento {
564 typedef void (detail::GenericClass::*GenericMemFuncType)();
565 detail::GenericClass *m_pthis;
566 GenericMemFuncType m_pFunction;
568#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
569 typedef void (*GenericFuncPtr)();
570 GenericFuncPtr m_pStaticFunction;
574#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
575 DelegateMemento() : m_pthis(0), m_pFunction(0), m_pStaticFunction(0) {};
577 m_pthis=0; m_pFunction=0; m_pStaticFunction=0;
580 DelegateMemento() : m_pthis(0), m_pFunction(0) {};
581 void clear() { m_pthis=0; m_pFunction=0; }
584#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
585 inline bool IsEqual (
const DelegateMemento &x)
const{
587 if (m_pFunction!=x.m_pFunction)
return false;
589 if (m_pStaticFunction!=x.m_pStaticFunction)
return false;
590 if (m_pStaticFunction!=0)
return m_pthis==x.m_pthis;
594 inline bool IsEqual (
const DelegateMemento &x)
const{
595 return m_pthis==x.m_pthis && m_pFunction==x.m_pFunction;
599 inline bool IsLess(
const DelegateMemento &right)
const {
601#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
602 if (m_pStaticFunction !=0 || right.m_pStaticFunction!=0)
603 return m_pStaticFunction < right.m_pStaticFunction;
605 if (m_pthis !=right.m_pthis)
return m_pthis < right.m_pthis;
610 return memcmp(&m_pFunction, &right.m_pFunction,
sizeof(m_pFunction)) < 0;
616 inline bool operator ! () const
617 {
return m_pthis==0 && m_pFunction==0; }
618 inline bool empty() const
619 {
return m_pthis==0 && m_pFunction==0; }
621 DelegateMemento & operator = (
const DelegateMemento &right) {
622 SetMementoFrom(right);
625 inline bool operator <(
const DelegateMemento &right) {
626 return IsLess(right);
628 inline bool operator >(
const DelegateMemento &right) {
629 return right.IsLess(*
this);
631 DelegateMemento (
const DelegateMemento &right) :
632 m_pthis(right.m_pthis), m_pFunction(right.m_pFunction)
633#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
634 , m_pStaticFunction (right.m_pStaticFunction)
638 void SetMementoFrom(
const DelegateMemento &right) {
639 m_pFunction = right.m_pFunction;
640 m_pthis = right.m_pthis;
641#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
642 m_pStaticFunction = right.m_pStaticFunction;
665template <
class GenericMemFunc,
class StaticFuncPtr,
class Un
voidStaticFuncPtr>
666class ClosurePtr :
public DelegateMemento {
673 template <
class X,
class XMemFunc >
674 inline void bindmemfunc(X *pthis, XMemFunc function_to_bind ) {
675 m_pthis = SimplifyMemFunc<
sizeof(function_to_bind) >
676 ::Convert(pthis, function_to_bind, m_pFunction);
677#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
678 m_pStaticFunction = 0;
685 template <
class X,
class XMemFunc>
686 inline void bindconstmemfunc(
const X *pthis, XMemFunc function_to_bind) {
687 m_pthis= SimplifyMemFunc<
sizeof(function_to_bind) >
688 ::Convert(
const_cast<X*
>(pthis), function_to_bind, m_pFunction);
689#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
690 m_pStaticFunction = 0;
693#ifdef FASTDELEGATE_GCC_BUG_8271
694 template <
class X,
class XMemFunc>
695 inline void bindmemfunc(
const X *pthis, XMemFunc function_to_bind) {
696 bindconstmemfunc(pthis, function_to_bind);
697#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
698 m_pStaticFunction = 0;
703 inline GenericClass *GetClosureThis()
const {
return m_pthis; }
704 inline GenericMemFunc GetClosureMemPtr()
const {
return reinterpret_cast<GenericMemFunc
>(m_pFunction); }
712#if !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
724 template<
class DerivedClass >
725 inline void CopyFrom (DerivedClass *pParent,
const DelegateMemento &x) {
727 if (m_pStaticFunction!=0) {
729 m_pthis=
reinterpret_cast<GenericClass *
>(pParent);
735 template <
class DerivedClass,
class ParentInvokerSig >
736 inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
737 StaticFuncPtr function_to_bind ) {
738 if (function_to_bind==0) {
741 bindmemfunc(pParent, static_function_invoker);
743 m_pStaticFunction=
reinterpret_cast<GenericFuncPtr
>(function_to_bind);
745 inline UnvoidStaticFuncPtr GetStaticFunction()
const {
746 return reinterpret_cast<UnvoidStaticFuncPtr
>(m_pStaticFunction);
760 template<
class DerivedClass >
761 inline void CopyFrom (DerivedClass *pParent,
const DelegateMemento &right) {
762 SetMementoFrom(right);
768 template <
class DerivedClass,
class ParentInvokerSig>
769 inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
770 StaticFuncPtr function_to_bind) {
771 if (function_to_bind==0) {
776 bindmemfunc(pParent, static_function_invoker);
783 typedef int ERROR_CantUseEvilMethod[
sizeof(GenericClass *)==
sizeof(function_to_bind) ? 1 : -1];
784 m_pthis = horrible_cast<GenericClass *>(function_to_bind);
794 inline UnvoidStaticFuncPtr GetStaticFunction()
const {
798 typedef int ERROR_CantUseEvilMethod[
sizeof(UnvoidStaticFuncPtr)==
sizeof(
this) ? 1 : -1];
799 return horrible_cast<UnvoidStaticFuncPtr>(
this);
804 inline bool IsEqualToStaticFuncPtr(StaticFuncPtr funcptr){
805 if (funcptr==0)
return empty();
808 else return funcptr==
reinterpret_cast<StaticFuncPtr
>(GetStaticFunction());
855template<
class RetType=detail::DefaultVo
id>
858 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
859 typedef DesiredRetType (*StaticFunctionPtr)();
860 typedef RetType (*UnvoidStaticFunctionPtr)();
861 typedef RetType (detail::GenericClass::*GenericMemFn)();
862 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
863 ClosureType m_Closure;
866 typedef FastDelegate0 type;
869 FastDelegate0() { clear(); }
870 FastDelegate0(
const FastDelegate0 &x) {
871 m_Closure.CopyFrom(
this, x.m_Closure); }
872 void operator = (
const FastDelegate0 &x) {
873 m_Closure.CopyFrom(
this, x.m_Closure); }
874 bool operator ==(
const FastDelegate0 &x)
const {
875 return m_Closure.IsEqual(x.m_Closure); }
876 bool operator !=(
const FastDelegate0 &x)
const {
877 return !m_Closure.IsEqual(x.m_Closure); }
878 bool operator <(
const FastDelegate0 &x)
const {
879 return m_Closure.IsLess(x.m_Closure); }
880 bool operator >(
const FastDelegate0 &x)
const {
881 return x.m_Closure.IsLess(m_Closure); }
883 template <
class X,
class Y >
884 FastDelegate0(Y *pthis, DesiredRetType (X::* function_to_bind)() ) {
885 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
886 template <
class X,
class Y >
887 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)()) {
888 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
890 template <
class X,
class Y >
891 FastDelegate0(
const Y *pthis, DesiredRetType (X::* function_to_bind)()
const) {
892 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
893 template <
class X,
class Y >
894 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)()
const) {
895 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
898 FastDelegate0(DesiredRetType (*function_to_bind)() ) {
899 bind(function_to_bind); }
901 void operator = (DesiredRetType (*function_to_bind)() ) {
902 bind(function_to_bind); }
903 inline void bind(DesiredRetType (*function_to_bind)()) {
904 m_Closure.bindstaticfunc(
this, &FastDelegate0::InvokeStaticFunction,
907 RetType operator() ()
const {
908 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(); }
911 typedef struct SafeBoolStruct {
912 int a_data_pointer_to_this_is_0_on_buggy_compilers;
913 StaticFunctionPtr m_nonzero;
915 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
917 operator unspecified_bool_type()
const {
918 return empty()? 0: &SafeBoolStruct::m_nonzero;
921 inline bool operator==(StaticFunctionPtr funcptr) {
922 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
923 inline bool operator!=(StaticFunctionPtr funcptr) {
924 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
925 inline bool operator ! ()
const {
927 inline bool empty()
const {
929 void clear() { m_Closure.clear();}
931 const DelegateMemento & GetMemento() {
return m_Closure; }
932 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
935 RetType InvokeStaticFunction()
const {
936 return (*(m_Closure.GetStaticFunction()))(); }
940template<
class Param1,
class RetType=detail::DefaultVo
id>
943 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
944 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1);
945 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1);
946 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1);
947 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
948 ClosureType m_Closure;
951 typedef FastDelegate1 type;
954 FastDelegate1() { clear(); }
955 FastDelegate1(
const FastDelegate1 &x) {
956 m_Closure.CopyFrom(
this, x.m_Closure); }
957 void operator = (
const FastDelegate1 &x) {
958 m_Closure.CopyFrom(
this, x.m_Closure); }
959 bool operator ==(
const FastDelegate1 &x)
const {
960 return m_Closure.IsEqual(x.m_Closure); }
961 bool operator !=(
const FastDelegate1 &x)
const {
962 return !m_Closure.IsEqual(x.m_Closure); }
963 bool operator <(
const FastDelegate1 &x)
const {
964 return m_Closure.IsLess(x.m_Closure); }
965 bool operator >(
const FastDelegate1 &x)
const {
966 return x.m_Closure.IsLess(m_Closure); }
968 template <
class X,
class Y >
969 FastDelegate1(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1) ) {
970 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
971 template <
class X,
class Y >
972 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1)) {
973 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
975 template <
class X,
class Y >
976 FastDelegate1(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1)
const) {
977 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
978 template <
class X,
class Y >
979 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1)
const) {
980 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
983 FastDelegate1(DesiredRetType (*function_to_bind)(Param1 p1) ) {
984 bind(function_to_bind); }
986 void operator = (DesiredRetType (*function_to_bind)(Param1 p1) ) {
987 bind(function_to_bind); }
988 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1)) {
989 m_Closure.bindstaticfunc(
this, &FastDelegate1::InvokeStaticFunction,
992 RetType operator() (Param1 p1)
const {
993 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1); }
996 typedef struct SafeBoolStruct {
997 int a_data_pointer_to_this_is_0_on_buggy_compilers;
998 StaticFunctionPtr m_nonzero;
1000 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1002 operator unspecified_bool_type()
const {
1003 return empty()? 0: &SafeBoolStruct::m_nonzero;
1006 inline bool operator==(StaticFunctionPtr funcptr) {
1007 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1008 inline bool operator!=(StaticFunctionPtr funcptr) {
1009 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1010 inline bool operator ! ()
const {
1011 return !m_Closure; }
1012 inline bool empty()
const {
1013 return !m_Closure; }
1014 void clear() { m_Closure.clear();}
1016 const DelegateMemento & GetMemento() {
return m_Closure; }
1017 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1020 RetType InvokeStaticFunction(Param1 p1)
const {
1021 return (*(m_Closure.GetStaticFunction()))(p1); }
1025template<
class Param1,
class Param2,
class RetType=detail::DefaultVo
id>
1026class FastDelegate2 {
1028 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1029 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2);
1030 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2);
1031 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2);
1032 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1033 ClosureType m_Closure;
1036 typedef FastDelegate2 type;
1039 FastDelegate2() { clear(); }
1040 FastDelegate2(
const FastDelegate2 &x) {
1041 m_Closure.CopyFrom(
this, x.m_Closure); }
1042 void operator = (
const FastDelegate2 &x) {
1043 m_Closure.CopyFrom(
this, x.m_Closure); }
1044 bool operator ==(
const FastDelegate2 &x)
const {
1045 return m_Closure.IsEqual(x.m_Closure); }
1046 bool operator !=(
const FastDelegate2 &x)
const {
1047 return !m_Closure.IsEqual(x.m_Closure); }
1048 bool operator <(
const FastDelegate2 &x)
const {
1049 return m_Closure.IsLess(x.m_Closure); }
1050 bool operator >(
const FastDelegate2 &x)
const {
1051 return x.m_Closure.IsLess(m_Closure); }
1053 template <
class X,
class Y >
1054 FastDelegate2(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2) ) {
1055 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1056 template <
class X,
class Y >
1057 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2)) {
1058 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1060 template <
class X,
class Y >
1061 FastDelegate2(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2)
const) {
1062 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1063 template <
class X,
class Y >
1064 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2)
const) {
1065 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1068 FastDelegate2(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) {
1069 bind(function_to_bind); }
1071 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) {
1072 bind(function_to_bind); }
1073 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2)) {
1074 m_Closure.bindstaticfunc(
this, &FastDelegate2::InvokeStaticFunction,
1075 function_to_bind); }
1077 RetType operator() (Param1 p1, Param2 p2)
const {
1078 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2); }
1081 typedef struct SafeBoolStruct {
1082 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1083 StaticFunctionPtr m_nonzero;
1085 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1087 operator unspecified_bool_type()
const {
1088 return empty()? 0: &SafeBoolStruct::m_nonzero;
1091 inline bool operator==(StaticFunctionPtr funcptr) {
1092 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1093 inline bool operator!=(StaticFunctionPtr funcptr) {
1094 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1095 inline bool operator ! ()
const {
1096 return !m_Closure; }
1097 inline bool empty()
const {
1098 return !m_Closure; }
1099 void clear() { m_Closure.clear();}
1101 const DelegateMemento & GetMemento() {
return m_Closure; }
1102 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1105 RetType InvokeStaticFunction(Param1 p1, Param2 p2)
const {
1106 return (*(m_Closure.GetStaticFunction()))(p1, p2); }
1110template<
class Param1,
class Param2,
class Param3,
class RetType=detail::DefaultVo
id>
1111class FastDelegate3 {
1113 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1114 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3);
1115 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3);
1116 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3);
1117 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1118 ClosureType m_Closure;
1121 typedef FastDelegate3 type;
1124 FastDelegate3() { clear(); }
1125 FastDelegate3(
const FastDelegate3 &x) {
1126 m_Closure.CopyFrom(
this, x.m_Closure); }
1127 void operator = (
const FastDelegate3 &x) {
1128 m_Closure.CopyFrom(
this, x.m_Closure); }
1129 bool operator ==(
const FastDelegate3 &x)
const {
1130 return m_Closure.IsEqual(x.m_Closure); }
1131 bool operator !=(
const FastDelegate3 &x)
const {
1132 return !m_Closure.IsEqual(x.m_Closure); }
1133 bool operator <(
const FastDelegate3 &x)
const {
1134 return m_Closure.IsLess(x.m_Closure); }
1135 bool operator >(
const FastDelegate3 &x)
const {
1136 return x.m_Closure.IsLess(m_Closure); }
1138 template <
class X,
class Y >
1139 FastDelegate3(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) {
1140 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1141 template <
class X,
class Y >
1142 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3)) {
1143 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1145 template <
class X,
class Y >
1146 FastDelegate3(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3)
const) {
1147 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1148 template <
class X,
class Y >
1149 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3)
const) {
1150 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1153 FastDelegate3(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) {
1154 bind(function_to_bind); }
1156 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) {
1157 bind(function_to_bind); }
1158 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3)) {
1159 m_Closure.bindstaticfunc(
this, &FastDelegate3::InvokeStaticFunction,
1160 function_to_bind); }
1162 RetType operator() (Param1 p1, Param2 p2, Param3 p3)
const {
1163 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3); }
1166 typedef struct SafeBoolStruct {
1167 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1168 StaticFunctionPtr m_nonzero;
1170 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1172 operator unspecified_bool_type()
const {
1173 return empty()? 0: &SafeBoolStruct::m_nonzero;
1176 inline bool operator==(StaticFunctionPtr funcptr) {
1177 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1178 inline bool operator!=(StaticFunctionPtr funcptr) {
1179 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1180 inline bool operator ! ()
const {
1181 return !m_Closure; }
1182 inline bool empty()
const {
1183 return !m_Closure; }
1184 void clear() { m_Closure.clear();}
1186 const DelegateMemento & GetMemento() {
return m_Closure; }
1187 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1190 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3)
const {
1191 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3); }
1195template<
class Param1,
class Param2,
class Param3,
class Param4,
class RetType=detail::DefaultVo
id>
1196class FastDelegate4 {
1198 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1199 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4);
1200 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4);
1201 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4);
1202 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1203 ClosureType m_Closure;
1206 typedef FastDelegate4 type;
1209 FastDelegate4() { clear(); }
1210 FastDelegate4(
const FastDelegate4 &x) {
1211 m_Closure.CopyFrom(
this, x.m_Closure); }
1212 void operator = (
const FastDelegate4 &x) {
1213 m_Closure.CopyFrom(
this, x.m_Closure); }
1214 bool operator ==(
const FastDelegate4 &x)
const {
1215 return m_Closure.IsEqual(x.m_Closure); }
1216 bool operator !=(
const FastDelegate4 &x)
const {
1217 return !m_Closure.IsEqual(x.m_Closure); }
1218 bool operator <(
const FastDelegate4 &x)
const {
1219 return m_Closure.IsLess(x.m_Closure); }
1220 bool operator >(
const FastDelegate4 &x)
const {
1221 return x.m_Closure.IsLess(m_Closure); }
1223 template <
class X,
class Y >
1224 FastDelegate4(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) {
1225 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1226 template <
class X,
class Y >
1227 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
1228 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1230 template <
class X,
class Y >
1231 FastDelegate4(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)
const) {
1232 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1233 template <
class X,
class Y >
1234 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)
const) {
1235 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1238 FastDelegate4(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) {
1239 bind(function_to_bind); }
1241 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) {
1242 bind(function_to_bind); }
1243 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
1244 m_Closure.bindstaticfunc(
this, &FastDelegate4::InvokeStaticFunction,
1245 function_to_bind); }
1247 RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4)
const {
1248 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4); }
1251 typedef struct SafeBoolStruct {
1252 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1253 StaticFunctionPtr m_nonzero;
1255 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1257 operator unspecified_bool_type()
const {
1258 return empty()? 0: &SafeBoolStruct::m_nonzero;
1261 inline bool operator==(StaticFunctionPtr funcptr) {
1262 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1263 inline bool operator!=(StaticFunctionPtr funcptr) {
1264 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1265 inline bool operator ! ()
const {
1266 return !m_Closure; }
1267 inline bool empty()
const {
1268 return !m_Closure; }
1269 void clear() { m_Closure.clear();}
1271 const DelegateMemento & GetMemento() {
return m_Closure; }
1272 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1275 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4)
const {
1276 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4); }
1280template<
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class RetType=detail::DefaultVo
id>
1281class FastDelegate5 {
1283 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1284 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5);
1285 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5);
1286 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5);
1287 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1288 ClosureType m_Closure;
1291 typedef FastDelegate5 type;
1294 FastDelegate5() { clear(); }
1295 FastDelegate5(
const FastDelegate5 &x) {
1296 m_Closure.CopyFrom(
this, x.m_Closure); }
1297 void operator = (
const FastDelegate5 &x) {
1298 m_Closure.CopyFrom(
this, x.m_Closure); }
1299 bool operator ==(
const FastDelegate5 &x)
const {
1300 return m_Closure.IsEqual(x.m_Closure); }
1301 bool operator !=(
const FastDelegate5 &x)
const {
1302 return !m_Closure.IsEqual(x.m_Closure); }
1303 bool operator <(
const FastDelegate5 &x)
const {
1304 return m_Closure.IsLess(x.m_Closure); }
1305 bool operator >(
const FastDelegate5 &x)
const {
1306 return x.m_Closure.IsLess(m_Closure); }
1308 template <
class X,
class Y >
1309 FastDelegate5(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) {
1310 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1311 template <
class X,
class Y >
1312 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
1313 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1315 template <
class X,
class Y >
1316 FastDelegate5(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)
const) {
1317 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1318 template <
class X,
class Y >
1319 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)
const) {
1320 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1323 FastDelegate5(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) {
1324 bind(function_to_bind); }
1326 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) {
1327 bind(function_to_bind); }
1328 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
1329 m_Closure.bindstaticfunc(
this, &FastDelegate5::InvokeStaticFunction,
1330 function_to_bind); }
1332 RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)
const {
1333 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5); }
1336 typedef struct SafeBoolStruct {
1337 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1338 StaticFunctionPtr m_nonzero;
1340 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1342 operator unspecified_bool_type()
const {
1343 return empty()? 0: &SafeBoolStruct::m_nonzero;
1346 inline bool operator==(StaticFunctionPtr funcptr) {
1347 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1348 inline bool operator!=(StaticFunctionPtr funcptr) {
1349 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1350 inline bool operator ! ()
const {
1351 return !m_Closure; }
1352 inline bool empty()
const {
1353 return !m_Closure; }
1354 void clear() { m_Closure.clear();}
1356 const DelegateMemento & GetMemento() {
return m_Closure; }
1357 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1360 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)
const {
1361 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5); }
1365template<
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class RetType=detail::DefaultVo
id>
1366class FastDelegate6 {
1368 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1369 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6);
1370 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6);
1371 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6);
1372 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1373 ClosureType m_Closure;
1376 typedef FastDelegate6 type;
1379 FastDelegate6() { clear(); }
1380 FastDelegate6(
const FastDelegate6 &x) {
1381 m_Closure.CopyFrom(
this, x.m_Closure); }
1382 void operator = (
const FastDelegate6 &x) {
1383 m_Closure.CopyFrom(
this, x.m_Closure); }
1384 bool operator ==(
const FastDelegate6 &x)
const {
1385 return m_Closure.IsEqual(x.m_Closure); }
1386 bool operator !=(
const FastDelegate6 &x)
const {
1387 return !m_Closure.IsEqual(x.m_Closure); }
1388 bool operator <(
const FastDelegate6 &x)
const {
1389 return m_Closure.IsLess(x.m_Closure); }
1390 bool operator >(
const FastDelegate6 &x)
const {
1391 return x.m_Closure.IsLess(m_Closure); }
1393 template <
class X,
class Y >
1394 FastDelegate6(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) {
1395 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1396 template <
class X,
class Y >
1397 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
1398 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1400 template <
class X,
class Y >
1401 FastDelegate6(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)
const) {
1402 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1403 template <
class X,
class Y >
1404 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)
const) {
1405 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1408 FastDelegate6(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) {
1409 bind(function_to_bind); }
1411 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) {
1412 bind(function_to_bind); }
1413 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
1414 m_Closure.bindstaticfunc(
this, &FastDelegate6::InvokeStaticFunction,
1415 function_to_bind); }
1417 RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)
const {
1418 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6); }
1421 typedef struct SafeBoolStruct {
1422 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1423 StaticFunctionPtr m_nonzero;
1425 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1427 operator unspecified_bool_type()
const {
1428 return empty()? 0: &SafeBoolStruct::m_nonzero;
1431 inline bool operator==(StaticFunctionPtr funcptr) {
1432 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1433 inline bool operator!=(StaticFunctionPtr funcptr) {
1434 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1435 inline bool operator ! ()
const {
1436 return !m_Closure; }
1437 inline bool empty()
const {
1438 return !m_Closure; }
1439 void clear() { m_Closure.clear();}
1441 const DelegateMemento & GetMemento() {
return m_Closure; }
1442 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1445 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)
const {
1446 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6); }
1450template<
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class RetType=detail::DefaultVo
id>
1451class FastDelegate7 {
1453 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1454 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7);
1455 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7);
1456 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7);
1457 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1458 ClosureType m_Closure;
1461 typedef FastDelegate7 type;
1464 FastDelegate7() { clear(); }
1465 FastDelegate7(
const FastDelegate7 &x) {
1466 m_Closure.CopyFrom(
this, x.m_Closure); }
1467 void operator = (
const FastDelegate7 &x) {
1468 m_Closure.CopyFrom(
this, x.m_Closure); }
1469 bool operator ==(
const FastDelegate7 &x)
const {
1470 return m_Closure.IsEqual(x.m_Closure); }
1471 bool operator !=(
const FastDelegate7 &x)
const {
1472 return !m_Closure.IsEqual(x.m_Closure); }
1473 bool operator <(
const FastDelegate7 &x)
const {
1474 return m_Closure.IsLess(x.m_Closure); }
1475 bool operator >(
const FastDelegate7 &x)
const {
1476 return x.m_Closure.IsLess(m_Closure); }
1478 template <
class X,
class Y >
1479 FastDelegate7(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) {
1480 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1481 template <
class X,
class Y >
1482 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
1483 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1485 template <
class X,
class Y >
1486 FastDelegate7(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)
const) {
1487 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1488 template <
class X,
class Y >
1489 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)
const) {
1490 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1493 FastDelegate7(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) {
1494 bind(function_to_bind); }
1496 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) {
1497 bind(function_to_bind); }
1498 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
1499 m_Closure.bindstaticfunc(
this, &FastDelegate7::InvokeStaticFunction,
1500 function_to_bind); }
1502 RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)
const {
1503 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7); }
1506 typedef struct SafeBoolStruct {
1507 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1508 StaticFunctionPtr m_nonzero;
1510 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1512 operator unspecified_bool_type()
const {
1513 return empty()? 0: &SafeBoolStruct::m_nonzero;
1516 inline bool operator==(StaticFunctionPtr funcptr) {
1517 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1518 inline bool operator!=(StaticFunctionPtr funcptr) {
1519 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1520 inline bool operator ! ()
const {
1521 return !m_Closure; }
1522 inline bool empty()
const {
1523 return !m_Closure; }
1524 void clear() { m_Closure.clear();}
1526 const DelegateMemento & GetMemento() {
return m_Closure; }
1527 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1530 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)
const {
1531 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7); }
1535template<
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class Param8,
class RetType=detail::DefaultVo
id>
1536class FastDelegate8 {
1538 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1539 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8);
1540 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8);
1541 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8);
1542 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1543 ClosureType m_Closure;
1546 typedef FastDelegate8 type;
1549 FastDelegate8() { clear(); }
1550 FastDelegate8(
const FastDelegate8 &x) {
1551 m_Closure.CopyFrom(
this, x.m_Closure); }
1552 void operator = (
const FastDelegate8 &x) {
1553 m_Closure.CopyFrom(
this, x.m_Closure); }
1554 bool operator ==(
const FastDelegate8 &x)
const {
1555 return m_Closure.IsEqual(x.m_Closure); }
1556 bool operator !=(
const FastDelegate8 &x)
const {
1557 return !m_Closure.IsEqual(x.m_Closure); }
1558 bool operator <(
const FastDelegate8 &x)
const {
1559 return m_Closure.IsLess(x.m_Closure); }
1560 bool operator >(
const FastDelegate8 &x)
const {
1561 return x.m_Closure.IsLess(m_Closure); }
1563 template <
class X,
class Y >
1564 FastDelegate8(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) {
1565 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1566 template <
class X,
class Y >
1567 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)) {
1568 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1570 template <
class X,
class Y >
1571 FastDelegate8(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)
const) {
1572 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1573 template <
class X,
class Y >
1574 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)
const) {
1575 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1578 FastDelegate8(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) {
1579 bind(function_to_bind); }
1581 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) {
1582 bind(function_to_bind); }
1583 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
1584 m_Closure.bindstaticfunc(
this, &FastDelegate8::InvokeStaticFunction,
1585 function_to_bind); }
1587 RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)
const {
1588 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8); }
1591 typedef struct SafeBoolStruct {
1592 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1593 StaticFunctionPtr m_nonzero;
1595 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1597 operator unspecified_bool_type()
const {
1598 return empty()? 0: &SafeBoolStruct::m_nonzero;
1601 inline bool operator==(StaticFunctionPtr funcptr) {
1602 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1603 inline bool operator!=(StaticFunctionPtr funcptr) {
1604 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1605 inline bool operator ! ()
const {
1606 return !m_Closure; }
1607 inline bool empty()
const {
1608 return !m_Closure; }
1609 void clear() { m_Closure.clear();}
1611 const DelegateMemento & GetMemento() {
return m_Closure; }
1612 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1615 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)
const {
1616 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8); }
1631#ifdef FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX
1635template <
typename Signature>
1644class FastDelegate< R ( ) >
1646 :
public FastDelegate0 < R >
1650 typedef FastDelegate0 < R > BaseType;
1653 typedef FastDelegate SelfType;
1656 FastDelegate() : BaseType() { }
1658 template <
class X,
class Y >
1659 FastDelegate(Y * pthis,
1660 R (X::* function_to_bind)( ))
1661 : BaseType(pthis, function_to_bind) { }
1663 template <
class X,
class Y >
1664 FastDelegate(
const Y *pthis,
1665 R (X::* function_to_bind)( )
const)
1666 : BaseType(pthis, function_to_bind)
1669 FastDelegate(R (*function_to_bind)( ))
1670 : BaseType(function_to_bind) { }
1671 void operator = (
const BaseType &x) {
1672 *
static_cast<BaseType*
>(
this) = x; }
1680template<
typename R,
class Param1>
1681class FastDelegate< R ( Param1 ) >
1683 :
public FastDelegate1 < Param1, R >
1687 typedef FastDelegate1 < Param1, R > BaseType;
1690 typedef FastDelegate SelfType;
1693 FastDelegate() : BaseType() { }
1695 template <
class X,
class Y >
1696 FastDelegate(Y * pthis,
1697 R (X::* function_to_bind)( Param1 p1 ))
1698 : BaseType(pthis, function_to_bind) { }
1700 template <
class X,
class Y >
1701 FastDelegate(
const Y *pthis,
1702 R (X::* function_to_bind)( Param1 p1 )
const)
1703 : BaseType(pthis, function_to_bind)
1706 FastDelegate(R (*function_to_bind)( Param1 p1 ))
1707 : BaseType(function_to_bind) { }
1708 void operator = (
const BaseType &x) {
1709 *
static_cast<BaseType*
>(
this) = x; }
1717template<
typename R,
class Param1,
class Param2>
1718class FastDelegate< R ( Param1, Param2 ) >
1720 :
public FastDelegate2 < Param1, Param2, R >
1724 typedef FastDelegate2 < Param1, Param2, R > BaseType;
1727 typedef FastDelegate SelfType;
1730 FastDelegate() : BaseType() { }
1732 template <
class X,
class Y >
1733 FastDelegate(Y * pthis,
1734 R (X::* function_to_bind)( Param1 p1, Param2 p2 ))
1735 : BaseType(pthis, function_to_bind) { }
1737 template <
class X,
class Y >
1738 FastDelegate(
const Y *pthis,
1739 R (X::* function_to_bind)( Param1 p1, Param2 p2 )
const)
1740 : BaseType(pthis, function_to_bind)
1743 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2 ))
1744 : BaseType(function_to_bind) { }
1745 void operator = (
const BaseType &x) {
1746 *
static_cast<BaseType*
>(
this) = x; }
1754template<
typename R,
class Param1,
class Param2,
class Param3>
1755class FastDelegate< R ( Param1, Param2, Param3 ) >
1757 :
public FastDelegate3 < Param1, Param2, Param3, R >
1761 typedef FastDelegate3 < Param1, Param2, Param3, R > BaseType;
1764 typedef FastDelegate SelfType;
1767 FastDelegate() : BaseType() { }
1769 template <
class X,
class Y >
1770 FastDelegate(Y * pthis,
1771 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3 ))
1772 : BaseType(pthis, function_to_bind) { }
1774 template <
class X,
class Y >
1775 FastDelegate(
const Y *pthis,
1776 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3 )
const)
1777 : BaseType(pthis, function_to_bind)
1780 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3 ))
1781 : BaseType(function_to_bind) { }
1782 void operator = (
const BaseType &x) {
1783 *
static_cast<BaseType*
>(
this) = x; }
1791template<
typename R,
class Param1,
class Param2,
class Param3,
class Param4>
1792class FastDelegate< R ( Param1, Param2, Param3, Param4 ) >
1794 :
public FastDelegate4 < Param1, Param2, Param3, Param4, R >
1798 typedef FastDelegate4 < Param1, Param2, Param3, Param4, R > BaseType;
1801 typedef FastDelegate SelfType;
1804 FastDelegate() : BaseType() { }
1806 template <
class X,
class Y >
1807 FastDelegate(Y * pthis,
1808 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4 ))
1809 : BaseType(pthis, function_to_bind) { }
1811 template <
class X,
class Y >
1812 FastDelegate(
const Y *pthis,
1813 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4 )
const)
1814 : BaseType(pthis, function_to_bind)
1817 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4 ))
1818 : BaseType(function_to_bind) { }
1819 void operator = (
const BaseType &x) {
1820 *
static_cast<BaseType*
>(
this) = x; }
1828template<
typename R,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5>
1829class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5 ) >
1831 :
public FastDelegate5 < Param1, Param2, Param3, Param4, Param5, R >
1835 typedef FastDelegate5 < Param1, Param2, Param3, Param4, Param5, R > BaseType;
1838 typedef FastDelegate SelfType;
1841 FastDelegate() : BaseType() { }
1843 template <
class X,
class Y >
1844 FastDelegate(Y * pthis,
1845 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5 ))
1846 : BaseType(pthis, function_to_bind) { }
1848 template <
class X,
class Y >
1849 FastDelegate(
const Y *pthis,
1850 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5 )
const)
1851 : BaseType(pthis, function_to_bind)
1854 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5 ))
1855 : BaseType(function_to_bind) { }
1856 void operator = (
const BaseType &x) {
1857 *
static_cast<BaseType*
>(
this) = x; }
1865template<
typename R,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6>
1866class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6 ) >
1868 :
public FastDelegate6 < Param1, Param2, Param3, Param4, Param5, Param6, R >
1872 typedef FastDelegate6 < Param1, Param2, Param3, Param4, Param5, Param6, R > BaseType;
1875 typedef FastDelegate SelfType;
1878 FastDelegate() : BaseType() { }
1880 template <
class X,
class Y >
1881 FastDelegate(Y * pthis,
1882 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6 ))
1883 : BaseType(pthis, function_to_bind) { }
1885 template <
class X,
class Y >
1886 FastDelegate(
const Y *pthis,
1887 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6 )
const)
1888 : BaseType(pthis, function_to_bind)
1891 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6 ))
1892 : BaseType(function_to_bind) { }
1893 void operator = (
const BaseType &x) {
1894 *
static_cast<BaseType*
>(
this) = x; }
1902template<
typename R,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7>
1903class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7 ) >
1905 :
public FastDelegate7 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, R >
1909 typedef FastDelegate7 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, R > BaseType;
1912 typedef FastDelegate SelfType;
1915 FastDelegate() : BaseType() { }
1917 template <
class X,
class Y >
1918 FastDelegate(Y * pthis,
1919 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7 ))
1920 : BaseType(pthis, function_to_bind) { }
1922 template <
class X,
class Y >
1923 FastDelegate(
const Y *pthis,
1924 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7 )
const)
1925 : BaseType(pthis, function_to_bind)
1928 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7 ))
1929 : BaseType(function_to_bind) { }
1930 void operator = (
const BaseType &x) {
1931 *
static_cast<BaseType*
>(
this) = x; }
1939template<
typename R,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class Param8>
1940class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8 ) >
1942 :
public FastDelegate8 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, R >
1946 typedef FastDelegate8 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, R > BaseType;
1949 typedef FastDelegate SelfType;
1952 FastDelegate() : BaseType() { }
1954 template <
class X,
class Y >
1955 FastDelegate(Y * pthis,
1956 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8 ))
1957 : BaseType(pthis, function_to_bind) { }
1959 template <
class X,
class Y >
1960 FastDelegate(
const Y *pthis,
1961 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8 )
const)
1962 : BaseType(pthis, function_to_bind)
1965 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8 ))
1966 : BaseType(function_to_bind) { }
1967 void operator = (
const BaseType &x) {
1968 *
static_cast<BaseType*
>(
this) = x; }
1999#define FASTDLGT_RETTYPE detail::VoidToDefaultVoid<RetType>::type
2001#define FASTDLGT_RETTYPE RetType
2005template <
class X,
class Y,
class RetType>
2006FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)()) {
2007 return FastDelegate0<FASTDLGT_RETTYPE>(x, func);
2010template <
class X,
class Y,
class RetType>
2011FastDelegate0<FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)()
const) {
2012 return FastDelegate0<FASTDLGT_RETTYPE>(x, func);
2016template <
class X,
class Y,
class Param1,
class RetType>
2017FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1)) {
2018 return FastDelegate1<Param1, FASTDLGT_RETTYPE>(x, func);
2021template <
class X,
class Y,
class Param1,
class RetType>
2022FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1)
const) {
2023 return FastDelegate1<Param1, FASTDLGT_RETTYPE>(x, func);
2027template <
class X,
class Y,
class Param1,
class Param2,
class RetType>
2028FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2)) {
2029 return FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE>(x, func);
2032template <
class X,
class Y,
class Param1,
class Param2,
class RetType>
2033FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2)
const) {
2034 return FastDelegate2<Param1, Param2, FASTDLGT_RETTYPE>(x, func);
2038template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class RetType>
2039FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3)) {
2040 return FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE>(x, func);
2043template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class RetType>
2044FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3)
const) {
2045 return FastDelegate3<Param1, Param2, Param3, FASTDLGT_RETTYPE>(x, func);
2049template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class RetType>
2050FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
2051 return FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE>(x, func);
2054template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class RetType>
2055FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)
const) {
2056 return FastDelegate4<Param1, Param2, Param3, Param4, FASTDLGT_RETTYPE>(x, func);
2060template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class RetType>
2061FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
2062 return FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE>(x, func);
2065template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class RetType>
2066FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)
const) {
2067 return FastDelegate5<Param1, Param2, Param3, Param4, Param5, FASTDLGT_RETTYPE>(x, func);
2071template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class RetType>
2072FastDelegate6<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)) {
2073 return FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE>(x, func);
2076template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class RetType>
2077FastDelegate6<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) {
2078 return FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, FASTDLGT_RETTYPE>(x, func);
2082template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class RetType>
2083FastDelegate7<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)) {
2084 return FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE>(x, func);
2087template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class RetType>
2088FastDelegate7<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) {
2089 return FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, FASTDLGT_RETTYPE>(x, func);
2093template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class Param8,
class RetType>
2094FastDelegate8<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)) {
2095 return FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE>(x, func);
2098template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class Param8,
class RetType>
2099FastDelegate8<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) {
2100 return FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, FASTDLGT_RETTYPE>(x, func);
2105#undef FASTDLGT_RETTYPE