52 #ifndef MIRTK_FastDelegate_H 53 #define MIRTK_FastDelegate_H 56 #endif // _MSC_VER > 1000 71 #define MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK 84 #if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__VECTOR_C) && !defined(__ICL) && !defined(__BORLANDC__) 85 #define MIRTK_FASTDLGT_ISMSVC 87 #if (_MSC_VER <1300) // Many workarounds are required for VC6. 88 #define MIRTK_FASTDLGT_VC6 89 #pragma warning(disable:4786) // disable this ridiculous warning 98 #if defined(_MSC_VER) && !defined(__MWERKS__) 99 #define MIRTK_FASTDLGT_MICROSOFT_MFP 101 #if !defined(__VECTOR_C) 103 #define MIRTK_FASTDLGT_HASINHERITANCE_KEYWORDS 108 #if defined(MIRTK_FASTDLGT_ISMSVC) && (_MSC_VER >=1310) // VC 7.1 109 #define MIRTK_FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX 113 #if defined (__DMC__) || defined(__GNUC__) || defined(__ICL) || defined(__COMO__) 114 #define MIRTK_FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX 118 #if defined (__MWERKS__) 119 #define MIRTK_FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX 122 #ifdef __GNUC__ // Workaround GCC bug #8271 124 #define MIRTK_FASTDELEGATE_GCC_BUG_8271 150 template <
bool b>
struct StaticAssert;
151 template <>
struct StaticAssert<true>{};
159 template <
class OutputClass,
class InputClass>
160 inline OutputClass implicit_cast(InputClass input){
174 template <
class OutputClass,
class InputClass>
175 union horrible_union{
180 template <
class OutputClass,
class InputClass>
181 inline OutputClass horrible_cast(
const InputClass input){
182 horrible_union<OutputClass, InputClass> u;
186 StaticAssert<sizeof(InputClass)==sizeof(u) && sizeof(InputClass)==sizeof(OutputClass)> ERROR_CantUseHorrible_cast;
198 #define FASTDELEGATEDECLARE(CLASSNAME) class CLASSNAME; 202 #undef MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK 222 #ifdef MIRTK_FASTDLGT_VC6 224 typedef const void * DefaultVoid;
227 typedef void DefaultVoid;
233 struct DefaultVoidToVoid {
typedef T type; };
236 struct DefaultVoidToVoid<DefaultVoid> {
typedef void type; };
241 struct VoidToDefaultVoid {
typedef T type; };
244 struct VoidToDefaultVoid<void> {
typedef DefaultVoid type; };
261 #ifdef MIRTK_FASTDLGT_MICROSOFT_MFP 263 #ifdef MIRTK_FASTDLGT_HASINHERITANCE_KEYWORDS 267 class __single_inheritance GenericClass;
275 class GenericClass {};
281 const int SINGLE_MEMFUNCPTR_SIZE =
sizeof(void (GenericClass::*)());
296 struct SimplifyMemFunc {
297 template <
class X,
class XFuncType,
class GenericMemFuncType>
298 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
299 GenericMemFuncType &bound_func) {
302 StaticAssert<N-100> ERROR_Unsupported_member_function_pointer_on_this_compiler;
310 struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE> {
311 template <
class X,
class XFuncType,
class GenericMemFuncType>
312 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
313 GenericMemFuncType &bound_func) {
318 bound_func = horrible_cast<GenericMemFuncType>(function_to_bind);
320 bound_func =
reinterpret_cast<GenericMemFuncType
>(function_to_bind);
322 return reinterpret_cast<GenericClass *
>(pthis);
336 #ifdef MIRTK_FASTDLGT_MICROSOFT_MFP 345 struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
346 template <
class X,
class XFuncType,
class GenericMemFuncType>
347 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
348 GenericMemFuncType &bound_func) {
354 GenericMemFuncType funcaddress;
359 StaticAssert<
sizeof(function_to_bind)==
sizeof(u.s)> ERROR_CantUseHorrible_cast;
360 u.func = function_to_bind;
361 bound_func = u.s.funcaddress;
362 return reinterpret_cast<GenericClass *
>(
reinterpret_cast<char *
>(pthis) + u.s.delta);
376 struct MicrosoftVirtualMFP {
377 void (GenericClass::*codeptr)();
390 struct GenericVirtualClass :
virtual public GenericClass
392 typedef GenericVirtualClass * (GenericVirtualClass::*ProbePtrType)();
393 GenericVirtualClass * GetThis() {
return this; }
398 struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 2*
sizeof(int) >
401 template <
class X,
class XFuncType,
class GenericMemFuncType>
402 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
403 GenericMemFuncType &bound_func) {
406 GenericClass* (X::*ProbeFunc)();
407 MicrosoftVirtualMFP s;
409 u.func = function_to_bind;
410 bound_func =
reinterpret_cast<GenericMemFuncType
>(u.s.codeptr);
412 GenericVirtualClass::ProbePtrType virtfunc;
413 MicrosoftVirtualMFP s;
416 StaticAssert<
sizeof(function_to_bind)==
sizeof(u.s)
417 &&
sizeof(function_to_bind)==
sizeof(u.ProbeFunc)
418 &&
sizeof(u2.virtfunc)==
sizeof(u2.s)> ERROR_CantUseHorrible_cast;
421 u2.virtfunc = &GenericVirtualClass::GetThis;
422 u.s.codeptr = u2.s.codeptr;
423 return (pthis->*u.ProbeFunc)();
433 struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*
sizeof(int) >
435 template <
class X,
class XFuncType,
class GenericMemFuncType>
436 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
437 GenericMemFuncType &bound_func) {
462 StaticAssert<-100> ERROR_VC6CompilerBug;
475 struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*
sizeof(int) >
477 template <
class X,
class XFuncType,
class GenericMemFuncType>
478 inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
479 GenericMemFuncType &bound_func) {
487 GenericMemFuncType m_funcaddress;
494 StaticAssert<
sizeof(XFuncType)==
sizeof(u.s)> ERROR_CantUseHorrible_cast;
495 u.func = function_to_bind;
496 bound_func = u.s.funcaddress;
497 int virtual_delta = 0;
498 if (u.s.vtable_index) {
501 const int * vtable = *
reinterpret_cast<const int *const*
>(
502 reinterpret_cast<const char *
>(pthis) + u.s.vtordisp );
505 virtual_delta = u.s.vtordisp + *
reinterpret_cast<const int *
>(
506 reinterpret_cast<const char *
>(vtable) + u.s.vtable_index);
510 return reinterpret_cast<GenericClass *
>(
511 reinterpret_cast<char *
>(pthis) + u.s.delta + virtual_delta);
514 #endif // MSVC 7 and greater 516 #endif // MS/Intel hacks 566 class DelegateMemento {
570 typedef void (detail::GenericClass::*GenericMemFuncType)();
571 detail::GenericClass *m_pthis;
572 GenericMemFuncType m_pFunction;
574 #if !defined(MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK) 575 typedef void (*GenericFuncPtr)();
576 GenericFuncPtr m_pStaticFunction;
580 #if !defined(MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK) 581 DelegateMemento() : m_pthis(0), m_pFunction(0), m_pStaticFunction(0) {};
583 m_pthis=0; m_pFunction=0; m_pStaticFunction=0;
586 DelegateMemento() : m_pthis(0), m_pFunction(0) {};
587 void clear() { m_pthis=0; m_pFunction=0; }
590 #if !defined(MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK) 591 inline bool IsEqual (
const DelegateMemento &x)
const{
593 if (m_pFunction!=x.m_pFunction)
return false;
595 if (m_pStaticFunction!=x.m_pStaticFunction)
return false;
596 if (m_pStaticFunction!=0)
return m_pthis==x.m_pthis;
600 inline bool IsEqual (
const DelegateMemento &x)
const{
601 return m_pthis==x.m_pthis && m_pFunction==x.m_pFunction;
605 inline bool IsLess(
const DelegateMemento &right)
const {
607 #if !defined(MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK) 608 if (m_pStaticFunction !=0 || right.m_pStaticFunction!=0)
609 return m_pStaticFunction < right.m_pStaticFunction;
611 if (m_pthis !=right.m_pthis)
return m_pthis < right.m_pthis;
615 return memcmp(&m_pFunction, &right.m_pFunction,
sizeof(m_pFunction)) < 0;
621 inline bool operator ! () const
622 {
return m_pthis==0 && m_pFunction==0; }
623 inline bool empty() const
624 {
return m_pthis==0 && m_pFunction==0; }
626 DelegateMemento & operator = (
const DelegateMemento &right) {
627 SetMementoFrom(right);
630 inline bool operator <(
const DelegateMemento &right) {
631 return IsLess(right);
633 inline bool operator >(
const DelegateMemento &right) {
634 return right.IsLess(*
this);
636 DelegateMemento (
const DelegateMemento &right) :
637 m_pthis(right.m_pthis), m_pFunction(right.m_pFunction)
638 #if !defined(MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK)
639 , m_pStaticFunction (right.m_pStaticFunction)
643 void SetMementoFrom(
const DelegateMemento &right) {
644 m_pFunction = right.m_pFunction;
645 m_pthis = right.m_pthis;
646 #if !defined(MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK) 647 m_pStaticFunction = right.m_pStaticFunction;
670 template <
class GenericMemFunc,
class StaticFuncPtr,
class Un
voidStaticFuncPtr>
671 class ClosurePtr :
public DelegateMemento {
678 template <
class X,
class XMemFunc >
679 inline void bindmemfunc(X *pthis, XMemFunc function_to_bind ) {
680 m_pthis = SimplifyMemFunc< sizeof(function_to_bind) >
681 ::Convert(pthis, function_to_bind, m_pFunction);
682 #if !defined(MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK) 683 m_pStaticFunction = 0;
690 template <
class X,
class XMemFunc>
691 inline void bindconstmemfunc(
const X *pthis, XMemFunc function_to_bind) {
692 m_pthis= SimplifyMemFunc< sizeof(function_to_bind) >
693 ::Convert(const_cast<X*>(pthis), function_to_bind, m_pFunction);
694 #if !defined(MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK) 695 m_pStaticFunction = 0;
698 #ifdef MIRTK_FASTDELEGATE_GCC_BUG_8271 // At present, GCC doesn't recognize constness of MFPs in templates 699 template <
class X,
class XMemFunc>
700 inline void bindmemfunc(
const X *pthis, XMemFunc function_to_bind) {
701 bindconstmemfunc(pthis, function_to_bind);
702 #if !defined(MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK) 703 m_pStaticFunction = 0;
708 inline GenericClass *GetClosureThis()
const {
return m_pthis; }
709 inline GenericMemFunc GetClosureMemPtr()
const {
return reinterpret_cast<GenericMemFunc
>(m_pFunction); }
717 #if !defined(MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK) 729 template<
class DerivedClass >
730 inline void CopyFrom (DerivedClass *pParent,
const DelegateMemento &x) {
732 if (m_pStaticFunction!=0) {
734 m_pthis=
reinterpret_cast<GenericClass *
>(pParent);
740 template <
class DerivedClass,
class ParentInvokerSig >
741 inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
742 StaticFuncPtr function_to_bind ) {
743 if (function_to_bind==0) {
746 bindmemfunc(pParent, static_function_invoker);
748 m_pStaticFunction=
reinterpret_cast<GenericFuncPtr
>(function_to_bind);
750 inline UnvoidStaticFuncPtr GetStaticFunction()
const {
751 return reinterpret_cast<UnvoidStaticFuncPtr
>(m_pStaticFunction);
765 template<
class DerivedClass >
766 inline void CopyFrom (DerivedClass *pParent,
const DelegateMemento &right) {
767 SetMementoFrom(right);
773 template <
class DerivedClass,
class ParentInvokerSig>
774 inline void bindstaticfunc(DerivedClass *pParent, ParentInvokerSig static_function_invoker,
775 StaticFuncPtr function_to_bind) {
776 if (function_to_bind==0) {
781 bindmemfunc(pParent, static_function_invoker);
788 StaticAssert<sizeof(GenericClass *)==sizeof(function_to_bind)> ERROR_CantUseEvilMethod;
789 m_pthis = horrible_cast<GenericClass *>(function_to_bind);
799 inline UnvoidStaticFuncPtr GetStaticFunction()
const {
803 StaticAssert<sizeof(UnvoidStaticFuncPtr)==sizeof(this)> ERROR_CantUseEvilMethod;
804 return horrible_cast<UnvoidStaticFuncPtr>(
this);
806 #endif // !defined(MIRTK_FASTDELEGATE_USESTATICFUNCTIONHACK) 809 inline bool IsEqualToStaticFuncPtr(StaticFuncPtr funcptr){
810 if (funcptr==0)
return empty();
813 else return funcptr==
reinterpret_cast<StaticFuncPtr
>(GetStaticFunction());
860 template<
class RetType=detail::DefaultVo
id>
861 class FastDelegate0 {
863 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
864 typedef DesiredRetType (*StaticFunctionPtr)();
865 typedef RetType (*UnvoidStaticFunctionPtr)();
866 typedef RetType (detail::GenericClass::*GenericMemFn)();
867 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
868 ClosureType m_Closure;
871 typedef FastDelegate0 type;
874 FastDelegate0() { clear(); }
875 FastDelegate0(
const FastDelegate0 &x) {
876 m_Closure.CopyFrom(
this, x.m_Closure); }
877 void operator = (
const FastDelegate0 &x) {
878 m_Closure.CopyFrom(
this, x.m_Closure); }
880 return m_Closure.IsEqual(x.m_Closure); }
881 bool operator !=(
const FastDelegate0 &x)
const {
882 return !m_Closure.IsEqual(x.m_Closure); }
883 bool operator <(
const FastDelegate0 &x)
const {
884 return m_Closure.IsLess(x.m_Closure); }
885 bool operator >(
const FastDelegate0 &x)
const {
886 return x.m_Closure.IsLess(m_Closure); }
888 template <
class X,
class Y >
889 FastDelegate0(Y *pthis, DesiredRetType (X::* function_to_bind)() ) {
890 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
891 template <
class X,
class Y >
892 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)()) {
893 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
895 template <
class X,
class Y >
896 FastDelegate0(
const Y *pthis, DesiredRetType (X::* function_to_bind)()
const) {
897 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
898 template <
class X,
class Y >
899 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)()
const) {
900 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
903 FastDelegate0(DesiredRetType (*function_to_bind)() ) {
904 bind(function_to_bind); }
906 void operator = (DesiredRetType (*function_to_bind)() ) {
907 bind(function_to_bind); }
908 inline void bind(DesiredRetType (*function_to_bind)()) {
909 m_Closure.bindstaticfunc(
this, &FastDelegate0::InvokeStaticFunction,
912 RetType operator() ()
const {
913 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(); }
916 typedef struct SafeBoolStruct {
917 int a_data_pointer_to_this_is_0_on_buggy_compilers;
918 StaticFunctionPtr m_nonzero;
920 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
922 operator unspecified_bool_type()
const {
923 return empty()? 0: &SafeBoolStruct::m_nonzero;
926 inline bool operator==(StaticFunctionPtr funcptr) {
927 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
928 inline bool operator!=(StaticFunctionPtr funcptr) {
929 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
930 inline bool operator ! ()
const {
932 inline bool empty()
const {
934 void clear() { m_Closure.clear();}
936 const DelegateMemento & GetMemento() {
return m_Closure; }
937 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
940 RetType InvokeStaticFunction()
const {
941 return (*(m_Closure.GetStaticFunction()))(); }
945 template<
class Param1,
class RetType=detail::DefaultVo
id>
946 class FastDelegate1 {
948 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
949 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1);
950 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1);
951 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1);
952 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
953 ClosureType m_Closure;
956 typedef FastDelegate1 type;
959 FastDelegate1() { clear(); }
960 FastDelegate1(
const FastDelegate1 &x) {
961 m_Closure.CopyFrom(
this, x.m_Closure); }
962 void operator = (
const FastDelegate1 &x) {
963 m_Closure.CopyFrom(
this, x.m_Closure); }
965 return m_Closure.IsEqual(x.m_Closure); }
966 bool operator !=(
const FastDelegate1 &x)
const {
967 return !m_Closure.IsEqual(x.m_Closure); }
968 bool operator <(
const FastDelegate1 &x)
const {
969 return m_Closure.IsLess(x.m_Closure); }
970 bool operator >(
const FastDelegate1 &x)
const {
971 return x.m_Closure.IsLess(m_Closure); }
973 template <
class X,
class Y >
974 FastDelegate1(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1) ) {
975 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
976 template <
class X,
class Y >
977 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1)) {
978 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
980 template <
class X,
class Y >
981 FastDelegate1(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1)
const) {
982 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
983 template <
class X,
class Y >
984 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1)
const) {
985 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
988 FastDelegate1(DesiredRetType (*function_to_bind)(Param1 p1) ) {
989 bind(function_to_bind); }
991 void operator = (DesiredRetType (*function_to_bind)(Param1 p1) ) {
992 bind(function_to_bind); }
993 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1)) {
994 m_Closure.bindstaticfunc(
this, &FastDelegate1::InvokeStaticFunction,
997 RetType operator() (Param1 p1)
const {
998 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1); }
1001 typedef struct SafeBoolStruct {
1002 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1003 StaticFunctionPtr m_nonzero;
1005 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1007 operator unspecified_bool_type()
const {
1008 return empty()? 0: &SafeBoolStruct::m_nonzero;
1011 inline bool operator==(StaticFunctionPtr funcptr) {
1012 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1013 inline bool operator!=(StaticFunctionPtr funcptr) {
1014 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1015 inline bool operator ! ()
const {
1016 return !m_Closure; }
1017 inline bool empty()
const {
1018 return !m_Closure; }
1019 void clear() { m_Closure.clear();}
1021 const DelegateMemento & GetMemento() {
return m_Closure; }
1022 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1025 RetType InvokeStaticFunction(Param1 p1)
const {
1026 return (*(m_Closure.GetStaticFunction()))(p1); }
1030 template<
class Param1,
class Param2,
class RetType=detail::DefaultVo
id>
1031 class FastDelegate2 {
1033 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1034 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2);
1035 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2);
1036 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2);
1037 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1038 ClosureType m_Closure;
1041 typedef FastDelegate2 type;
1044 FastDelegate2() { clear(); }
1045 FastDelegate2(
const FastDelegate2 &x) {
1046 m_Closure.CopyFrom(
this, x.m_Closure); }
1047 void operator = (
const FastDelegate2 &x) {
1048 m_Closure.CopyFrom(
this, x.m_Closure); }
1050 return m_Closure.IsEqual(x.m_Closure); }
1051 bool operator !=(
const FastDelegate2 &x)
const {
1052 return !m_Closure.IsEqual(x.m_Closure); }
1053 bool operator <(
const FastDelegate2 &x)
const {
1054 return m_Closure.IsLess(x.m_Closure); }
1055 bool operator >(
const FastDelegate2 &x)
const {
1056 return x.m_Closure.IsLess(m_Closure); }
1058 template <
class X,
class Y >
1059 FastDelegate2(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2) ) {
1060 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1061 template <
class X,
class Y >
1062 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2)) {
1063 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1065 template <
class X,
class Y >
1066 FastDelegate2(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2)
const) {
1067 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1068 template <
class X,
class Y >
1069 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2)
const) {
1070 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1073 FastDelegate2(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) {
1074 bind(function_to_bind); }
1076 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2) ) {
1077 bind(function_to_bind); }
1078 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2)) {
1079 m_Closure.bindstaticfunc(
this, &FastDelegate2::InvokeStaticFunction,
1080 function_to_bind); }
1082 RetType operator() (Param1 p1, Param2 p2)
const {
1083 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2); }
1086 typedef struct SafeBoolStruct {
1087 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1088 StaticFunctionPtr m_nonzero;
1090 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1092 operator unspecified_bool_type()
const {
1093 return empty()? 0: &SafeBoolStruct::m_nonzero;
1096 inline bool operator==(StaticFunctionPtr funcptr) {
1097 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1098 inline bool operator!=(StaticFunctionPtr funcptr) {
1099 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1100 inline bool operator ! ()
const {
1101 return !m_Closure; }
1102 inline bool empty()
const {
1103 return !m_Closure; }
1104 void clear() { m_Closure.clear();}
1106 const DelegateMemento & GetMemento() {
return m_Closure; }
1107 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1110 RetType InvokeStaticFunction(Param1 p1, Param2 p2)
const {
1111 return (*(m_Closure.GetStaticFunction()))(p1, p2); }
1115 template<
class Param1,
class Param2,
class Param3,
class RetType=detail::DefaultVo
id>
1116 class FastDelegate3 {
1118 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1119 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3);
1120 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3);
1121 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3);
1122 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1123 ClosureType m_Closure;
1126 typedef FastDelegate3 type;
1129 FastDelegate3() { clear(); }
1130 FastDelegate3(
const FastDelegate3 &x) {
1131 m_Closure.CopyFrom(
this, x.m_Closure); }
1132 void operator = (
const FastDelegate3 &x) {
1133 m_Closure.CopyFrom(
this, x.m_Closure); }
1135 return m_Closure.IsEqual(x.m_Closure); }
1136 bool operator !=(
const FastDelegate3 &x)
const {
1137 return !m_Closure.IsEqual(x.m_Closure); }
1138 bool operator <(
const FastDelegate3 &x)
const {
1139 return m_Closure.IsLess(x.m_Closure); }
1140 bool operator >(
const FastDelegate3 &x)
const {
1141 return x.m_Closure.IsLess(m_Closure); }
1143 template <
class X,
class Y >
1144 FastDelegate3(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) {
1145 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1146 template <
class X,
class Y >
1147 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3)) {
1148 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1150 template <
class X,
class Y >
1151 FastDelegate3(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3)
const) {
1152 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1153 template <
class X,
class Y >
1154 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3)
const) {
1155 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1158 FastDelegate3(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) {
1159 bind(function_to_bind); }
1161 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3) ) {
1162 bind(function_to_bind); }
1163 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3)) {
1164 m_Closure.bindstaticfunc(
this, &FastDelegate3::InvokeStaticFunction,
1165 function_to_bind); }
1167 RetType operator() (Param1 p1, Param2 p2, Param3 p3)
const {
1168 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3); }
1171 typedef struct SafeBoolStruct {
1172 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1173 StaticFunctionPtr m_nonzero;
1175 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1177 operator unspecified_bool_type()
const {
1178 return empty()? 0: &SafeBoolStruct::m_nonzero;
1181 inline bool operator==(StaticFunctionPtr funcptr) {
1182 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1183 inline bool operator!=(StaticFunctionPtr funcptr) {
1184 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1185 inline bool operator ! ()
const {
1186 return !m_Closure; }
1187 inline bool empty()
const {
1188 return !m_Closure; }
1189 void clear() { m_Closure.clear();}
1191 const DelegateMemento & GetMemento() {
return m_Closure; }
1192 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1195 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3)
const {
1196 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3); }
1200 template<
class Param1,
class Param2,
class Param3,
class Param4,
class RetType=detail::DefaultVo
id>
1201 class FastDelegate4 {
1203 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1204 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4);
1205 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4);
1206 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4);
1207 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1208 ClosureType m_Closure;
1211 typedef FastDelegate4 type;
1214 FastDelegate4() { clear(); }
1215 FastDelegate4(
const FastDelegate4 &x) {
1216 m_Closure.CopyFrom(
this, x.m_Closure); }
1217 void operator = (
const FastDelegate4 &x) {
1218 m_Closure.CopyFrom(
this, x.m_Closure); }
1220 return m_Closure.IsEqual(x.m_Closure); }
1221 bool operator !=(
const FastDelegate4 &x)
const {
1222 return !m_Closure.IsEqual(x.m_Closure); }
1223 bool operator <(
const FastDelegate4 &x)
const {
1224 return m_Closure.IsLess(x.m_Closure); }
1225 bool operator >(
const FastDelegate4 &x)
const {
1226 return x.m_Closure.IsLess(m_Closure); }
1228 template <
class X,
class Y >
1229 FastDelegate4(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) {
1230 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1231 template <
class X,
class Y >
1232 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
1233 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1235 template <
class X,
class Y >
1236 FastDelegate4(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)
const) {
1237 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1238 template <
class X,
class Y >
1239 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)
const) {
1240 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1243 FastDelegate4(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) {
1244 bind(function_to_bind); }
1246 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4) ) {
1247 bind(function_to_bind); }
1248 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
1249 m_Closure.bindstaticfunc(
this, &FastDelegate4::InvokeStaticFunction,
1250 function_to_bind); }
1252 RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4)
const {
1253 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4); }
1256 typedef struct SafeBoolStruct {
1257 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1258 StaticFunctionPtr m_nonzero;
1260 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1262 operator unspecified_bool_type()
const {
1263 return empty()? 0: &SafeBoolStruct::m_nonzero;
1266 inline bool operator==(StaticFunctionPtr funcptr) {
1267 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1268 inline bool operator!=(StaticFunctionPtr funcptr) {
1269 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1270 inline bool operator ! ()
const {
1271 return !m_Closure; }
1272 inline bool empty()
const {
1273 return !m_Closure; }
1274 void clear() { m_Closure.clear();}
1276 const DelegateMemento & GetMemento() {
return m_Closure; }
1277 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1280 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4)
const {
1281 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4); }
1285 template<
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class RetType=detail::DefaultVo
id>
1286 class FastDelegate5 {
1288 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1289 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5);
1290 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5);
1291 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5);
1292 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1293 ClosureType m_Closure;
1296 typedef FastDelegate5 type;
1299 FastDelegate5() { clear(); }
1300 FastDelegate5(
const FastDelegate5 &x) {
1301 m_Closure.CopyFrom(
this, x.m_Closure); }
1302 void operator = (
const FastDelegate5 &x) {
1303 m_Closure.CopyFrom(
this, x.m_Closure); }
1305 return m_Closure.IsEqual(x.m_Closure); }
1306 bool operator !=(
const FastDelegate5 &x)
const {
1307 return !m_Closure.IsEqual(x.m_Closure); }
1308 bool operator <(
const FastDelegate5 &x)
const {
1309 return m_Closure.IsLess(x.m_Closure); }
1310 bool operator >(
const FastDelegate5 &x)
const {
1311 return x.m_Closure.IsLess(m_Closure); }
1313 template <
class X,
class Y >
1314 FastDelegate5(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) {
1315 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1316 template <
class X,
class Y >
1317 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
1318 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1320 template <
class X,
class Y >
1321 FastDelegate5(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)
const) {
1322 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1323 template <
class X,
class Y >
1324 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)
const) {
1325 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1328 FastDelegate5(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) {
1329 bind(function_to_bind); }
1331 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5) ) {
1332 bind(function_to_bind); }
1333 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
1334 m_Closure.bindstaticfunc(
this, &FastDelegate5::InvokeStaticFunction,
1335 function_to_bind); }
1337 RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)
const {
1338 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5); }
1341 typedef struct SafeBoolStruct {
1342 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1343 StaticFunctionPtr m_nonzero;
1345 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1347 operator unspecified_bool_type()
const {
1348 return empty()? 0: &SafeBoolStruct::m_nonzero;
1351 inline bool operator==(StaticFunctionPtr funcptr) {
1352 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1353 inline bool operator!=(StaticFunctionPtr funcptr) {
1354 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1355 inline bool operator ! ()
const {
1356 return !m_Closure; }
1357 inline bool empty()
const {
1358 return !m_Closure; }
1359 void clear() { m_Closure.clear();}
1361 const DelegateMemento & GetMemento() {
return m_Closure; }
1362 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1365 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)
const {
1366 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5); }
1370 template<
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class RetType=detail::DefaultVo
id>
1371 class FastDelegate6 {
1373 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1374 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6);
1375 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6);
1376 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6);
1377 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1378 ClosureType m_Closure;
1381 typedef FastDelegate6 type;
1384 FastDelegate6() { clear(); }
1385 FastDelegate6(
const FastDelegate6 &x) {
1386 m_Closure.CopyFrom(
this, x.m_Closure); }
1387 void operator = (
const FastDelegate6 &x) {
1388 m_Closure.CopyFrom(
this, x.m_Closure); }
1390 return m_Closure.IsEqual(x.m_Closure); }
1391 bool operator !=(
const FastDelegate6 &x)
const {
1392 return !m_Closure.IsEqual(x.m_Closure); }
1393 bool operator <(
const FastDelegate6 &x)
const {
1394 return m_Closure.IsLess(x.m_Closure); }
1395 bool operator >(
const FastDelegate6 &x)
const {
1396 return x.m_Closure.IsLess(m_Closure); }
1398 template <
class X,
class Y >
1399 FastDelegate6(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) {
1400 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1401 template <
class X,
class Y >
1402 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
1403 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1405 template <
class X,
class Y >
1406 FastDelegate6(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)
const) {
1407 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1408 template <
class X,
class Y >
1409 inline void bind(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)
const) {
1410 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1413 FastDelegate6(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) {
1414 bind(function_to_bind); }
1416 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6) ) {
1417 bind(function_to_bind); }
1418 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
1419 m_Closure.bindstaticfunc(
this, &FastDelegate6::InvokeStaticFunction,
1420 function_to_bind); }
1422 RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)
const {
1423 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6); }
1426 typedef struct SafeBoolStruct {
1427 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1428 StaticFunctionPtr m_nonzero;
1430 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1432 operator unspecified_bool_type()
const {
1433 return empty()? 0: &SafeBoolStruct::m_nonzero;
1436 inline bool operator==(StaticFunctionPtr funcptr) {
1437 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1438 inline bool operator!=(StaticFunctionPtr funcptr) {
1439 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1440 inline bool operator ! ()
const {
1441 return !m_Closure; }
1442 inline bool empty()
const {
1443 return !m_Closure; }
1444 void clear() { m_Closure.clear();}
1446 const DelegateMemento & GetMemento() {
return m_Closure; }
1447 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1450 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)
const {
1451 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6); }
1455 template<
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class RetType=detail::DefaultVo
id>
1456 class FastDelegate7 {
1458 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1459 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7);
1460 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7);
1461 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7);
1462 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1463 ClosureType m_Closure;
1466 typedef FastDelegate7 type;
1469 FastDelegate7() { clear(); }
1470 FastDelegate7(
const FastDelegate7 &x) {
1471 m_Closure.CopyFrom(
this, x.m_Closure); }
1472 void operator = (
const FastDelegate7 &x) {
1473 m_Closure.CopyFrom(
this, x.m_Closure); }
1475 return m_Closure.IsEqual(x.m_Closure); }
1476 bool operator !=(
const FastDelegate7 &x)
const {
1477 return !m_Closure.IsEqual(x.m_Closure); }
1478 bool operator <(
const FastDelegate7 &x)
const {
1479 return m_Closure.IsLess(x.m_Closure); }
1480 bool operator >(
const FastDelegate7 &x)
const {
1481 return x.m_Closure.IsLess(m_Closure); }
1483 template <
class X,
class Y >
1484 FastDelegate7(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) {
1485 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1486 template <
class X,
class Y >
1487 inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
1488 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1490 template <
class X,
class Y >
1491 FastDelegate7(
const Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)
const) {
1492 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1493 template <
class X,
class Y >
1494 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) {
1495 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1498 FastDelegate7(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) {
1499 bind(function_to_bind); }
1501 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7) ) {
1502 bind(function_to_bind); }
1503 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
1504 m_Closure.bindstaticfunc(
this, &FastDelegate7::InvokeStaticFunction,
1505 function_to_bind); }
1507 RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)
const {
1508 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7); }
1511 typedef struct SafeBoolStruct {
1512 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1513 StaticFunctionPtr m_nonzero;
1515 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1517 operator unspecified_bool_type()
const {
1518 return empty()? 0: &SafeBoolStruct::m_nonzero;
1521 inline bool operator==(StaticFunctionPtr funcptr) {
1522 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1523 inline bool operator!=(StaticFunctionPtr funcptr) {
1524 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1525 inline bool operator ! ()
const {
1526 return !m_Closure; }
1527 inline bool empty()
const {
1528 return !m_Closure; }
1529 void clear() { m_Closure.clear();}
1531 const DelegateMemento & GetMemento() {
return m_Closure; }
1532 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1535 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)
const {
1536 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7); }
1540 template<
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class Param8,
class RetType=detail::DefaultVo
id>
1541 class FastDelegate8 {
1543 typedef typename detail::DefaultVoidToVoid<RetType>::type DesiredRetType;
1544 typedef DesiredRetType (*StaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8);
1545 typedef RetType (*UnvoidStaticFunctionPtr)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8);
1546 typedef RetType (detail::GenericClass::*GenericMemFn)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8);
1547 typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr, UnvoidStaticFunctionPtr> ClosureType;
1548 ClosureType m_Closure;
1551 typedef FastDelegate8 type;
1554 FastDelegate8() { clear(); }
1555 FastDelegate8(
const FastDelegate8 &x) {
1556 m_Closure.CopyFrom(
this, x.m_Closure); }
1557 void operator = (
const FastDelegate8 &x) {
1558 m_Closure.CopyFrom(
this, x.m_Closure); }
1560 return m_Closure.IsEqual(x.m_Closure); }
1561 bool operator !=(
const FastDelegate8 &x)
const {
1562 return !m_Closure.IsEqual(x.m_Closure); }
1563 bool operator <(
const FastDelegate8 &x)
const {
1564 return m_Closure.IsLess(x.m_Closure); }
1565 bool operator >(
const FastDelegate8 &x)
const {
1566 return x.m_Closure.IsLess(m_Closure); }
1568 template <
class X,
class Y >
1569 FastDelegate8(Y *pthis, DesiredRetType (X::* function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) {
1570 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1571 template <
class X,
class Y >
1572 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)) {
1573 m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis), function_to_bind); }
1575 template <
class X,
class Y >
1576 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) {
1577 m_Closure.bindconstmemfunc(detail::implicit_cast<const X*>(pthis), function_to_bind); }
1578 template <
class X,
class Y >
1579 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) {
1580 m_Closure.bindconstmemfunc(detail::implicit_cast<const X *>(pthis), function_to_bind); }
1583 FastDelegate8(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) {
1584 bind(function_to_bind); }
1586 void operator = (DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8) ) {
1587 bind(function_to_bind); }
1588 inline void bind(DesiredRetType (*function_to_bind)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
1589 m_Closure.bindstaticfunc(
this, &FastDelegate8::InvokeStaticFunction,
1590 function_to_bind); }
1592 RetType operator() (Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)
const {
1593 return (m_Closure.GetClosureThis()->*(m_Closure.GetClosureMemPtr()))(p1, p2, p3, p4, p5, p6, p7, p8); }
1596 typedef struct SafeBoolStruct {
1597 int a_data_pointer_to_this_is_0_on_buggy_compilers;
1598 StaticFunctionPtr m_nonzero;
1600 typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
1602 operator unspecified_bool_type()
const {
1603 return empty()? 0: &SafeBoolStruct::m_nonzero;
1606 inline bool operator==(StaticFunctionPtr funcptr) {
1607 return m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1608 inline bool operator!=(StaticFunctionPtr funcptr) {
1609 return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }
1610 inline bool operator ! ()
const {
1611 return !m_Closure; }
1612 inline bool empty()
const {
1613 return !m_Closure; }
1614 void clear() { m_Closure.clear();}
1616 const DelegateMemento & GetMemento() {
return m_Closure; }
1617 void SetMemento(
const DelegateMemento &any) { m_Closure.CopyFrom(
this, any); }
1620 RetType InvokeStaticFunction(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)
const {
1621 return (*(m_Closure.GetStaticFunction()))(p1, p2, p3, p4, p5, p6, p7, p8); }
1636 #ifdef MIRTK_FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX 1640 template <
typename Signature>
1648 template<
typename R>
1649 class FastDelegate< R ( ) >
1651 :
public FastDelegate0 < R >
1655 typedef FastDelegate0 < R > BaseType;
1658 typedef FastDelegate SelfType;
1661 FastDelegate() : BaseType() { }
1663 template <
class X,
class Y >
1664 FastDelegate(Y * pthis,
1665 R (X::* function_to_bind)( ))
1666 : BaseType(pthis, function_to_bind) { }
1668 template <
class X,
class Y >
1669 FastDelegate(
const Y *pthis,
1670 R (X::* function_to_bind)( )
const)
1671 : BaseType(pthis, function_to_bind)
1674 FastDelegate(R (*function_to_bind)( ))
1675 : BaseType(function_to_bind) { }
1676 void operator = (
const BaseType &x) {
1677 *
static_cast<BaseType*
>(
this) = x; }
1685 template<
typename R,
class Param1>
1686 class FastDelegate< R ( Param1 ) >
1688 :
public FastDelegate1 < Param1, R >
1692 typedef FastDelegate1 < Param1, R > BaseType;
1695 typedef FastDelegate SelfType;
1698 FastDelegate() : BaseType() { }
1700 template <
class X,
class Y >
1701 FastDelegate(Y * pthis,
1702 R (X::* function_to_bind)( Param1 p1 ))
1703 : BaseType(pthis, function_to_bind) { }
1705 template <
class X,
class Y >
1706 FastDelegate(
const Y *pthis,
1707 R (X::* function_to_bind)( Param1 p1 )
const)
1708 : BaseType(pthis, function_to_bind)
1711 FastDelegate(R (*function_to_bind)( Param1 p1 ))
1712 : BaseType(function_to_bind) { }
1713 void operator = (
const BaseType &x) {
1714 *
static_cast<BaseType*
>(
this) = x; }
1722 template<
typename R,
class Param1,
class Param2>
1723 class FastDelegate< R ( Param1, Param2 ) >
1725 :
public FastDelegate2 < Param1, Param2, R >
1729 typedef FastDelegate2 < Param1, Param2, R > BaseType;
1732 typedef FastDelegate SelfType;
1735 FastDelegate() : BaseType() { }
1737 template <
class X,
class Y >
1738 FastDelegate(Y * pthis,
1739 R (X::* function_to_bind)( Param1 p1, Param2 p2 ))
1740 : BaseType(pthis, function_to_bind) { }
1742 template <
class X,
class Y >
1743 FastDelegate(
const Y *pthis,
1744 R (X::* function_to_bind)( Param1 p1, Param2 p2 )
const)
1745 : BaseType(pthis, function_to_bind)
1748 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2 ))
1749 : BaseType(function_to_bind) { }
1750 void operator = (
const BaseType &x) {
1751 *
static_cast<BaseType*
>(
this) = x; }
1759 template<
typename R,
class Param1,
class Param2,
class Param3>
1760 class FastDelegate< R ( Param1, Param2, Param3 ) >
1762 :
public FastDelegate3 < Param1, Param2, Param3, R >
1766 typedef FastDelegate3 < Param1, Param2, Param3, R > BaseType;
1769 typedef FastDelegate SelfType;
1772 FastDelegate() : BaseType() { }
1774 template <
class X,
class Y >
1775 FastDelegate(Y * pthis,
1776 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3 ))
1777 : BaseType(pthis, function_to_bind) { }
1779 template <
class X,
class Y >
1780 FastDelegate(
const Y *pthis,
1781 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3 )
const)
1782 : BaseType(pthis, function_to_bind)
1785 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3 ))
1786 : BaseType(function_to_bind) { }
1787 void operator = (
const BaseType &x) {
1788 *
static_cast<BaseType*
>(
this) = x; }
1796 template<
typename R,
class Param1,
class Param2,
class Param3,
class Param4>
1797 class FastDelegate< R ( Param1, Param2, Param3, Param4 ) >
1799 :
public FastDelegate4 < Param1, Param2, Param3, Param4, R >
1803 typedef FastDelegate4 < Param1, Param2, Param3, Param4, R > BaseType;
1806 typedef FastDelegate SelfType;
1809 FastDelegate() : BaseType() { }
1811 template <
class X,
class Y >
1812 FastDelegate(Y * pthis,
1813 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4 ))
1814 : BaseType(pthis, function_to_bind) { }
1816 template <
class X,
class Y >
1817 FastDelegate(
const Y *pthis,
1818 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4 )
const)
1819 : BaseType(pthis, function_to_bind)
1822 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4 ))
1823 : BaseType(function_to_bind) { }
1824 void operator = (
const BaseType &x) {
1825 *
static_cast<BaseType*
>(
this) = x; }
1833 template<
typename R,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5>
1834 class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5 ) >
1836 :
public FastDelegate5 < Param1, Param2, Param3, Param4, Param5, R >
1840 typedef FastDelegate5 < Param1, Param2, Param3, Param4, Param5, R > BaseType;
1843 typedef FastDelegate SelfType;
1846 FastDelegate() : BaseType() { }
1848 template <
class X,
class Y >
1849 FastDelegate(Y * pthis,
1850 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5 ))
1851 : BaseType(pthis, function_to_bind) { }
1853 template <
class X,
class Y >
1854 FastDelegate(
const Y *pthis,
1855 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5 )
const)
1856 : BaseType(pthis, function_to_bind)
1859 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5 ))
1860 : BaseType(function_to_bind) { }
1861 void operator = (
const BaseType &x) {
1862 *
static_cast<BaseType*
>(
this) = x; }
1870 template<
typename R,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6>
1871 class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6 ) >
1873 :
public FastDelegate6 < Param1, Param2, Param3, Param4, Param5, Param6, R >
1877 typedef FastDelegate6 < Param1, Param2, Param3, Param4, Param5, Param6, R > BaseType;
1880 typedef FastDelegate SelfType;
1883 FastDelegate() : BaseType() { }
1885 template <
class X,
class Y >
1886 FastDelegate(Y * pthis,
1887 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6 ))
1888 : BaseType(pthis, function_to_bind) { }
1890 template <
class X,
class Y >
1891 FastDelegate(
const Y *pthis,
1892 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6 )
const)
1893 : BaseType(pthis, function_to_bind)
1896 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6 ))
1897 : BaseType(function_to_bind) { }
1898 void operator = (
const BaseType &x) {
1899 *
static_cast<BaseType*
>(
this) = x; }
1907 template<
typename R,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7>
1908 class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7 ) >
1910 :
public FastDelegate7 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, R >
1914 typedef FastDelegate7 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, R > BaseType;
1917 typedef FastDelegate SelfType;
1920 FastDelegate() : BaseType() { }
1922 template <
class X,
class Y >
1923 FastDelegate(Y * pthis,
1924 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7 ))
1925 : BaseType(pthis, function_to_bind) { }
1927 template <
class X,
class Y >
1928 FastDelegate(
const Y *pthis,
1929 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7 )
const)
1930 : BaseType(pthis, function_to_bind)
1933 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7 ))
1934 : BaseType(function_to_bind) { }
1935 void operator = (
const BaseType &x) {
1936 *
static_cast<BaseType*
>(
this) = x; }
1944 template<
typename R,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class Param8>
1945 class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8 ) >
1947 :
public FastDelegate8 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, R >
1951 typedef FastDelegate8 < Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, R > BaseType;
1954 typedef FastDelegate SelfType;
1957 FastDelegate() : BaseType() { }
1959 template <
class X,
class Y >
1960 FastDelegate(Y * pthis,
1961 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8 ))
1962 : BaseType(pthis, function_to_bind) { }
1964 template <
class X,
class Y >
1965 FastDelegate(
const Y *pthis,
1966 R (X::* function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8 )
const)
1967 : BaseType(pthis, function_to_bind)
1970 FastDelegate(R (*function_to_bind)( Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8 ))
1971 : BaseType(function_to_bind) { }
1972 void operator = (
const BaseType &x) {
1973 *
static_cast<BaseType*
>(
this) = x; }
1977 #endif //MIRTK_FASTDELEGATE_ALLOW_FUNCTION_TYPE_SYNTAX 2003 #ifdef MIRTK_FASTDLGT_VC6 2004 #define MIRTK_FASTDLGT_RETTYPE detail::VoidToDefaultVoid<RetType>::type 2006 #define MIRTK_FASTDLGT_RETTYPE RetType 2010 template <
class X,
class Y,
class RetType>
2011 FastDelegate0<MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)()) {
2012 return FastDelegate0<MIRTK_FASTDLGT_RETTYPE>(x, func);
2015 template <
class X,
class Y,
class RetType>
2016 FastDelegate0<MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)()
const) {
2017 return FastDelegate0<MIRTK_FASTDLGT_RETTYPE>(x, func);
2021 template <
class X,
class Y,
class Param1,
class RetType>
2022 FastDelegate1<Param1, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1)) {
2023 return FastDelegate1<Param1, MIRTK_FASTDLGT_RETTYPE>(x, func);
2026 template <
class X,
class Y,
class Param1,
class RetType>
2027 FastDelegate1<Param1, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1)
const) {
2028 return FastDelegate1<Param1, MIRTK_FASTDLGT_RETTYPE>(x, func);
2032 template <
class X,
class Y,
class Param1,
class Param2,
class RetType>
2033 FastDelegate2<Param1, Param2, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2)) {
2034 return FastDelegate2<Param1, Param2, MIRTK_FASTDLGT_RETTYPE>(x, func);
2037 template <
class X,
class Y,
class Param1,
class Param2,
class RetType>
2038 FastDelegate2<Param1, Param2, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2)
const) {
2039 return FastDelegate2<Param1, Param2, MIRTK_FASTDLGT_RETTYPE>(x, func);
2043 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class RetType>
2044 FastDelegate3<Param1, Param2, Param3, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3)) {
2045 return FastDelegate3<Param1, Param2, Param3, MIRTK_FASTDLGT_RETTYPE>(x, func);
2048 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class RetType>
2049 FastDelegate3<Param1, Param2, Param3, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3)
const) {
2050 return FastDelegate3<Param1, Param2, Param3, MIRTK_FASTDLGT_RETTYPE>(x, func);
2054 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class RetType>
2055 FastDelegate4<Param1, Param2, Param3, Param4, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)) {
2056 return FastDelegate4<Param1, Param2, Param3, Param4, MIRTK_FASTDLGT_RETTYPE>(x, func);
2059 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class RetType>
2060 FastDelegate4<Param1, Param2, Param3, Param4, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4)
const) {
2061 return FastDelegate4<Param1, Param2, Param3, Param4, MIRTK_FASTDLGT_RETTYPE>(x, func);
2065 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class RetType>
2066 FastDelegate5<Param1, Param2, Param3, Param4, Param5, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)) {
2067 return FastDelegate5<Param1, Param2, Param3, Param4, Param5, MIRTK_FASTDLGT_RETTYPE>(x, func);
2070 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class RetType>
2071 FastDelegate5<Param1, Param2, Param3, Param4, Param5, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5)
const) {
2072 return FastDelegate5<Param1, Param2, Param3, Param4, Param5, MIRTK_FASTDLGT_RETTYPE>(x, func);
2076 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class RetType>
2077 FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)) {
2078 return FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, MIRTK_FASTDLGT_RETTYPE>(x, func);
2081 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class RetType>
2082 FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6)
const) {
2083 return FastDelegate6<Param1, Param2, Param3, Param4, Param5, Param6, MIRTK_FASTDLGT_RETTYPE>(x, func);
2087 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class RetType>
2088 FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)) {
2089 return FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, MIRTK_FASTDLGT_RETTYPE>(x, func);
2092 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class RetType>
2093 FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7)
const) {
2094 return FastDelegate7<Param1, Param2, Param3, Param4, Param5, Param6, Param7, MIRTK_FASTDLGT_RETTYPE>(x, func);
2098 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class Param8,
class RetType>
2099 FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, MIRTK_FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3, Param4 p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8)) {
2100 return FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, MIRTK_FASTDLGT_RETTYPE>(x, func);
2103 template <
class X,
class Y,
class Param1,
class Param2,
class Param3,
class Param4,
class Param5,
class Param6,
class Param7,
class Param8,
class RetType>
2104 FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, MIRTK_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) {
2105 return FastDelegate8<Param1, Param2, Param3, Param4, Param5, Param6, Param7, Param8, MIRTK_FASTDLGT_RETTYPE>(x, func);
2110 #undef MIRTK_FASTDLGT_RETTYPE 2114 #endif // !defined(MIRTK_FastDelegate_H) MIRTKCU_API bool operator<(const float1 &a, const float1 &b)
Check if 1D vector is lexicographically less than another.
MIRTKCU_API bool operator==(const float1 &a, const float1 &b)
Check two 1D vectors for equality.