关于C++函数包装问题

在C++中,我们经常遇到在某个特定的时刻,需要将函数进行包装调用,尤其是当我们需要将不同签名的函数放到同一个集合时,由于函数签名不一致导致我们不能直接将各式各样的函数指针放到诸如list这样的集合中,因此对函数进行包装就显得格外重要.现在来介绍一下我写的一个函数包装器.

还是需要用到模板技巧,写这种类库没有模板将是不可能实现的任务,大家顺便学习一下模板编写也挺好的.

还是不废话,先上实例,后贴完整类库,这个类库需要用到前面写的萃取和序列化库,当然了,序列化库是可以被替换的,只要满足接口一致.

这里多废话一句:本人致力于写跨平台的C++开源代码,我之前以及现在以及将来上传的所有代码均以hpp文件发布,这种文件的好处就是可以直接包含到源码里使用,而不需要产生各种烦人的dll或者lib.这个库附带了一个scope_guard文件,也是一个很好的安全调用设计,有兴趣的看看

用例代码(看注释基本就可以了):

#include
#include “../../traits/traits.hpp”
#include “../../serialization/archive.hpp”
#include “../../call_helper/call.hpp”

using namespace std;

int show(char i, int j)
{
    return 1;
}

struct Stu
{
    int show(char i, int j)
    {
        return 1;
    }
};

int main()
{
    // C函数包装
    callhelper::call_helper helper1(show);
    helper1.call(‘a’, 6);

    // 类成员函数包装
    Stu stu;
    callhelper::call_helper helper2(&stu,&Stu::show);
    helper2.call(‘a’, 6);

 

    // 另一种形式的C函数包装
    callhelper::icall* helper3 = new callhelper::ccall(show);
    //helper3->call(serialization::default_string_iarchive(str));

    // 另一种形式的类成员函数包装
    callhelper::icall* helper4 = new callhelper::ccall(&stu, &Stu::show);
    //helper4->call(serialization::default_string_iarchive(str));
   
    // 放到同一集合中
    std::list _list;
    _list.push_back(helper3);
    _list.push_back(helper4);

    std::string str;
    serialization::default_string_oarchive oarc(str);
    oarc & ‘a’ & 6;

    // 调用
    for (std::list::iterator iter = _list.begin(); iter != _list.end(); ++iter)
    {
        (*iter)->call(serialization::default_string_iarchive(str));
    }

    delete helper3;
    delete helper4;

    return 0;
}

完整的类库截图

// call.hpp

#ifndef CALL_INCLUDE
#define CALL_INCLUDE

#include “call_helper.hpp”
#include “param_get_set.hpp”
#include “marshal.hpp”
#include “scope_guard.hpp”
#include “call_wrapper.hpp”
#include “call_container.hpp”

#endif

// call_container.hpp

#ifndef CALL_CONTAINER_INCLUDE
#define CALL_CONTAINER_INCLUDE

#include “call_helper_config.hpp”
#include “call_helper.hpp”

#include #include
#include

NAMESPACE_CALL_HELPER_BEGIN

struct basic_call_container
{
    virtual void call(IArchive& iarc)=0;
    virtual ~basic_call_container(){}
};

////////////////////////////////////////////////////////////

template
struct _call_container : public basic_call_container{};

///////////////////////////////////////////////////////////

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call();
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg16 arg16;
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg17 arg17;
        typedef typename traits::mfunction_traits::arg16 arg16;
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg18 arg18;
        typedef typename traits::mfunction_traits::arg17 arg17;
        typedef typename traits::mfunction_traits::arg16 arg16;
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg19 arg19;
        typedef typename traits::mfunction_traits::arg18 arg18;
        typedef typename traits::mfunction_traits::arg17 arg17;
        typedef typename traits::mfunction_traits::arg16 arg16;
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get19(iarc);
        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg20 arg20;
        typedef typename traits::mfunction_traits::arg19 arg19;
        typedef typename traits::mfunction_traits::arg18 arg18;
        typedef typename traits::mfunction_traits::arg17 arg17;
        typedef typename traits::mfunction_traits::arg16 arg16;
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get20(iarc);
        param_get get19(iarc);
        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get20,get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

//////////////////////////////////////////////////////////////

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call();
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg1 arg1;

        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg16 arg16;
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg17 arg17;
        typedef typename traits::function_traits::arg16 arg16;
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg18 arg18;
        typedef typename traits::function_traits::arg17 arg17;
        typedef typename traits::function_traits::arg16 arg16;
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg19 arg19;
        typedef typename traits::function_traits::arg18 arg18;
        typedef typename traits::function_traits::arg17 arg17;
        typedef typename traits::function_traits::arg16 arg16;
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get19(iarc);
        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

template
struct _call_container : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg20 arg20;
        typedef typename traits::function_traits::arg19 arg19;
        typedef typename traits::function_traits::arg18 arg18;
        typedef typename traits::function_traits::arg17 arg17;
        typedef typename traits::function_traits::arg16 arg16;
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get20(iarc);
        param_get get19(iarc);
        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper& c_helper = (call_helper&)(*iter);
            c_helper.call(get20,get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
        }
    }
    containertype _container;
};

//////////////////////////////////////////////////////////////

template
struct call_container : public _call_container<_containertype,classtype,funtype,traits::mfunction_traits::arity>
{
    typedef _containertype containertype;
};

template
struct call_container<_containertype,funtype,void> : public _call_container<_containertype,void,funtype,traits::function_traits::arity>
{
    typedef _containertype containertype;
};

#define call_list(funtype,classtype) callhelper::call_container>,funtype,classtype>

#define call_set(funtype,classtype) callhelper::call_container>,funtype,classtype>

#define call_vector(funtype,classtype) callhelper::call_container>,funtype,classtype>

NAMESPACE_CALL_HELPER_END
#endif

————————————-

// call_helper.hpp
#ifndef CALL_HELPER_INCLUDE
#define CALL_HELPER_INCLUDE

#include “call_helper_config.hpp”
#include “traits/traits.hpp”
#include “param_get_set.hpp”

NAMESPACE_CALL_HELPER_BEGIN

template
struct _call_result: public value_storage<_result_type>
{
    static bool has_value(){ return true; }
    enum{Has_Value=true};
};

template<>
struct _call_result
{
    static bool has_value(){ return false; }
    int get_value()const{return -1;}
    operator int()const{return -1;}
    enum{Has_Value=false};
};

// 存储对象及方法指针
template
struct _call_helper_obj : public _call_result::result_type>
{
    _class_type* _obj;
    _funtype    _fun;
    _call_helper_obj(_class_type* obj,_funtype fun):_obj(obj),_fun(fun){}

    unsigned int funAddr()const{ return traits::pointer_integer_traits(_fun);}
    void        funAddr(unsigned int addr){ _fun = traits::pointer_integer_traits::MFunctionP_Type>(addr);}
    unsigned int objAddr()const{ return reinterpret_cast(_obj);}
    void        objAddr(unsigned int addr){ _obj = (_class_type*)(addr);}
    bool operator ==(const _call_helper_obj<_class_type,_funtype>& c)const { return (funAddr()==c.funAddr() && objAddr()==c.objAddr());}
    bool operator !=(const _call_helper_obj<_class_type,_funtype>& c)const { return !(c==*this);}
    bool operator < (const _call_helper_obj<_class_type,_funtype>& c)const {
        // 先比较函数地址,然后才是对象地址
        if (funAddr() < c.funAddr())
            return true;
        else if (funAddr() > c.funAddr())
            return false;
        else
        {
            return (objAddr() < c.objAddr());
        }
    }
};

template
struct _call_helper_obj_p : public _call_result::result_type>
{
    _funtype    _fun;
    _call_helper_obj_p(_funtype fun):_fun(fun){}

    unsigned int funAddr()const{ return traits::pointer_integer_traits(_fun); }
    void        funAddr(unsigned int addr){ _fun = traits::pointer_integer_traits::FunctionP_Type>(addr);}
    unsigned int objAddr()const{ return 0;}
    void        objAddr(unsigned int addr){}
    bool operator ==(const _call_helper_obj_p<_funtype>& c)const { return (funAddr()==c.funAddr() && objAddr()==c.objAddr()); }
    bool operator !=(const _call_helper_obj_p<_funtype>& c)const { return !(c==*this);}
    bool operator < (const _call_helper_obj_p<_funtype>& c)const {
        // 先比较函数地址,然后才是对象地址
        if (funAddr() < c.funAddr())
            return true;
        else if (funAddr() > c.funAddr())
            return false;
        else
        {
            return (objAddr() < c.objAddr());
        }
    }
};

////////////////////////////////////////////////////////////////////////////////////////////////
// 成员方法调用
template struct _invoke;

template
struct _invoke : public _call_helper_obj<_class_type,R(_class_type::*)()>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)()> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)()):_MyBase(obj,fun){}

    R call()
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)());
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1
    >
struct _invoke : public _call_helper_obj<_class_type,R(_class_type::*)(P1)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1)):_MyBase(obj,fun){}

    R call(P1 p1)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2
    >
struct _invoke : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2)>
{
    typedef  _call_helper_obj<_class_type,R(_class_type::*)(P1,P2)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3
    >
struct _invoke : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4
    >
struct _invoke : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4)>
{
    typedef  _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5
    >
struct _invoke : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16)
    {
        _MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16));
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17)
    {
        _MyBase::set_value( (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17) );
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18)
    {
        _MyBase::set_value( (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18) );
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18,
    typename P19
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19)
    {
        _MyBase::set_value( (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19) );
        return _MyBase::get_value();
    }
};

template
    <
    typename _class_type,typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18,
    typename P19,
    typename P20
    >
struct _invoke
    : public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)>
{
    typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)> _MyBase;

    _invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)):_MyBase(obj,fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19,P20 p20)
    {
        _MyBase::set_value( (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20) );
        return _MyBase::get_value();
    }
};

///

template struct _invoke_p;

template
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)()):_MyBase(fun){}

    R call()
    {
        _MyBase::set_value((R)(_MyBase::_fun)());
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1
    >
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1)):_MyBase(fun){}

    R call(P1 p1)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2
    >
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2)):_MyBase(fun){}

    R call(P1 p1,P2 p2)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3
    >
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4
    >
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5
    >
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef  _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18,
    typename P19
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19) );
        return _MyBase::get_value();
    }
};

template
    <
    typename R,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18,
    typename P19,
    typename P20
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)):_MyBase(fun){}

    R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19,P20 p20)
    {
        _MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20) );
        return _MyBase::get_value();
    }
};

///////

template<>
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)()):_MyBase(fun){}

    void call()
    {
        return (_MyBase::_fun)();
    }
};

template
    <
    typename P1
    >
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1)):_MyBase(fun){}

    void call(P1 p1)
    {
        return (_MyBase::_fun)(p1);
    }
};

template
    <
    typename P1,
    typename P2
    >
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2)):_MyBase(fun){}

    void call(P1 p1,P2 p2)
    {
        return (_MyBase::_fun)(p1,p2);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3
    >
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3)
    {
        return (_MyBase::_fun)(p1,p2,p3);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4
    >
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5
    >
struct _invoke_p : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef  _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18,
    typename P19
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19);
    }
};

template
    <
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18,
    typename P19,
    typename P20
    >
struct _invoke_p
    : public _call_helper_obj_p
{
    typedef _call_helper_obj_p _MyBase;

    _invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)):_MyBase(fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19,P20 p20)
    {
        return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20);
    }
};

/////

template
struct _invoke : public _call_helper_obj<_class_type,void(_class_type::*)()>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)()> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)()):_MyBase(obj,fun){}

    void call()
    {
        return (_MyBase::_obj->*_MyBase::_fun)();
    }
};

template
    <
    typename _class_type,
    typename P1
    >
struct _invoke : public _call_helper_obj<_class_type,void(_class_type::*)(P1)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1)):_MyBase(obj,fun){}

    void call(P1 p1)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2)>
{
    typedef  _call_helper_obj<_class_type,void(_class_type::*)(P1,P2)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4)>
{
    typedef  _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18,
    typename P19
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19);
    }
};

template
    <
    typename _class_type,
    typename P1,
    typename P2,
    typename P3,
    typename P4,
    typename P5,
    typename P6,
    typename P7,
    typename P8,
    typename P9,
    typename P10,
    typename P11,
    typename P12,
    typename P13,
    typename P14,
    typename P15,
    typename P16,
    typename P17,
    typename P18,
    typename P19,
    typename P20
    >
struct _invoke
    : public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)>
{
    typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)> _MyBase;

    _invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)):_MyBase(obj,fun){}

    void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19,P20 p20)
    {
        return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20);
    }
};

////////////////////////////////////////////////////////////////////////////////////////////////
// 方法调用包装

 

// class
template
struct call_helper : public _invoke::MFunctionP_Type,_class_type>
{
    typedef _invoke::MFunctionP_Type,_class_type> _MyBase;
   
    call_helper(
        _class_type* obj,
        typename traits::mfunction_traits<_funtype>::MFunctionP_Type fun
        )
        :_MyBase(obj,fun){}

    virtual ~call_helper(){}
};

// func
template
struct call_helper<_funtype,void> : public _invoke_p::FunctionP_Type>
{
    typedef _invoke_p::FunctionP_Type> _MyBase;
   
    call_helper(typename traits::function_traits<_funtype>::FunctionP_Type fun)
        : _MyBase(fun){}

    virtual ~call_helper(){}
};

NAMESPACE_CALL_HELPER_END
#endif

————————

//call_helper_config.hpp
#ifndef CALL_HELPER_CONFIG_INCLUDE
#define CALL_HELPER_CONFIG_INCLUDE

#define NAMESPACE_CALL_HELPER_BEGIN namespace callhelper{
#define NAMESPACE_CALL_HELPER_END  }

#include “serialization/archive.hpp”

NAMESPACE_CALL_HELPER_BEGIN

typedef serialization::default_string_iarchive IArchive;
typedef serialization::default_string_oarchive OArchive;

NAMESPACE_CALL_HELPER_END
#endif

————————————–

//call_wrapper.hpp
#ifndef CALL_WRAPPER_INCLUDE
#define CALL_WRAPPER_INCLUDE

#include “call_helper_config.hpp”
#include “param_get_set.hpp”
#include “call_helper.hpp”

NAMESPACE_CALL_HELPER_BEGIN

struct icall
{
    virtual void        call(IArchive& iarc)=0;
    virtual unsigned int funAddr()const=0;
    virtual void        funAddr(unsigned int addr)=0;
    virtual unsigned int objAddr()const=0;
    virtual void        objAddr(unsigned int addr)=0;
    virtual bool        equal(const icall* c){ return (funAddr()==c->funAddr() && objAddr()==c->objAddr());}
    virtual bool        result()const=0;
    virtual void        result(std::string& out)const=0;
    virtual ~icall(){}
};

template
struct _calladdr : public icall
{
    call_helper _call_helper;
    enum{Has_Value=call_helper::Has_Value};

    _calladdr(funtype fun)
        :_call_helper(fun){}

    virtual unsigned int funAddr()const{ return _call_helper.funAddr();}
    virtual void        funAddr(unsigned int addr){ _call_helper.funAddr(addr);}

    virtual unsigned int objAddr()const{ return _call_helper.objAddr();}
    virtual void        objAddr(unsigned int addr){_call_helper.objAddr(addr);}

    virtual bool        result()const{ return _call_helper.has_value();}
    virtual void        result(std::string& out)const
    {
        OArchive oarc(out);
        oarc << _call_helper.get_value();
    }
};

template
struct _calladdr2 : public icall
{
    call_helper _call_helper;
    enum{Has_Value=call_helper::Has_Value};

    _calladdr2(classtype* obj,funtype fun)
        :_call_helper(obj,fun){}

    virtual unsigned int funAddr()const{ return _call_helper.funAddr();}
    virtual void        funAddr(unsigned int addr){ _call_helper.funAddr(addr);}

    virtual unsigned int objAddr()const{ return _call_helper.objAddr();}
    virtual void        objAddr(unsigned int addr){ _call_helper.objAddr(addr);}

    virtual bool        result()const{ return _call_helper.has_value();}
    virtual void        result(std::string& out)const
    {
        OArchive oarc(out);
        oarc << _call_helper.get_value();
    }
};

////////////////// 继承

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc){}
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        _calladdr::_call_helper.call();
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg1 arg1;

        param_get get1(iarc);

        _calladdr::_call_helper.call(get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg16 arg16;
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg17 arg17;
        typedef typename traits::function_traits::arg16 arg16;
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg18 arg18;
        typedef typename traits::function_traits::arg17 arg17;
        typedef typename traits::function_traits::arg16 arg16;
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg19 arg19;
        typedef typename traits::function_traits::arg18 arg18;
        typedef typename traits::function_traits::arg17 arg17;
        typedef typename traits::function_traits::arg16 arg16;
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get19(iarc);
        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall : public _calladdr
{
    _ccall(funtype fun):_calladdr(fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits::arg20 arg20;
        typedef typename traits::function_traits::arg19 arg19;
        typedef typename traits::function_traits::arg18 arg18;
        typedef typename traits::function_traits::arg17 arg17;
        typedef typename traits::function_traits::arg16 arg16;
        typedef typename traits::function_traits::arg15 arg15;
        typedef typename traits::function_traits::arg14 arg14;
        typedef typename traits::function_traits::arg13 arg13;
        typedef typename traits::function_traits::arg12 arg12;
        typedef typename traits::function_traits::arg11 arg11;
        typedef typename traits::function_traits::arg10 arg10;
        typedef typename traits::function_traits::arg9 arg9;
        typedef typename traits::function_traits::arg8 arg8;
        typedef typename traits::function_traits::arg7 arg7;
        typedef typename traits::function_traits::arg6 arg6;
        typedef typename traits::function_traits::arg5 arg5;
        typedef typename traits::function_traits::arg4 arg4;
        typedef typename traits::function_traits::arg3 arg3;
        typedef typename traits::function_traits::arg2 arg2;
        typedef typename traits::function_traits::arg1 arg1;

        param_get get20(iarc);
        param_get get19(iarc);
        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr::_call_helper.call(get20,get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

////////////////////////

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc){}
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        _calladdr2::_call_helper.call();
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get1(iarc);

        _calladdr2::_call_helper.call(get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg16 arg16;
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg17 arg17;
        typedef typename traits::mfunction_traits::arg16 arg16;
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg18 arg18;
        typedef typename traits::mfunction_traits::arg17 arg17;
        typedef typename traits::mfunction_traits::arg16 arg16;
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg19 arg19;
        typedef typename traits::mfunction_traits::arg18 arg18;
        typedef typename traits::mfunction_traits::arg17 arg17;
        typedef typename traits::mfunction_traits::arg16 arg16;
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get19(iarc);
        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

template
struct _ccall2 : public _calladdr2
{
    _ccall2(classtype* obj,funtype fun):_calladdr2(obj,fun){}
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits::arg20 arg20;
        typedef typename traits::mfunction_traits::arg19 arg19;
        typedef typename traits::mfunction_traits::arg18 arg18;
        typedef typename traits::mfunction_traits::arg17 arg17;
        typedef typename traits::mfunction_traits::arg16 arg16;
        typedef typename traits::mfunction_traits::arg15 arg15;
        typedef typename traits::mfunction_traits::arg14 arg14;
        typedef typename traits::mfunction_traits::arg13 arg13;
        typedef typename traits::mfunction_traits::arg12 arg12;
        typedef typename traits::mfunction_traits::arg11 arg11;
        typedef typename traits::mfunction_traits::arg10 arg10;
        typedef typename traits::mfunction_traits::arg9 arg9;
        typedef typename traits::mfunction_traits::arg8 arg8;
        typedef typename traits::mfunction_traits::arg7 arg7;
        typedef typename traits::mfunction_traits::arg6 arg6;
        typedef typename traits::mfunction_traits::arg5 arg5;
        typedef typename traits::mfunction_traits::arg4 arg4;
        typedef typename traits::mfunction_traits::arg3 arg3;
        typedef typename traits::mfunction_traits::arg2 arg2;
        typedef typename traits::mfunction_traits::arg1 arg1;

        param_get get20(iarc);
        param_get get19(iarc);
        param_get get18(iarc);
        param_get get17(iarc);
        param_get get16(iarc);
        param_get get15(iarc);
        param_get get14(iarc);
        param_get get13(iarc);
        param_get get12(iarc);
        param_get get11(iarc);
        param_get get10(iarc);
        param_get get9(iarc);
        param_get get8(iarc);
        param_get get7(iarc);
        param_get get6(iarc);
        param_get get5(iarc);
        param_get get4(iarc);
        param_get get3(iarc);
        param_get get2(iarc);
        param_get get1(iarc);

        _calladdr2::_call_helper.call(get20,get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
    }
};

///////////////////////////////// 包装

template
struct ccall : public _ccall2::arity>
{
    typedef _ccall2::arity> _MyBase;

    ccall(classtype* obj,typename traits::mfunction_traits::MFunctionP_Type fun)
        :_MyBase(obj,fun){}
};

template
struct ccall
    : public _ccall::FunctionP_Type,traits::function_traits::arity>
{
    typedef _ccall::FunctionP_Type,traits::function_traits::arity> _MyBase;

    ccall(typename traits::function_traits::FunctionP_Type fun)
        :_MyBase(fun){}
};

 

NAMESPACE_CALL_HELPER_END
#endif

————————

//marshal.hpp
#ifndef MARSHAL_INCLUDE
#define MARSHAL_INCLUDE

#include “call_helper_config.hpp”

NAMESPACE_CALL_HELPER_BEGIN

// 近程序列化输出

template
struct OutParameter
{
    OutParameter(const T& t,Arch& arch)
    {
        arch << t;
    }
};

template
struct OutParameter
{
    OutParameter(const T& t,Arch& arch)
    {
        arch << t;
    }
};

template
struct OutParameter
{
    OutParameter(T& t,Arch& arch)
    {
        unsigned int addr = traits::pointer_integer_traits(&t);
        arch << addr;
    }
};

template
struct OutParameter
{
    OutParameter(const T& t,Arch& arch)
    {
        unsigned int addr = traits::pointer_integer_traits(&t);
        arch << addr;
    }
};

template
struct OutParameter
{
    OutParameter(const T* t,Arch& arch)
    {
        arch << t;
    }
};

template
struct OutParameter
{
    OutParameter(const T* t,Arch& arch)
    {
        arch << t;
    }
};

template
struct OutParameter
{
    OutParameter(T** t,Arch& arch)
    {
        unsigned int addr = traits::pointer_integer_traits(t);
        arch << addr;
    }
};

template
struct OutParameter
{
    OutParameter(const T** t,Arch& arch)
    {
        unsigned int addr = traits::pointer_integer_traits(t);
        arch << addr;
    }
};

template
struct OutParameter
{
    OutParameter(T*& t,Arch& arch)
    {
        unsigned int addr = traits::pointer_integer_traits(&t);
        arch << addr;
    }
};

template
struct OutParameter
{
    OutParameter(const T*& t,Arch& arch)
    {
        unsigned int addr = traits::pointer_integer_traits(&t);
        arch << addr;
    }
};

// 近程序列化输入

template
struct InParameter
{
    typename traits::type_traits::value_type _t;
    InParameter(Arch& arch)
    {
        arch >> _t;
    }
    operator T&(){ return _t;}
};

template
struct InParameter
{
    typename traits::type_traits::value_type _t;
    InParameter(Arch& arch)
    {
        arch >> _t;
    }
    operator const T&(){ return _t;}
};

template
struct InParameter
{
    typename traits::type_traits::pointer_type _t;
    InParameter(Arch& arch)
    {
        unsigned int addr =0;
        arch >> addr;
        _t = traits::pointer_integer_traits::pointer_type>(addr);
    }
    operator T&(){ return *_t;}
};

template
struct InParameter
{
    typename traits::type_traits::pointer_type _t;
    InParameter(Arch& arch)
    {
        unsigned int addr =0;
        arch >> addr;
        _t = traits::pointer_integer_traits::pointer_type>(addr);
    }
    operator const T&(){ return *_t;}
};

template
struct InParameter
{
    typename traits::type_traits::pointer_type _t;
    InParameter(Arch& arch)
    {
        unsigned int addr =0;
        arch >> addr;
        _t = traits::pointer_integer_traits::pointer_type>(addr);
    }
    operator T*(){ return _t;}
};

template
struct InParameter
{
    typename traits::type_traits::pointer_type _t;
    InParameter(Arch& arch)
    {
        unsigned int addr =0;
        arch >> addr;
        _t = traits::pointer_integer_traits::pointer_type>(addr);
    }
    operator const T*(){ return _t;}
};

template
struct InParameter
{
    typename traits::type_traits::pointer_pointer_type _t;
    InParameter(Arch& arch)
    {
        unsigned int addr =0;
        arch >> addr;
        _t = traits::pointer_integer_traits::pointer_pointer_type>(addr);
    }
    operator T**(){ return _t;}
};

template
struct InParameter
{
    typename traits::type_traits::pointer_pointer_type _t;
    InParameter(Arch& arch)
    {
        unsigned int addr =0;
        arch >> addr;
        _t = traits::pointer_integer_traits::pointer_pointer_type>(addr);
    }
    operator const T**(){ return _t;}
};

template
struct InParameter
{
    typename traits::type_traits::pointer_pointer_type _t;
    InParameter(Arch& arch)
    {
        unsigned int addr =0;
        arch >> addr;
        _t = traits::pointer_integer_traits::pointer_pointer_type>(addr);
    }
    operator T*&(){ return *_t;}
};

template
struct InParameter
{
    typename traits::type_traits::pointer_pointer_type _t;
    InParameter(Arch& arch)
    {
        unsigned int addr =0;
        arch >> addr;
        _t = traits::pointer_integer_traits::pointer_pointer_type>(addr);
    }
    operator const T*&(){ return *_t;}
};

// 远程序列化输出,只支持值类型,引用类型,const值类型,const 引用类型

template
struct OutParameterR
{
    OutParameterR(const T& t,Arch& arch)
    {
        arch << t;
    }
};

template
struct OutParameterR
{
    OutParameterR(T& t,Arch& arch)
    {
        arch << t;
    }
};

template
struct OutParameterR
{
    OutParameterR(const T& t,Arch& arch)
    {
        arch << t;
    }
};

// 远程序列化输入
template
struct InParameterR
{
    typename traits::type_traits::value_type _t;
    InParameterR(Arch& arch)
    {
        arch >> _t;
    }
    operator T&(){ return _t;}
};

template
struct InParameterR
{
    typename traits::type_traits::value_type _t;
    InParameterR(Arch& arch)
    {
        arch >> _t;
    }
    operator const T&(){ return _t;}
};

template
struct InParameterR
{
    typename traits::type_traits::value_type _t;
    InParameterR(Arch& arch)
    {
        arch >> _t;
    }
    operator T&(){ return _t;}
};

template
struct InParameterR
{
    typename traits::type_traits::value_type _t;
    InParameterR(Arch& arch)
    {
        arch >> _t;
    }
    operator const T&(){ return _t;}
};

NAMESPACE_CALL_HELPER_END
#endif

————————

//param_get_set.hpp
#ifndef PARAM_GET_SET_INCLUDE
#define PARAM_GET_SET_INCLUDE

#include “call_helper_config.hpp”
#include “marshal.hpp”
#include “traits/traits.hpp”

NAMESPACE_CALL_HELPER_BEGIN

template
struct param_set : public OutParameter
{
    param_set(T t,Arch& arch):OutParameter(t,arch){}
};

template
struct param_get : public InParameter
{
    param_get(Arch& arch):InParameter(arch){}
};

// 值存储
template
struct value_storage
{
    typename traits::type_traits::value_type _value;
    value_storage(T v):_value(v){}
    value_storage(){}
    operator T()const{ return get_value(); }
    void set_value(T v){ _value = v;}
    T    get_value()const{ return (_value); }
};

template
struct value_storage
{
    typename traits::type_traits::pointer_type _value;
    value_storage(T& v){ set_value(v);}
    value_storage(){}
    operator T&(){ return get_value(); }
    void set_value(T& v)
    {
        _value = const_cast::pointer_type>(&v);
    }
    T& get_value()const{ return const_cast(*_value); }
};

template
struct value_storage
{
    typename traits::type_traits::pointer_type _value;
    value_storage(T* v){ set_value(v); }
    value_storage(){}
    operator T*()const{ return get_value(); }
    void set_value(T* v)
    {
        _value = const_cast::pointer_type>(v);
    }
    T* get_value()const{ return const_cast(_value); }
};

template
struct value_storage
{
    typename traits::type_traits::pointer_pointer_type _value;
    value_storage(T** v){ set_value(v); }
    value_storage(){}
    operator T**()const{ return get_value(); }
    void set_value(T** v)
    {
        _value = const_cast::pointer_pointer_type>(v);
    }
    T** get_value()const{ return (_value); }
};

template
struct value_storage
{
    typename traits::type_traits::pointer_pointer_type _value;
    value_storage(const T** v){ set_value(v); }
    value_storage(){}
    operator const T**()const{ return get_value(); }
    void set_value(const T** v)
    {
        _value = const_cast::pointer_pointer_type>(v);
    }
    const T** get_value()const{ return const_cast(_value); }
};

template
struct value_storage
{
    typename traits::type_traits::pointer_pointer_type _value;
    value_storage(T*& v){ set_value(v); }
    value_storage(){}
    operator T*&()const{ return get_value(); }
    void set_value(T*& v)
    {
        _value = const_cast::pointer_pointer_type>(&v);
    }
    T*& get_value()const{ return (*_value); }
};

template
struct value_storage
{
    typename traits::type_traits::pointer_pointer_type _value;
    value_storage(const T*& v){ set_value(v); }
    value_storage(){}
    operator const T*&()const{ return get_value(); }
    void set_value(const T*& v)
    {
        _value = const_cast::pointer_pointer_type>(&v);
    }
    const T*& get_value()const{ return const_cast(*_value); }
};

NAMESPACE_CALL_HELPER_END
#endif

—————————

//scope_guard.hpp
#ifndef SCOPE_GUARD_INCLUDE
#define SCOPE_GUARD_INCLUDE

#include “call_helper_config.hpp”

NAMESPACE_CALL_HELPER_BEGIN

class ScopeGuardImplBase
{
    ScopeGuardImplBase& operator =(const ScopeGuardImplBase&);
protected:
    ~ScopeGuardImplBase()
    {
    }
    ScopeGuardImplBase(const ScopeGuardImplBase& other) throw()
        : dismissed_(other.dismissed_)
    {
        other.Dismiss();
    }
    template
    static void SafeExecute(J& j) throw()
    {
        if (!j.dismissed_)
            try
        {
            j.Execute();
        }
        catch(…)
        {
        }
    }

    mutable bool dismissed_;
public:
    ScopeGuardImplBase() throw() : dismissed_(false)
    {
    }
    void Dismiss() const throw()
    {
        dismissed_ = true;
    }
};

typedef const ScopeGuardImplBase& ScopeGuard;

//*************************************************************************

template
class ScopeGuardImpl0 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl0 MakeGuard(F fun)
    {
        return ScopeGuardImpl0(fun);
    }
    ~ScopeGuardImpl0() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_();
    }
protected:
    ScopeGuardImpl0(F fun) : fun_(fun)
    {
    }
    F fun_;
};

template
inline ScopeGuardImpl0 MakeGuard(F fun)
{
    return ScopeGuardImpl0::MakeGuard(fun);
}

template
class ScopeGuardImpl1 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl1 MakeGuard(F fun, P1 p1)
    {
        return ScopeGuardImpl1(fun, p1);
    }
    ~ScopeGuardImpl1() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_);
    }
protected:
    ScopeGuardImpl1(F fun, P1 p1) : fun_(fun), p1_(p1)
    {
    }
    F fun_;
    const P1 p1_;
};

template
inline ScopeGuardImpl1 MakeGuard(F fun, P1 p1)
{
    return ScopeGuardImpl1::MakeGuard(fun, p1);
}

template
class ScopeGuardImpl2: public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl2 MakeGuard(F fun, P1 p1, P2 p2)
    {
        return ScopeGuardImpl2(fun, p1, p2);
    }
    ~ScopeGuardImpl2() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_, p2_);
    }
protected:
    ScopeGuardImpl2(F fun, P1 p1, P2 p2) : fun_(fun), p1_(p1), p2_(p2)
    {
    }
    F fun_;
    const P1 p1_;
    const P2 p2_;
};

template
inline ScopeGuardImpl2 MakeGuard(F fun, P1 p1, P2 p2)
{
    return ScopeGuardImpl2::MakeGuard(fun, p1, p2);
}

template
class ScopeGuardImpl3 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl3 MakeGuard(F fun, P1 p1, P2 p2, P3 p3)
    {
        return ScopeGuardImpl3(fun, p1, p2, p3);
    }
    ~ScopeGuardImpl3() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_, p2_, p3_);
    }
protected:
    ScopeGuardImpl3(F fun, P1 p1, P2 p2, P3 p3) : fun_(fun), p1_(p1), p2_(p2), p3_(p3)
    {
    }
    F fun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
};

template
inline ScopeGuardImpl3 MakeGuard(F fun, P1 p1, P2 p2, P3 p3)
{
    return ScopeGuardImpl3::MakeGuard(fun, p1, p2, p3);
}

template
class ScopeGuardImpl4 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl4 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4)
    {
        return ScopeGuardImpl4(fun, p1, p2, p3,p4);
    }
    ~ScopeGuardImpl4() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_, p2_, p3_,p4_);
    }
protected:
    ScopeGuardImpl4(F fun, P1 p1, P2 p2, P3 p3,P4 p4) : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4)
    {
    }
    F fun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
};

template
inline ScopeGuardImpl4 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4)
{
    return ScopeGuardImpl4::MakeGuard(fun, p1, p2, p3,p4);
}

template
class ScopeGuardImpl5 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl5 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5)
    {
        return ScopeGuardImpl5(fun, p1, p2, p3,p4,p5);
    }
    ~ScopeGuardImpl5() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_, p2_, p3_,p4_,p5_);
    }
protected:
    ScopeGuardImpl5(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5) : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4),p5_(p5)
    {
    }
    F fun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
};

template
inline ScopeGuardImpl5 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5)
{
    return ScopeGuardImpl5::MakeGuard(fun, p1, p2, p3,p4,p5);
}

template
class ScopeGuardImpl6 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl6 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6)
    {
        return ScopeGuardImpl6(fun, p1, p2, p3,p4,p5,p6);
    }
    ~ScopeGuardImpl6() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_, p2_, p3_,p4_,p5_,p6_);
    }
protected:
    ScopeGuardImpl6(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6) : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4),p5_(p5),p6_(p6)
    {
    }
    F fun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
};

template
inline ScopeGuardImpl6 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6)
{
    return ScopeGuardImpl6::MakeGuard(fun, p1, p2, p3,p4,p5,p6);
}

template           typename P7>
class ScopeGuardImpl7 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl7 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7    p7)
    {
        return ScopeGuardImpl7(fun, p1, p2, p3,p4,p5,p6,p7);
    }
    ~ScopeGuardImpl7() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_, p2_, p3_,p4_,p5_,p6_,p7_);
    }
protected:
    ScopeGuardImpl7(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7) : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4),p5_(p5),p6_(p6),p7_(p7)
    {
    }
    F fun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
};

template           typename P7>
inline ScopeGuardImpl7 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
    return ScopeGuardImpl7::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7);
}

template           typename P7,typename P8>
class ScopeGuardImpl8 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl8 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
    {
        return ScopeGuardImpl8(fun, p1, p2, p3,p4,p5,p6,p7,p8);
    }
    ~ScopeGuardImpl8() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_, p2_, p3_,p4_,p5_,p6_,p7_,p8_);
    }
protected:
    ScopeGuardImpl8(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8) : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4),p5_(p5),p6_(p6),p7_(p7),p8_(p8)
    {
    }
    F fun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
    const P8 p8_;
};

template           typename P7,typename P8>
    inline ScopeGuardImpl8 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
{
    return ScopeGuardImpl8::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7,p8);
}

template           typename P7,typename P8, typename P9>
class ScopeGuardImpl9 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl9 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
    {
        return ScopeGuardImpl9(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9);
    }
    ~ScopeGuardImpl9() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_, p2_, p3_,p4_,p5_,p6_,p7_,p8_,p9_);
    }
protected:
    ScopeGuardImpl9(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9) : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4),p5_(p5),p6_(p6),p7_(p7),p8_(p8),p9_(p9)
    {
    }
    F fun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
    const P8 p8_;
    const P9 p9_;
};

template           typename P7,typename P8, typename P9>
    inline ScopeGuardImpl9 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
{
    return ScopeGuardImpl9::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9);
}

template           typename P7,typename P8, typename P9,    typename P10>
class ScopeGuardImpl10 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl10 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10)
    {
        return ScopeGuardImpl10(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9,p10);
    }
    ~ScopeGuardImpl10() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_, p2_, p3_,p4_,p5_,p6_,p7_,p8_,p9_,p10_);
    }
protected:
    ScopeGuardImpl10(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10) : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4),p5_(p5),p6_(p6),p7_(p7),p8_(p8),p9_(p9),p10_(p10)
    {
    }
    F fun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
    const P8 p8_;
    const P9 p9_;
    const P10 p10_;
};

template           typename P7,typename P8, typename P9,    typename P10>
    inline ScopeGuardImpl10 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10)
{
    return ScopeGuardImpl10::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9,p10);
}

template           typename P7,typename P8, typename P9,    typename P10,typename P11>
class ScopeGuardImpl11 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl11 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10,P11 p11)
    {
        return ScopeGuardImpl11(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9,p10,p11);
    }
    ~ScopeGuardImpl11() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_, p2_, p3_,p4_,p5_,p6_,p7_,p8_,p9_,p10_,p11_);
    }
protected:
    ScopeGuardImpl11(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11)
        : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4),p5_(p5),p6_(p6),p7_(p7),p8_(p8),p9_(p9),p10_(p10),p11_(p11)
    {
    }
    F fun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
    const P8 p8_;
    const P9 p9_;
    const P10 p10_;
    const P11 p11_;
};

template           typename P7,typename P8, typename P9,    typename P10,typename P11>
    inline ScopeGuardImpl11 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11)
{
    return ScopeGuardImpl11::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9,p10,p11);
}

template           typename P7,typename P8, typename P9,    typename P10,typename P11,typename P12>
class ScopeGuardImpl12 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl12 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10,P11 p11,P12 p12)
    {
        return ScopeGuardImpl12(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9,p10,p11,p12);
    }
    ~ScopeGuardImpl12() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_(p1_, p2_, p3_,p4_,p5_,p6_,p7_,p8_,p9_,p10_,p11_,p12_);
    }
protected:
    ScopeGuardImpl12(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12)
        : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4),p5_(p5),p6_(p6),p7_(p7),p8_(p8),p9_(p9),p10_(p10),p11_(p11),p12_(p12)
    {
    }
    F fun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
    const P8 p8_;
    const P9 p9_;
    const P10 p10_;
    const P11 p11_;
    const P12 p12_;
};

template           typename P7,typename P8, typename P9,    typename P10,typename P11,typename P12>
    inline ScopeGuardImpl12 MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12)
{
    return ScopeGuardImpl12::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9,p10,p11,p12);
}

//************************************************************

template
class ObjScopeGuardImpl0 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl0 MakeObjGuard(Obj& obj, MemFun memFun)
    {
        return ObjScopeGuardImpl0(obj, memFun);
    }
    ~ObjScopeGuardImpl0() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)();
    }
protected:
    ObjScopeGuardImpl0(Obj& obj, MemFun memFun)
        : obj_(obj), memFun_(memFun) {}
    Obj& obj_;
    MemFun memFun_;
};

template
inline ObjScopeGuardImpl0 MakeObjGuard(Obj& obj, MemFun memFun)
{
    return ObjScopeGuardImpl0::MakeObjGuard(obj, memFun);
}

template
class ObjScopeGuardImpl1 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl1 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
    {
        return ObjScopeGuardImpl1(obj, memFun, p1);
    }
    ~ObjScopeGuardImpl1() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_);
    }
protected:
    ObjScopeGuardImpl1(Obj& obj, MemFun memFun, P1 p1)
        : obj_(obj), memFun_(memFun), p1_(p1) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
};

template
inline ObjScopeGuardImpl1 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
{
    return ObjScopeGuardImpl1::MakeObjGuard(obj, memFun, p1);
}

template
class ObjScopeGuardImpl2 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl2 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
    {
        return ObjScopeGuardImpl2(obj, memFun, p1, p2);
    }
    ~ObjScopeGuardImpl2() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_, p2_);
    }
protected:
    ObjScopeGuardImpl2(Obj& obj, MemFun memFun, P1 p1, P2 p2)
        : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
    const P2 p2_;
};

template
inline ObjScopeGuardImpl2 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
{
    return ObjScopeGuardImpl2::MakeObjGuard(obj, memFun, p1, p2);
}

template
class ObjScopeGuardImpl3 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl3 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3)
    {
        return ObjScopeGuardImpl3(obj, memFun, p1, p2, p3);
    }
    ~ObjScopeGuardImpl3() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_, p2_,p3_);
    }
protected:
    ObjScopeGuardImpl3(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3)
        : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
};

template
inline ObjScopeGuardImpl3 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3)
{
    return ObjScopeGuardImpl3::MakeObjGuard(obj, memFun, p1, p2, p3);
}

template
class ObjScopeGuardImpl4 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl4 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4)
    {
        return ObjScopeGuardImpl4(obj, memFun, p1, p2, p3, p4);
    }
    ~ObjScopeGuardImpl4() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_, p2_,p3_,p4_);
    }
protected:
    ObjScopeGuardImpl4(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4)
        : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
};

template
inline ObjScopeGuardImpl4 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4)
{
    return ObjScopeGuardImpl4::MakeObjGuard(obj, memFun, p1, p2, p3, p4);
}

template
class ObjScopeGuardImpl5 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl5 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
    {
        return ObjScopeGuardImpl5(obj, memFun, p1, p2, p3, p4, p5);
    }
    ~ObjScopeGuardImpl5() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_, p2_,p3_,p4_,p5_);
    }
protected:
    ObjScopeGuardImpl5(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
        : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
};

template
inline ObjScopeGuardImpl5 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
{
    return ObjScopeGuardImpl5::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5);
}

template
class ObjScopeGuardImpl6 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl6 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
    {
        return ObjScopeGuardImpl6(obj, memFun, p1, p2, p3, p4, p5, p6);
    }
    ~ObjScopeGuardImpl6() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_, p2_,p3_,p4_,p5_,p6_);
    }
protected:
    ObjScopeGuardImpl6(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
        : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5), p6_(p6) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
};

template
inline ObjScopeGuardImpl6 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
{
    return ObjScopeGuardImpl6::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6);
}

template           typename P7>
class ObjScopeGuardImpl7 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl7 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
    {
        return ObjScopeGuardImpl7(obj, memFun, p1, p2, p3, p4, p5, p6, p7);
    }
    ~ObjScopeGuardImpl7() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_, p2_,p3_,p4_,p5_,p6_,p7_);
    }
protected:
    ObjScopeGuardImpl7(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7)
        : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5), p6_(p6), p7_(p7) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
};

template           typename P7>
inline ObjScopeGuardImpl7 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7  p7)
{
    return ObjScopeGuardImpl7::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7);
}

template         typename P7,typename P8>
class ObjScopeGuardImpl8 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl8 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
    {
        return ObjScopeGuardImpl8(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8);
    }
    ~ObjScopeGuardImpl8() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_, p2_,p3_,p4_,p5_,p6_,p7_,p8_);
    }
protected:
    ObjScopeGuardImpl8(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
        : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5), p6_(p6), p7_(p7), p8_(p8) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
    const P8 p8_;
};

template         typename P7,typename P8>
    inline ObjScopeGuardImpl8 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
{
    return ObjScopeGuardImpl8::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8);
}

template     typename P7,typename P8, typename P9>
class ObjScopeGuardImpl9 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl9 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
    {
        return ObjScopeGuardImpl9(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9);
    }
    ~ObjScopeGuardImpl9() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_, p2_,p3_,p4_,p5_,p6_,p7_,p8_,p9_);
    }
protected:
    ObjScopeGuardImpl9(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
        : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5), p6_(p6), p7_(p7), p8_(p8), p9_(p9) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
    const P8 p8_;
    const P9 p9_;
};

template     typename P7,typename P8, typename P9>
    inline ObjScopeGuardImpl9 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
{
    return ObjScopeGuardImpl9::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9);
}

template     typename P7,typename P8, typename P9, typename P10>
class ObjScopeGuardImpl10 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl10 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10)
    {
        return ObjScopeGuardImpl10(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
    }
    ~ObjScopeGuardImpl10() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_, p2_,p3_,p4_,p5_,p6_,p7_,p8_,p9_,p10_);
    }
protected:
    ObjScopeGuardImpl10(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10)
        : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5), p6_(p6), p7_(p7), p8_(p8), p9_(p9), p10_(p10) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
    const P8 p8_;
    const P9 p9_;
    const P10 p10_;
};

template     typename P7,typename P8, typename P9, typename P10>
    inline ObjScopeGuardImpl10 MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10)
{
    return ObjScopeGuardImpl10::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
}

template     typename P7,typename P8, typename P9, typename P10, typename P11>
class ObjScopeGuardImpl11 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl11
        MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11)
    {
        return ObjScopeGuardImpl11(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
    }
    ~ObjScopeGuardImpl11() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_, p2_,p3_,p4_,p5_,p6_,p7_,p8_,p9_,p10_,p11_);
    }
protected:
    ObjScopeGuardImpl11(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11)
        : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5), p6_(p6), p7_(p7), p8_(p8), p9_(p9), p10_(p10), p11_(p11) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
    const P8 p8_;
    const P9 p9_;
    const P10 p10_;
    const P11 p11_;
};

template     typename P7,typename P8, typename P9, typename P10, typename P11>
    inline ObjScopeGuardImpl11
    MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11)
{
    return ObjScopeGuardImpl11::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
}

template     typename P7,typename P8, typename P9, typename P10, typename P11, typename P12>
class ObjScopeGuardImpl12 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl12
        MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12)
    {
        return ObjScopeGuardImpl12(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
    }
    ~ObjScopeGuardImpl12() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        (obj_.*memFun_)(p1_, p2_,p3_,p4_,p5_,p6_,p7_,p8_,p9_,p10_,p11_,p12_);
    }
protected:
    ObjScopeGuardImpl12(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12)
        : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5), p6_(p6), p7_(p7), p8_(p8), p9_(p9), p10_(p10), p11_(p11), p12_(p12) {}
    Obj& obj_;
    MemFun memFun_;
    const P1 p1_;
    const P2 p2_;
    const P3 p3_;
    const P4 p4_;
    const P5 p5_;
    const P6 p6_;
    const P7 p7_;
    const P8 p8_;
    const P9 p9_;
    const P10 p10_;
    const P11 p11_;
    const P12 p12_;
};

template     typename P7,typename P8, typename P9, typename P10, typename P11, typename P12>
    inline ObjScopeGuardImpl12
    MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12)
{
    return ObjScopeGuardImpl12::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
}

NAMESPACE_CALL_HELPER_END
#endif