Please give me some feedback of this work
Thanks a lot
Giuseppe Bollani
P.S.
Next Week I'll try to post some suggestions on using AMOP to mock non-pure
virtual classes.
>----Messaggio originale----
>Da: kirk_...@hotmail.com
>Data: 7-apr-2010 16.50
>A: <amop-...@googlegroups.com>
>Ogg: RE: [amop-group] Need directions to post my contribution on better
managing the number of supported arguments
>
>Will you please give me a 'patch' file, and specify which branch you are
>'patching'? Attachments are fine, or you can put it directly in the email.
>--Kirk
>
>> -----Original Message-----
>> From: amop-...@googlegroups.com [mailto:amop-...@googlegroups.com]
>> On Behalf Of g.bo...@libero.it
>> Sent: Tuesday, April 06, 2010 2:34 PM
>> To: amop-...@googlegroups.com
>> Subject: [amop-group] Need directions to post my contribution on better
>> managing the number of supported arguments
>>
>> Hi all,
>> I would like to post my contribution on how to improve the management
>> of
>> supported arguments.
>> But I do not know how it works and I need instructions.
>> Can you help me and explain me how I can get it?
>>
>> At present, my modifications are in my project working copy and I do
>> not know
>> how to publish them in the main stream.
>> Do I simply have to commit from subversion or do I need to do something
>> else?
>> If the second, please, explain me.
>>
>> Waiting forward for your kind reply.
>> G. Bollani
>>
>>
>> -----------------------------------------------------------------------
>> --------------------------------------------------------
>> Here in the following, my proposed modifications.
>>
>> In order to better manage changing the maximum number of arguments
>> for method and function, I used the macros defined in MacroRepeat.h
>> and I have added some other macros to MacroRepeat.h and MacriMisch.h
>> In this way, I was able to change the argument limit from 15 up to 17
>> In the future, the changing of this limit will be easily managed,
>> simply
>> modifying
>> a define value.
>>
>> >>> FILE ADDED
>> 1) BaseConfig.h
>> I have added a new file BaseConfig.h which only contains
>> the define >>>> #define MAX_PARAMS 17
>> Using the proposed modification, the above line is the only one that
>> a User need to change in order to manage a increase/decrease the
>> maximum
>> number of function arguments
>>
>> Here below, I list the modifications to be inserted into each files, in
>> order
>> to use the variation I suggest.
>>
>> >>> FILE CHANGED
>> In the below listed files, insert the include lines:
>> #include "BaseConfig.h"
>> #include "MacroMisc.h"
>>
>> Files to be updated:
>> Config.h
>> ExpectsMaker.h
>> FastDelegate.h
>> FastDelegateBind.h
>> FunctionHolder.h
>> Functor.h
>> ReturnMatchBuilder.h
>> Tuple.h
>>
>>
>>
>>
>> 1) MacroRepeat.h
>> I have added the new macro
>> #define AS_DETAIL_REPEAT(n, m, l, p) DETAIL_APPEND(DETAIL_REPEAT_,
>> DETAIL_DEC
>> (n))(m,l,p) l(n,p)
>> This Macro is the same as DETAIL_REPEAT, but it is used in some cases
>> when
>> nested DETAIL_REPEAT doesn't work
>>
>> 2) MacroMisc.h
>> I have added some macros used in the modified files
>>
>> #define CALL_MACRO_WITH_NUM(n, m) m(n)
>> #define AS_CALL_MACRO_WITH_NUM(n, m) m(n)
>> #define CALL_MACRO_WITH_NUM_ADD_COLON_AT_END(n, m) m(n),
>> #define CALL_MACRO_WITH_NUM_ADD_SEMICOLON_AT_END(n, m) m(n);
>>
>> #define DECL_CLASS_PARAM(x) class Param##x
>> #define DECL_CLASS_PARAM_LIST(n) DETAIL_REPEAT(n,
>> CALL_MACRO_WITH_NUM_ADD_COLON_AT_END, CALL_MACRO_WITH_NUM,
>> DECL_CLASS_PARAM)
>> #define DECL_PARAM(x) Param##x p##x
>> #define DECL_PARAM_LIST(n) DETAIL_REPEAT(n,
>> CALL_MACRO_WITH_NUM_ADD_COLON_AT_END, CALL_MACRO_WITH_NUM, DECL_PARAM)
>> #define DECL_PARAM_TEMPLATE(x) Param##x
>> #define DECL_PARAM_TEMPLATE_LIST(n) DETAIL_REPEAT(n,
>> CALL_MACRO_WITH_NUM_ADD_COLON_AT_END, CALL_MACRO_WITH_NUM,
>> DECL_PARAM_TEMPLATE)
>> #define DECL_PARAM_VAR(x) p##x
>> #define DECL_PARAM_VAR_LIST(n) DETAIL_REPEAT(n,
>> CALL_MACRO_WITH_NUM_ADD_COLON_AT_END, CALL_MACRO_WITH_NUM,
>> DECL_PARAM_VAR)
>>
>> #define REPEAT_MACRO(n, m) AS_DETAIL_REPEAT(n, AS_CALL_MACRO_WITH_NUM,
>> AS_CALL_MACRO_WITH_NUM, m)
>> #define REPEAT_MACRO_WITH_COLON(n, m) AS_DETAIL_REPEAT(n,
>> CALL_MACRO_WITH_NUM_ADD_COLON_AT_END, CALL_MACRO_WITH_NUM, m)
>>
>> 3) Config.h
>> >>> Original source code:
>> #define DETAIL_TYPELIST_WITHOUT_HEAD typename T2,typename T3, typename
>> T4, \
>> typename T5, typename T6, typename T7, typename T8, typename T9, \
>> typename T10, typename T11, typename T12, typename T13, typename
>> T14, \
>> typename T15
>> #define DETAIL_TYPELIST typename T1, DETAIL_TYPELIST_WITHOUT_HEAD
>> >>> New source code, using suggested new macros
>> #define TYPENAME_TNUM(n) typename T##n
>> #define DETAIL_TYPELIST REPEAT_MACRO_WITH_COLON(MAX_PARAMS,
>> TYPENAME_TNUM)
>>
>> >>> Original source code:
>> #define DETAIL_TYPELIST_DEFAULT typename T1=Empty, typename
>> T2=Empty,typename
>> T3=Empty, typename T4=Empty, \
>> typename T5=Empty, typename T6=Empty, typename T7=Empty, typename
>> T8=Empty, typename T9=Empty, \
>> typename T10=Empty, typename T11=Empty, typename T12=Empty,
>> typename
>> T13=Empty, typename T14=Empty, \
>> typename T15=Empty
>> >>> New source code, using suggested new macros
>> #define TYPENAME_TNUM_EMPTY(n) typename T##n=Empty
>> #define DETAIL_TYPELIST_DEFAULT REPEAT_MACRO_WITH_COLON(MAX_PARAMS,
>> TYPENAME_TNUM_EMPTY)
>>
>> >>> Original source code:
>> #define DETAIL_TYPELIST_EMPTY Empty, Empty, Empty, Empty, \
>> Empty, Empty, Empty, Empty, Empty, \
>> Empty, Empty, Empty, Empty, Empty, \
>> Empty
>> >>> New source code, using suggested new macros
>> #define DETAIL_TYPELIST_EMPTY REPEAT_MACRO_WITH_COLON(MAX_PARAMS,
>> Empty)
>>
>> 4) ExpectsMaker.h
>>
>> >>> Original source code:
>> : p0(t1)
>> , p1(t2)
>> , p2(t3)
>> , p3(t4)
>> , p4(t5)
>> , p5(t6)
>> , p6(t7)
>> , p7(t8)
>> , p8(t9)
>> , p9(t10)
>> , p10(t11)
>> , p11(t12)
>> , p12(t13)
>> , p13(t14)
>> , p14(t15)
>> >>> New source code, using suggested new macros
>> #define DECLARE_PNUM_MINUS_ONE_THEN_TNUM(n) DETAIL_APPEND(p,
>> DETAIL_DEC(n))
>> (t##n)
>> REPEAT_MACRO_WITH_COLON(MAX_PARAMS, DECLARE_PNUM_MINUS_ONE_THEN_TNUM)
>>
>> >>> Original source code:
>> T1 p0;
>> T2 p1;
>> T3 p2;
>> T4 p3;
>> T5 p4;
>> T6 p5;
>> T7 p6;
>> T8 p7;
>> T9 p8;
>> T10 p9;
>> T11 p10;
>> T12 p11;
>> T13 p12;
>> T14 p13;
>> T15 p14;
>> >>> New source code, using suggested new macros
>> #define DECLARE_TNUM_THEN_PNUM_MINUS_ONE(n) T##n DETAIL_APPEND(p,
>> DETAIL_DEC
>> (n));
>> REPEAT_MACRO(MAX_PARAMS, DECLARE_TNUM_THEN_PNUM_MINUS_ONE)
>>
>> >>> Original source code:
>> DETAIL_ALL_MAKER_BUILD(1);
>> DETAIL_ALL_MAKER_BUILD(2);
>> DETAIL_ALL_MAKER_BUILD(3);
>> DETAIL_ALL_MAKER_BUILD(4);
>> DETAIL_ALL_MAKER_BUILD(5);
>> DETAIL_ALL_MAKER_BUILD(6);
>> DETAIL_ALL_MAKER_BUILD(7);
>> DETAIL_ALL_MAKER_BUILD(8);
>> DETAIL_ALL_MAKER_BUILD(9);
>> DETAIL_ALL_MAKER_BUILD(10);
>> DETAIL_ALL_MAKER_BUILD(11);
>> DETAIL_ALL_MAKER_BUILD(12);
>> DETAIL_ALL_MAKER_BUILD(13);
>> DETAIL_ALL_MAKER_BUILD(14);
>> DETAIL_ALL_MAKER_BUILD(15);
>> >>> New source code, using suggested new macros
>> REPEAT_MACRO(MAX_PARAMS, DETAIL_ALL_MAKER_BUILD)
>>
>> >>> Original source code:
>> DETAIL_MAKE_EXPECT_MAKER(1);
>> DETAIL_MAKE_EXPECT_MAKER(2);
>> DETAIL_MAKE_EXPECT_MAKER(3);
>> DETAIL_MAKE_EXPECT_MAKER(4);
>> DETAIL_MAKE_EXPECT_MAKER(5);
>> DETAIL_MAKE_EXPECT_MAKER(6);
>> DETAIL_MAKE_EXPECT_MAKER(7);
>> DETAIL_MAKE_EXPECT_MAKER(8);
>> DETAIL_MAKE_EXPECT_MAKER(9);
>> DETAIL_MAKE_EXPECT_MAKER(10);
>> DETAIL_MAKE_EXPECT_MAKER(11);
>> DETAIL_MAKE_EXPECT_MAKER(12);
>> DETAIL_MAKE_EXPECT_MAKER(13);
>> DETAIL_MAKE_EXPECT_MAKER(14);
>> DETAIL_MAKE_EXPECT_MAKER(15);
>> >>> New source code, using suggested new macros
>> REPEAT_MACRO(MAX_PARAMS, DETAIL_MAKE_EXPECT_MAKER)
>>
>> 5) functor.h
>>
>> >>> Original source code:
>> DETAIL_FUNCTION_BUILD(1);
>> DETAIL_FUNCTION_BUILD(2);
>> DETAIL_FUNCTION_BUILD(3);
>> DETAIL_FUNCTION_BUILD(4);
>> DETAIL_FUNCTION_BUILD(5);
>> DETAIL_FUNCTION_BUILD(6);
>> DETAIL_FUNCTION_BUILD(7);
>> DETAIL_FUNCTION_BUILD(8);
>> DETAIL_FUNCTION_BUILD(9);
>> DETAIL_FUNCTION_BUILD(10);
>> DETAIL_FUNCTION_BUILD(11);
>> DETAIL_FUNCTION_BUILD(12);
>> DETAIL_FUNCTION_BUILD(13);
>> DETAIL_FUNCTION_BUILD(14);
>> DETAIL_FUNCTION_BUILD(15);
>> >>> New source code, using suggested new macros
>> REPEAT_MACRO(MAX_PARAMS, DETAIL_FUNCTION_BUILD)
>>
>> 6) FunctionHolder.h
>> >>> Original source code:
>> DETAIL_FUNCTIONHOLDER_BUILD(1);
>> DETAIL_FUNCTIONHOLDER_BUILD(2);
>> DETAIL_FUNCTIONHOLDER_BUILD(3);
>> DETAIL_FUNCTIONHOLDER_BUILD(4);
>> DETAIL_FUNCTIONHOLDER_BUILD(5);
>> DETAIL_FUNCTIONHOLDER_BUILD(6);
>> DETAIL_FUNCTIONHOLDER_BUILD(7);
>> DETAIL_FUNCTIONHOLDER_BUILD(8);
>> DETAIL_FUNCTIONHOLDER_BUILD(9);
>> DETAIL_FUNCTIONHOLDER_BUILD(10);
>> DETAIL_FUNCTIONHOLDER_BUILD(11);
>> DETAIL_FUNCTIONHOLDER_BUILD(12);
>> DETAIL_FUNCTIONHOLDER_BUILD(13);
>> DETAIL_FUNCTIONHOLDER_BUILD(14);
>> DETAIL_FUNCTIONHOLDER_BUILD(15);
>> >>> New source code, using suggested new macros
>> REPEAT_MACRO(MAX_PARAMS, DETAIL_FUNCTIONHOLDER_BUILD)
>>
>> 7) Tuple.h
>> >>> Original source code:
>> typedef Tuple< T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14,
>> T15 >
>> tail;
>> >>> New source code, using suggested new macros
>> #define DECLARE_TNUM_PLUS(n) DETAIL_APPEND(T, DETAIL_INC(n))
>> typedef Tuple< REPEAT_MACRO_WITH_COLON(DETAIL_DEC(MAX_PARAMS),
>> DECLARE_TNUM_PLUS) > tail;
>>
>> 8) ReturnMatchBuilder.h
>> >>> Original source code:
>> template<DETAIL_TPARAMS(15)>
>> ReturnMatchBuilder expectInternal(const
>> detail::ExpectAll<DETAIL_ARGS
>> (15)>& expect)
>> >>> New source code, using suggested new macros
>> template<DETAIL_TPARAMS(MAX_PARAMS)>
>> ReturnMatchBuilder expectInternal(const
>> detail::ExpectAll<DETAIL_ARGS
>> (MAX_PARAMS)>& expect)
>>
>> 9) FastDelegateBind.h
>> >>> Original source code:
>> //N=1
>> template <class X, class Y, class RetType, class Param1>
>> FastDelegate< RetType ( Param1 p1 ) >
>> bind(
>> RetType (X::*func)( Param1 p1 ),
>> Y * y,
>> ...)
>> {
>> return FastDelegate< RetType ( Param1 p1 ) >(y, func);
>> }
>>
>> template <class X, class Y, class RetType, class Param1>
>> FastDelegate< RetType ( Param1 p1 ) >
>> bind(
>> RetType (X::*func)( Param1 p1 ) const,
>> Y * y,
>> ...)
>> {
>> return FastDelegate< RetType ( Param1 p1 ) >(y, func);
>> }
>> ...
>> //N=15
>> ...
>> ...
>> >>> New source code, using suggested new macros
>> #define DECL_FAST_DELEGATE_BIND(n) \
>> template <class X, class Y, class RetType, DECL_CLASS_PARAM_LIST(n)>\
>> FastDelegate< RetType ( DECL_PARAM_LIST(n) ) >\
>> bind(\
>> RetType (X::*func)( DECL_PARAM_LIST(n) ),\
>> Y * y,\
>> ...)\
>> { \
>> return FastDelegate< RetType ( DECL_PARAM_LIST(n) ) >(y, func);\
>> }\
>> template <class X, class Y, class RetType, DECL_CLASS_PARAM_LIST(n)>\
>> FastDelegate< RetType ( DECL_PARAM_LIST(n) ) >\
>> bind(\
>> RetType (X::*func)( DECL_PARAM_LIST(n) ) const,\
>> Y * y,\
>> ...)\
>> { \
>> return FastDelegate< RetType ( DECL_PARAM_LIST(n) ) >(y, func);\
>> }
>>
>> 10) FastDelegate.h
>> >>> Original source code:
>> >>> Code lines from
>> //N=1
>> template<class Param1, class RetType=detail::DefaultVoid>
>> class FastDelegate1 {
>> ....
>>
>> >>> up to
>>
>> ...
>> //N=15
>> template<class Param1, class Param2, class Param3, class Param4, class
>> Param5,
>> class Param6, class Param7, class Param8, class Param9, class Param10,
>> class
>> Param11, class Param12, class Param13, class Param14, class Param15,
>> class
>> RetType=detail::DefaultVoid>
>> class FastDelegate15 {
>> private:
>> ...
>> };
>> >>> Are to be replaced by
>> >>> New source code, using suggested new macros
>> #define DECL_FAST_DELEGATE_NUM_CLASS(n)\
>> template<DECL_CLASS_PARAM_LIST(n), class RetType=detail::DefaultVoid>\
>> class FastDelegate##n {\
>> private:\
>> typedef typename detail::DefaultVoidToVoid<RetType>::type
>> DesiredRetType;\
>> typedef DesiredRetType
>> (*StaticFunctionPtr)(DECL_PARAM_TEMPLATE_LIST(n));\
>> typedef RetType
>> (*UnvoidStaticFunctionPtr)(DECL_PARAM_TEMPLATE_LIST(n));\
>> typedef RetType
>> (detail::GenericClass::*GenericMemFn)(DECL_PARAM_TEMPLATE_LIST
>> (n));\
>> typedef detail::ClosurePtr<GenericMemFn, StaticFunctionPtr,
>> UnvoidStaticFunctionPtr> ClosureType;\
>> ClosureType m_Closure;\
>> public:\
>> typedef FastDelegate##n type;\
>> FastDelegate##n() { clear(); }\
>> FastDelegate##n(const FastDelegate##n &x) {\
>> m_Closure.CopyFrom(this, x.m_Closure); }\
>> void operator = (const FastDelegate##n &x) {\
>> m_Closure.CopyFrom(this, x.m_Closure); }\
>> bool operator ==(const FastDelegate##n &x) const {\
>> return m_Closure.IsEqual(x.m_Closure); }\
>> bool operator !=(const FastDelegate##n &x) const {\
>> return !m_Closure.IsEqual(x.m_Closure); }\
>> bool operator <(const FastDelegate##n &x) const {\
>> return m_Closure.IsLess(x.m_Closure); }\
>> bool operator >(const FastDelegate##n &x) const {\
>> return x.m_Closure.IsLess(m_Closure); }\
>> template < class X, class Y >\
>> FastDelegate##n(Y *pthis, DesiredRetType (X::* function_to_bind)
>> (DECL_PARAM_TEMPLATE_LIST(n)) ) {\
>> m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis),
>> function_to_bind); }
>> \
>> template < class X, class Y >\
>> inline void bind(Y *pthis, DesiredRetType (X::* function_to_bind)
>> (DECL_PARAM_TEMPLATE_LIST(n))) {\
>> m_Closure.bindmemfunc(detail::implicit_cast<X*>(pthis),
>> function_to_bind); }
>> \
>> template < class X, class Y >\
>> FastDelegate##n(const Y *pthis, DesiredRetType (X::*
>> function_to_bind)
>> (DECL_PARAM_TEMPLATE_LIST(n)) const) {\
>> m_Closure.bindconstmemfunc(detail::implicit_cast<const
>> X*>(pthis),
>> function_to_bind); }\
>> template < class X, class Y >\
>> inline void bind(const Y *pthis, DesiredRetType (X::*
>> function_to_bind)
>> (DECL_PARAM_TEMPLATE_LIST(n)) const) {\
>> m_Closure.bindconstmemfunc(detail::implicit_cast<const X
>> *>(pthis),
>> function_to_bind); }\
>> FastDelegate##n(DesiredRetType
>> (*function_to_bind)(DECL_PARAM_TEMPLATE_LIST
>> (n)) ) {\
>> bind(function_to_bind); }\
>> void operator = (DesiredRetType
>> (*function_to_bind)(DECL_PARAM_TEMPLATE_LIST
>> (n)) ) {\
>> bind(function_to_bind); }\
>> inline void bind(DesiredRetType
>> (*function_to_bind)(DECL_PARAM_TEMPLATE_LIST
>> (n))) {\
>> m_Closure.bindstaticfunc(this,
>> &FastDelegate##n::InvokeStaticFunction, \
>> function_to_bind); }\
>> RetType operator() (DECL_PARAM_LIST(n)) const {\
>> return (m_Closure.GetClosureThis()-
>> >*(m_Closure.GetClosureMemPtr()))
>> (DECL_PARAM_VAR_LIST(n)); }\
>> private:\
>> typedef struct SafeBoolStruct {\
>> int a_data_pointer_to_this_is_0_on_buggy_compilers;\
>> StaticFunctionPtr m_nonzero;\
>> } UselessTypedef;\
>> typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;\
>> public:\
>> operator unspecified_bool_type() const {\
>> return empty()? 0: &SafeBoolStruct::m_nonzero;\
>> }\
>> inline bool operator==(StaticFunctionPtr funcptr) {\
>> return m_Closure.IsEqualToStaticFuncPtr(funcptr); }\
>> inline bool operator!=(StaticFunctionPtr funcptr) { \
>> return !m_Closure.IsEqualToStaticFuncPtr(funcptr); }\
>> inline bool operator ! () const {\
>> return !m_Closure; }\
>> inline bool empty() const {\
>> return !m_Closure; }\
>> void clear() { m_Closure.clear();}\
>> const DelegateMemento & GetMemento() { return m_Closure; }\
>> void SetMemento(const DelegateMemento &any) {
>> m_Closure.CopyFrom(this, any); }
>> \
>> private:\
>> RetType InvokeStaticFunction(DECL_PARAM_LIST(n)) const {\
>> return
>> (*(m_Closure.GetStaticFunction()))(DECL_PARAM_VAR_LIST(n)); }\
>> };
>>
>> REPEAT_MACRO(MAX_PARAMS, DECL_FAST_DELEGATE_NUM_CLASS)
>>
>> >>> Original source code:
>> >>> Code lines from
>>
>> //N=1
>> // Specialization to allow use of
>> // FastDelegate< R ( Param1 ) >
>> // instead of
>> // FastDelegate1 < Param1, R >
>> template<typename R, class Param1>
>> class FastDelegate< R ( Param1 ) >
>> // Inherit from FastDelegate1 so that it can be treated just like a
>> FastDelegate1
>> : public FastDelegate1 < Param1, R >
>> ...
>> >>> up to
>> //N=15
>> // Specialization to allow use of
>> // FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6,
>> Param7,
>> Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15 )
>> >
>> // instead of
>> // FastDelegate15 < Param1, Param2, Param3, Param4, Param5, Param6,
>> Param7,
>> Param8, Param9, Param10, Param11, Param12, Param13, Param14, Param15, R
>> >
>> template<typename R, class Param1, class Param2, class Param3, class
>> Param4,
>> class Param5, class Param6, class Param7, class Param8, class Param9,
>> class
>> Param10, class Param11, class Param12, class Param13, class Param14,
>> class
>> Param15>
>> class FastDelegate< R ( Param1, Param2, Param3, Param4, Param5, Param6,
>> Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14,
>> Param15 )
>> >
>> // Inherit from FastDelegate15 so that it can be treated just like
>> a
>> FastDelegate15
>> : public FastDelegate15 < Param1, Param2, Param3, Param4, Param5,
>> Param6,
>> Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14,
>> Param15, R
>> >
>> {
>> ...
>> };
>>
>> >>> Are to be replaced by
>> >>> New source code, using suggested new macros
>> #define DECL_FAST_DELEGATE_CLASS(n)\
>> template<typename R, DECL_CLASS_PARAM_LIST(n)>\
>> class FastDelegate< R ( DECL_PARAM_TEMPLATE_LIST(n) ) >\
>> : public FastDelegate##n < DECL_PARAM_TEMPLATE_LIST(n), R >\
>> {\
>> public:\
>> typedef FastDelegate##n < DECL_PARAM_TEMPLATE_LIST(n), R > BaseType;\
>> \
>> typedef FastDelegate SelfType;\
>> \
>> FastDelegate() : BaseType() { }\
>> \
>> template < class X, class Y >\
>> FastDelegate(Y * pthis, \
>> R (X::* function_to_bind)( DECL_PARAM_LIST(n) ))\
>> : BaseType(pthis, function_to_bind) { }\
>> \
>> template < class X, class Y >\
>> FastDelegate(const Y *pthis,\
>> R (X::* function_to_bind)( DECL_PARAM_LIST(n) ) const)\
>> : BaseType(pthis, function_to_bind)\
>> { }\
>> \
>> FastDelegate(R (*function_to_bind)( DECL_PARAM_LIST(n) ))\
>> : BaseType(function_to_bind) { }\
>> void operator = (const BaseType &x) { \
>> *static_cast<BaseType*>(this) = x; }\
>> };
>> REPEAT_MACRO(MAX_PARAMS, DECL_FAST_DELEGATE_CLASS)
>>
>> >>> Original source code:
>> >>> Similarly, the source code lines from
>>
>> //N=1
>> template <class X, class Y, class Param1, class RetType>
>> FastDelegate1<Param1, FASTDLGT_RETTYPE> MakeDelegate(Y* x, RetType
>> (X::*func)
>> (Param1 p1)) {
>> return FastDelegate1<Param1, FASTDLGT_RETTYPE>(x, func);
>> }
>> ...
>> ... up to
>> //N=15
>> template <class X, class Y, class Param1, class Param2, class Param3,
>> class
>> Param4, class Param5, class Param6, class Param7, class Param8, class
>> Param9,
>> class Param10, class Param11, class Param12, class Param13, class
>> Param14,
>> class Param15, class RetType>
>> FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7,
>> Param8,
>> Param9, Param10, Param11, Param12, Param13, Param14, Param15,
>> FASTDLGT_RETTYPE>
>> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3,
>> Param4
>> p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10,
>> Param11
>> p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15)) {
>> return FastDelegate15<Param1, Param2, Param3, Param4, Param5,
>> Param6,
>> Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14,
>> Param15,
>> FASTDLGT_RETTYPE>(x, func);
>> }
>>
>> template <class X, class Y, class Param1, class Param2, class Param3,
>> class
>> Param4, class Param5, class Param6, class Param7, class Param8, class
>> Param9,
>> class Param10, class Param11, class Param12, class Param13, class
>> Param14,
>> class Param15, class RetType>
>> FastDelegate15<Param1, Param2, Param3, Param4, Param5, Param6, Param7,
>> Param8,
>> Param9, Param10, Param11, Param12, Param13, Param14, Param15,
>> FASTDLGT_RETTYPE>
>> MakeDelegate(Y* x, RetType (X::*func)(Param1 p1, Param2 p2, Param3 p3,
>> Param4
>> p4, Param5 p5, Param6 p6, Param7 p7, Param8 p8, Param9 p9, Param10 p10,
>> Param11
>> p11, Param12 p12, Param13 p13, Param14 p14, Param15 p15) const) {
>> return FastDelegate15<Param1, Param2, Param3, Param4, Param5,
>> Param6,
>> Param7, Param8, Param9, Param10, Param11, Param12, Param13, Param14,
>> Param15,
>> FASTDLGT_RETTYPE>(x, func);
>> }
>> >>> are to be replaced by
>> >>> New source code, using suggested new macros
>>
>> #define EMPTY
>> #define DECL_MAKE_DELAGATE_SINGLE(n, CONST_TYPE)\
>> template <class X, class Y, DECL_CLASS_PARAM_LIST(n), class RetType>\
>> FastDelegate##n<DECL_PARAM_TEMPLATE_LIST(n), FASTDLGT_RETTYPE>
>> MakeDelegate(Y*
>> x, RetType (X::*func)(DECL_PARAM_LIST(n)) CONST_TYPE) { \
>> return FastDelegate##n<DECL_PARAM_TEMPLATE_LIST(n),
>> FASTDLGT_RETTYPE>(x,
>> func);\
>> }
>>
>> #define DECL_MAKE_DELAGATE(n) DECL_MAKE_DELAGATE_SINGLE(n, EMPTY)
>> DECL_MAKE_DELAGATE_SINGLE(n, const)
>> REPEAT_MACRO(MAX_PARAMS, DECL_MAKE_DELAGATE)
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "amop group" group.
>> To post to this group, send email to amop-...@googlegroups.com.
>> To unsubscribe from this group, send email to amop-
>> group+un...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/amop-group?hl=en.
>
>
>--
>You received this message because you are subscribed to the Google Groups
"amop group" group.
>To post to this group, send email to amop-...@googlegroups.com.
>To unsubscribe from this group, send email to amop-
group+un...@googlegroups.com.
>For more options, visit this group at http://groups.google.com/group/amop-
group?hl=en.
>
>