谈一下关于C++函数包装问题

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

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

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

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

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

#include<iostream>
#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<int(char, int)> helper1(show);
    helper1.call(‘a‘, 6);

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

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

    // 另一种形式的类成员函数包装
    callhelper::icall* helper4 = new callhelper::ccall<int(Stu::*)(char, int), Stu>(&stu, &Stu::show);
    //helper4->call(serialization::default_string_iarchive(str));

    // 放到同一集合中
    std::list<callhelper::icall*> _list;
    _list.push_back(helper3);
    _list.push_back(helper4);

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

    // 调用
    for (std::list<callhelper::icall*>::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 <list>
#include <vector>
#include <set>

NAMESPACE_CALL_HELPER_BEGIN

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

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

template<typename containertype,typename classtype,typename funtype,int paramc>
struct _call_container : public basic_call_container{};

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

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

template<typename containertype,typename classtype,typename funtype>
struct _call_container<containertype,classtype,funtype,1> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits<funtype>::arg1 arg1;

        param_get<arg1> get1(iarc);

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

template<typename containertype,typename classtype,typename funtype>
struct _call_container<containertype,classtype,funtype,2> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits<funtype>::arg2 arg2;
        typedef typename traits::mfunction_traits<funtype>::arg1 arg1;

        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

template<typename containertype,typename classtype,typename funtype>
struct _call_container<containertype,classtype,funtype,3> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits<funtype>::arg3 arg3;
        typedef typename traits::mfunction_traits<funtype>::arg2 arg2;
        typedef typename traits::mfunction_traits<funtype>::arg1 arg1;

        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

template<typename containertype,typename classtype,typename funtype>
struct _call_container<containertype,classtype,funtype,4> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits<funtype>::arg4 arg4;
        typedef typename traits::mfunction_traits<funtype>::arg3 arg3;
        typedef typename traits::mfunction_traits<funtype>::arg2 arg2;
        typedef typename traits::mfunction_traits<funtype>::arg1 arg1;

        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

template<typename containertype,typename classtype,typename funtype>
struct _call_container<containertype,classtype,funtype,5> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits<funtype>::arg5 arg5;
        typedef typename traits::mfunction_traits<funtype>::arg4 arg4;
        typedef typename traits::mfunction_traits<funtype>::arg3 arg3;
        typedef typename traits::mfunction_traits<funtype>::arg2 arg2;
        typedef typename traits::mfunction_traits<funtype>::arg1 arg1;

        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

template<typename containertype,typename classtype,typename funtype>
struct _call_container<containertype,classtype,funtype,6> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits<funtype>::arg6 arg6;
        typedef typename traits::mfunction_traits<funtype>::arg5 arg5;
        typedef typename traits::mfunction_traits<funtype>::arg4 arg4;
        typedef typename traits::mfunction_traits<funtype>::arg3 arg3;
        typedef typename traits::mfunction_traits<funtype>::arg2 arg2;
        typedef typename traits::mfunction_traits<funtype>::arg1 arg1;

        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

template<typename containertype,typename classtype,typename funtype>
struct _call_container<containertype,classtype,funtype,7> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits<funtype>::arg7 arg7;
        typedef typename traits::mfunction_traits<funtype>::arg6 arg6;
        typedef typename traits::mfunction_traits<funtype>::arg5 arg5;
        typedef typename traits::mfunction_traits<funtype>::arg4 arg4;
        typedef typename traits::mfunction_traits<funtype>::arg3 arg3;
        typedef typename traits::mfunction_traits<funtype>::arg2 arg2;
        typedef typename traits::mfunction_traits<funtype>::arg1 arg1;

        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper<funtype,classtype>& c_helper = (call_helper<funtype,classtype>&)(*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<typename containertype,typename classtype,typename funtype>
struct _call_container<containertype,classtype,funtype,19> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits<funtype>::arg19 arg19;
        typedef typename traits::mfunction_traits<funtype>::arg18 arg18;
        typedef typename traits::mfunction_traits<funtype>::arg17 arg17;
        typedef typename traits::mfunction_traits<funtype>::arg16 arg16;
        typedef typename traits::mfunction_traits<funtype>::arg15 arg15;
        typedef typename traits::mfunction_traits<funtype>::arg14 arg14;
        typedef typename traits::mfunction_traits<funtype>::arg13 arg13;
        typedef typename traits::mfunction_traits<funtype>::arg12 arg12;
        typedef typename traits::mfunction_traits<funtype>::arg11 arg11;
        typedef typename traits::mfunction_traits<funtype>::arg10 arg10;
        typedef typename traits::mfunction_traits<funtype>::arg9 arg9;
        typedef typename traits::mfunction_traits<funtype>::arg8 arg8;
        typedef typename traits::mfunction_traits<funtype>::arg7 arg7;
        typedef typename traits::mfunction_traits<funtype>::arg6 arg6;
        typedef typename traits::mfunction_traits<funtype>::arg5 arg5;
        typedef typename traits::mfunction_traits<funtype>::arg4 arg4;
        typedef typename traits::mfunction_traits<funtype>::arg3 arg3;
        typedef typename traits::mfunction_traits<funtype>::arg2 arg2;
        typedef typename traits::mfunction_traits<funtype>::arg1 arg1;

        param_get<arg19> get19(iarc);
        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper<funtype,classtype>& c_helper = (call_helper<funtype,classtype>&)(*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<typename containertype,typename classtype,typename funtype>
struct _call_container<containertype,classtype,funtype,20> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::mfunction_traits<funtype>::arg20 arg20;
        typedef typename traits::mfunction_traits<funtype>::arg19 arg19;
        typedef typename traits::mfunction_traits<funtype>::arg18 arg18;
        typedef typename traits::mfunction_traits<funtype>::arg17 arg17;
        typedef typename traits::mfunction_traits<funtype>::arg16 arg16;
        typedef typename traits::mfunction_traits<funtype>::arg15 arg15;
        typedef typename traits::mfunction_traits<funtype>::arg14 arg14;
        typedef typename traits::mfunction_traits<funtype>::arg13 arg13;
        typedef typename traits::mfunction_traits<funtype>::arg12 arg12;
        typedef typename traits::mfunction_traits<funtype>::arg11 arg11;
        typedef typename traits::mfunction_traits<funtype>::arg10 arg10;
        typedef typename traits::mfunction_traits<funtype>::arg9 arg9;
        typedef typename traits::mfunction_traits<funtype>::arg8 arg8;
        typedef typename traits::mfunction_traits<funtype>::arg7 arg7;
        typedef typename traits::mfunction_traits<funtype>::arg6 arg6;
        typedef typename traits::mfunction_traits<funtype>::arg5 arg5;
        typedef typename traits::mfunction_traits<funtype>::arg4 arg4;
        typedef typename traits::mfunction_traits<funtype>::arg3 arg3;
        typedef typename traits::mfunction_traits<funtype>::arg2 arg2;
        typedef typename traits::mfunction_traits<funtype>::arg1 arg1;

        param_get<arg20> get20(iarc);
        param_get<arg19> get19(iarc);
        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper<funtype,classtype>& c_helper = (call_helper<funtype,classtype>&)(*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<typename containertype,typename funtype>
struct _call_container<containertype,void,funtype,0> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper<funtype,void>& c_helper = (call_helper<funtype,void>&)(*iter);
            c_helper.call();
        }
    }
    containertype _container;
};

template<typename containertype,typename funtype>
struct _call_container<containertype,void,funtype,1> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits<funtype>::arg1 arg1;

        param_get<arg1> get1(iarc);

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

template<typename containertype,typename funtype>
struct _call_container<containertype,void,funtype,2> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits<funtype>::arg2 arg2;
        typedef typename traits::function_traits<funtype>::arg1 arg1;

        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

template<typename containertype,typename funtype>
struct _call_container<containertype,void,funtype,3> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits<funtype>::arg3 arg3;
        typedef typename traits::function_traits<funtype>::arg2 arg2;
        typedef typename traits::function_traits<funtype>::arg1 arg1;

        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper<funtype,void>& c_helper = (call_helper<funtype,void>&)(*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<typename containertype,typename funtype>
struct _call_container<containertype,void,funtype,19> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits<funtype>::arg19 arg19;
        typedef typename traits::function_traits<funtype>::arg18 arg18;
        typedef typename traits::function_traits<funtype>::arg17 arg17;
        typedef typename traits::function_traits<funtype>::arg16 arg16;
        typedef typename traits::function_traits<funtype>::arg15 arg15;
        typedef typename traits::function_traits<funtype>::arg14 arg14;
        typedef typename traits::function_traits<funtype>::arg13 arg13;
        typedef typename traits::function_traits<funtype>::arg12 arg12;
        typedef typename traits::function_traits<funtype>::arg11 arg11;
        typedef typename traits::function_traits<funtype>::arg10 arg10;
        typedef typename traits::function_traits<funtype>::arg9 arg9;
        typedef typename traits::function_traits<funtype>::arg8 arg8;
        typedef typename traits::function_traits<funtype>::arg7 arg7;
        typedef typename traits::function_traits<funtype>::arg6 arg6;
        typedef typename traits::function_traits<funtype>::arg5 arg5;
        typedef typename traits::function_traits<funtype>::arg4 arg4;
        typedef typename traits::function_traits<funtype>::arg3 arg3;
        typedef typename traits::function_traits<funtype>::arg2 arg2;
        typedef typename traits::function_traits<funtype>::arg1 arg1;

        param_get<arg19> get19(iarc);
        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper<funtype,void>& c_helper = (call_helper<funtype,void>&)(*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<typename containertype,typename funtype>
struct _call_container<containertype,void,funtype,20> : public basic_call_container
{
    virtual void call(IArchive& iarc)
    {
        typedef typename traits::function_traits<funtype>::arg20 arg20;
        typedef typename traits::function_traits<funtype>::arg19 arg19;
        typedef typename traits::function_traits<funtype>::arg18 arg18;
        typedef typename traits::function_traits<funtype>::arg17 arg17;
        typedef typename traits::function_traits<funtype>::arg16 arg16;
        typedef typename traits::function_traits<funtype>::arg15 arg15;
        typedef typename traits::function_traits<funtype>::arg14 arg14;
        typedef typename traits::function_traits<funtype>::arg13 arg13;
        typedef typename traits::function_traits<funtype>::arg12 arg12;
        typedef typename traits::function_traits<funtype>::arg11 arg11;
        typedef typename traits::function_traits<funtype>::arg10 arg10;
        typedef typename traits::function_traits<funtype>::arg9 arg9;
        typedef typename traits::function_traits<funtype>::arg8 arg8;
        typedef typename traits::function_traits<funtype>::arg7 arg7;
        typedef typename traits::function_traits<funtype>::arg6 arg6;
        typedef typename traits::function_traits<funtype>::arg5 arg5;
        typedef typename traits::function_traits<funtype>::arg4 arg4;
        typedef typename traits::function_traits<funtype>::arg3 arg3;
        typedef typename traits::function_traits<funtype>::arg2 arg2;
        typedef typename traits::function_traits<funtype>::arg1 arg1;

        param_get<arg20> get20(iarc);
        param_get<arg19> get19(iarc);
        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

        for (typename containertype::iterator iter=_container.begin();
            iter!=_container.end(); ++iter)
        {
            call_helper<funtype,void>& c_helper = (call_helper<funtype,void>&)(*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<typename _containertype,typename funtype,typename classtype=void>
struct call_container : public _call_container<_containertype,classtype,funtype,traits::mfunction_traits<funtype>::arity>
{
    typedef _containertype containertype;
};

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

#define call_list(funtype,classtype) callhelper::call_container<std::list<callhelper::call_helper<funtype,classtype>>,funtype,classtype>

#define call_set(funtype,classtype) callhelper::call_container<std::set<callhelper::call_helper<funtype,classtype>>,funtype,classtype>

#define call_vector(funtype,classtype) callhelper::call_container<std::vector<callhelper::call_helper<funtype,classtype>>,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<typename _result_type>
struct _call_result: public value_storage<_result_type>
{
    static bool has_value(){ return true; }
    enum{Has_Value=true};
};

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

// 存储对象及方法指针
template<typename _class_type,typename _funtype>
struct _call_helper_obj : public _call_result<typename traits::mfunction_traits<_funtype>::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<unsigned int>(_fun);}
    void         funAddr(unsigned int addr){ _fun = traits::pointer_integer_traits<typename traits::mfunction_traits<_funtype>::MFunctionP_Type>(addr);}
    unsigned int objAddr()const{ return reinterpret_cast<unsigned int>(_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<typename _funtype>
struct _call_helper_obj_p : public _call_result<typename traits::function_traits<_funtype>::result_type>
{
    _funtype     _fun;
    _call_helper_obj_p(_funtype fun):_fun(fun){}

    unsigned int funAddr()const{ return traits::pointer_integer_traits<unsigned int>(_fun); }
    void         funAddr(unsigned int addr){ _fun = traits::pointer_integer_traits<typename traits::function_traits<_funtype>::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<typename _funtype,typename _class_type> struct _invoke;

template<typename _class_type,typename R>
struct _invoke<R(_class_type::*)(),_class_type> : 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<R(_class_type::*)(P1),_class_type> : 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<R(_class_type::*)(P1,P2),_class_type> : 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<R(_class_type::*)(P1,P2,P3),_class_type> : 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<R(_class_type::*)(P1,P2,P3,P4),_class_type> : 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<R(_class_type::*)(P1,P2,P3,P4,P5),_class_type> : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19),_class_type>
    : 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<R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20),_class_type>
    : 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<typename _funtype> struct _invoke_p;

template<typename R>
struct _invoke_p<R(*)()> : public _call_helper_obj_p<R(*)()>
{
    typedef _call_helper_obj_p<R(*)()> _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<R(*)(P1)> : public _call_helper_obj_p<R(*)(P1)>
{
    typedef _call_helper_obj_p<R(*)(P1)> _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<R(*)(P1,P2)> : public _call_helper_obj_p<R(*)(P1,P2)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2)> _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<R(*)(P1,P2,P3)> : public _call_helper_obj_p<R(*)(P1,P2,P3)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3)> _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<R(*)(P1,P2,P3,P4)> : public _call_helper_obj_p<R(*)(P1,P2,P3,P4)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4)> _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<R(*)(P1,P2,P3,P4,P5)> : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5)> _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<R(*)(P1,P2,P3,P4,P5,P6)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)>
{
    typedef  _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)> _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<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)>
    : public _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)>
{
    typedef _call_helper_obj_p<R(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)> _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<void(*)()> : public _call_helper_obj_p<void(*)()>
{
    typedef _call_helper_obj_p<void(*)()> _MyBase;

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

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

template
    <
    typename P1
    >
struct _invoke_p<void(*)(P1)> : public _call_helper_obj_p<void(*)(P1)>
{
    typedef _call_helper_obj_p<void(*)(P1)> _MyBase;

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

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

template
    <
    typename P1,
    typename P2
    >
struct _invoke_p<void(*)(P1,P2)> : public _call_helper_obj_p<void(*)(P1,P2)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2)> _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<void(*)(P1,P2,P3)> : public _call_helper_obj_p<void(*)(P1,P2,P3)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3)> _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<void(*)(P1,P2,P3,P4)> : public _call_helper_obj_p<void(*)(P1,P2,P3,P4)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4)> _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<void(*)(P1,P2,P3,P4,P5)> : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5)> _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<void(*)(P1,P2,P3,P4,P5,P6)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)>
{
    typedef  _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)> _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<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)>
    : public _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)>
{
    typedef _call_helper_obj_p<void(*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)> _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<typename _class_type>
struct _invoke<void(_class_type::*)(),_class_type> : 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<void(_class_type::*)(P1),_class_type> : 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<void(_class_type::*)(P1,P2),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19),_class_type>
    : 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<void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20),_class_type>
    : 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<typename _funtype,typename _class_type=void>
struct call_helper : public _invoke<typename traits::mfunction_traits<_funtype>::MFunctionP_Type,_class_type>
{
    typedef _invoke<typename traits::mfunction_traits<_funtype>::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<typename _funtype>
struct call_helper<_funtype,void> : public _invoke_p<typename traits::function_traits<_funtype>::FunctionP_Type>
{
    typedef _invoke_p<typename traits::function_traits<_funtype>::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<typename funtype>
struct _calladdr : public icall
{
    call_helper<funtype> _call_helper;
    enum{Has_Value=call_helper<funtype>::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<typename classtype,typename funtype>
struct _calladdr2 : public icall
{
    call_helper<funtype,classtype> _call_helper;
    enum{Has_Value=call_helper<funtype,classtype>::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<typename funtype,int num>
struct _ccall : public _calladdr<funtype>
{
    _ccall(funtype fun):_calladdr<funtype>(fun){}
    virtual void call(IArchive& iarc){}
};

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

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

        param_get<arg1> get1(iarc);

        _calladdr<funtype>::_call_helper.call(get1);
    }
};

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

        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg19> get19(iarc);
        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg20> get20(iarc);
        param_get<arg19> get19(iarc);
        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

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

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

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

        param_get<arg1> get1(iarc);

        _calladdr2<classtype,funtype>::_call_helper.call(get1);
    }
};

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

        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

        _calladdr2<classtype,funtype>::_call_helper.call(get2,get1);
    }
};

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

        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

        _calladdr2<classtype,funtype>::_call_helper.call(get3,get2,get1);
    }
};

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

        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

        _calladdr2<classtype,funtype>::_call_helper.call(get4,get3,get2,get1);
    }
};

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

        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

        _calladdr2<classtype,funtype>::_call_helper.call(get5,get4,get3,get2,get1);
    }
};

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

        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg19> get19(iarc);
        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

        param_get<arg20> get20(iarc);
        param_get<arg19> get19(iarc);
        param_get<arg18> get18(iarc);
        param_get<arg17> get17(iarc);
        param_get<arg16> get16(iarc);
        param_get<arg15> get15(iarc);
        param_get<arg14> get14(iarc);
        param_get<arg13> get13(iarc);
        param_get<arg12> get12(iarc);
        param_get<arg11> get11(iarc);
        param_get<arg10> get10(iarc);
        param_get<arg9> get9(iarc);
        param_get<arg8> get8(iarc);
        param_get<arg7> get7(iarc);
        param_get<arg6> get6(iarc);
        param_get<arg5> get5(iarc);
        param_get<arg4> get4(iarc);
        param_get<arg3> get3(iarc);
        param_get<arg2> get2(iarc);
        param_get<arg1> get1(iarc);

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

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

template<typename funtype,typename classtype=void>
struct ccall : public _ccall2<classtype,funtype,traits::mfunction_traits<funtype>::arity>
{
    typedef _ccall2<classtype,funtype,traits::mfunction_traits<funtype>::arity> _MyBase;

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

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

    ccall(typename traits::function_traits<funtype>::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<typename T,typename Arch>
struct OutParameter
{
    OutParameter(const T& t,Arch& arch)
    {
        arch << t;
    }
};

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

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

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

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

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

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

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

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

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

// 近程序列化输入

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

template<typename T,typename Arch>
struct InParameterR<const T&,Arch>
{
    typename traits::type_traits<T>::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<typename T,typename Arch=OArchive>
struct param_set : public OutParameter<T,Arch>
{
    param_set(T t,Arch& arch):OutParameter(t,arch){}
};

template<typename T,typename Arch=IArchive>
struct param_get : public InParameter<T,Arch>
{
    param_get(Arch& arch):InParameter(arch){}
};

// 值存储
template<typename T>
struct value_storage
{
    typename traits::type_traits<T>::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<typename T>
struct value_storage<T&>
{
    typename traits::type_traits<T>::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<typename traits::type_traits<T>::pointer_type>(&v);
    }
    T& get_value()const{ return const_cast<T&>(*_value); }
};

template<typename T>
struct value_storage<T*>
{
    typename traits::type_traits<T>::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<typename traits::type_traits<T>::pointer_type>(v);
    }
    T* get_value()const{ return const_cast<T*>(_value); }
};

template<typename T>
struct value_storage<T**>
{
    typename traits::type_traits<T>::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<typename traits::type_traits<T>::pointer_pointer_type>(v);
    }
    T** get_value()const{ return (_value); }
};

template<typename T>
struct value_storage<const T**>
{
    typename traits::type_traits<T>::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<typename traits::type_traits<T>::pointer_pointer_type>(v);
    }
    const T** get_value()const{ return const_cast<const T**>(_value); }
};

template<typename T>
struct value_storage<T*&>
{
    typename traits::type_traits<T>::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<typename traits::type_traits<T>::pointer_pointer_type>(&v);
    }
    T*& get_value()const{ return (*_value); }
};

template<typename T>
struct value_storage<const T*&>
{
    typename traits::type_traits<T>::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<typename traits::type_traits<T>::pointer_pointer_type>(&v);
    }
    const T*& get_value()const{ return const_cast<const T*&>(*_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 <typename J>
    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 <typename F>
class ScopeGuardImpl0 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl0<F> MakeGuard(F fun)
    {
        return ScopeGuardImpl0<F>(fun);
    }
    ~ScopeGuardImpl0() throw()
    {
        SafeExecute(*this);
    }
    void Execute()
    {
        fun_();
    }
protected:
    ScopeGuardImpl0(F fun) : fun_(fun)
    {
    }
    F fun_;
};

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

template <typename F, typename P1>
class ScopeGuardImpl1 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1)
    {
        return ScopeGuardImpl1<F, P1>(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 <typename F, typename P1>
inline ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1)
{
    return ScopeGuardImpl1<F, P1>::MakeGuard(fun, p1);
}

template <typename F, typename P1, typename P2>
class ScopeGuardImpl2: public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2)
    {
        return ScopeGuardImpl2<F, P1, P2>(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 <typename F, typename P1, typename P2>
inline ScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2)
{
    return ScopeGuardImpl2<F, P1, P2>::MakeGuard(fun, p1, p2);
}

template <typename F, typename P1, typename P2, typename P3>
class ScopeGuardImpl3 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl3<F, P1, P2, P3> MakeGuard(F fun, P1 p1, P2 p2, P3 p3)
    {
        return ScopeGuardImpl3<F, P1, P2, P3>(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 <typename F, typename P1, typename P2, typename P3>
inline ScopeGuardImpl3<F, P1, P2, P3> MakeGuard(F fun, P1 p1, P2 p2, P3 p3)
{
    return ScopeGuardImpl3<F, P1, P2, P3>::MakeGuard(fun, p1, p2, p3);
}

template <typename F, typename P1, typename P2, typename P3, typename P4>
class ScopeGuardImpl4 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl4<F, P1, P2, P3,P4> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4)
    {
        return ScopeGuardImpl4<F, P1, P2, P3,P4>(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 <typename F, typename P1, typename P2, typename P3, typename P4>
inline ScopeGuardImpl4<F, P1, P2, P3,P4> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4)
{
    return ScopeGuardImpl4<F, P1, P2, P3,P4>::MakeGuard(fun, p1, p2, p3,p4);
}

template <typename F, typename P1, typename P2, typename P3, typename P4, typename P5>
class ScopeGuardImpl5 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl5<F, P1, P2, P3,P4,P5> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5)
    {
        return ScopeGuardImpl5<F, P1, P2, P3,P4,P5>(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 <typename F, typename P1, typename P2, typename P3, typename P4, typename P5>
inline ScopeGuardImpl5<F, P1, P2, P3,P4,P5> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5)
{
    return ScopeGuardImpl5<F, P1, P2, P3,P4,P5>::MakeGuard(fun, p1, p2, p3,p4,p5);
}

template <typename F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6>
class ScopeGuardImpl6 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl6<F, P1, P2, P3,P4,P5,P6> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6)
    {
        return ScopeGuardImpl6<F, P1, P2, P3,P4,P5,P6>(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 <typename F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6>
inline ScopeGuardImpl6<F, P1, P2, P3,P4,P5,P6> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6)
{
    return ScopeGuardImpl6<F, P1, P2, P3,P4,P5,P6>::MakeGuard(fun, p1, p2, p3,p4,p5,p6);
}

template <typename F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7>
class ScopeGuardImpl7 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl7<F, P1, P2, P3,P4,P5,P6,P7> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7    p7)
    {
        return ScopeGuardImpl7<F, P1, P2, P3,P4,P5,P6,P7>(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 F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7>
inline ScopeGuardImpl7<F, P1, P2, P3,P4,P5,P6,P7> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
    return ScopeGuardImpl7<F, P1, P2, P3,P4,P5,P6,P7>::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7);
}

template <typename F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7,typename P8>
class ScopeGuardImpl8 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl8<F, P1, P2, P3,P4,P5,P6,P7,P8> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
    {
        return ScopeGuardImpl8<F, P1, P2, P3,P4,P5,P6,P7,P8>(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 F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7,typename P8>
    inline ScopeGuardImpl8<F, P1, P2, P3,P4,P5,P6,P7,P8> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
{
    return ScopeGuardImpl8<F, P1, P2, P3,P4,P5,P6,P7,P8>::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7,p8);
}

template <typename F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7,typename P8, typename P9>
class ScopeGuardImpl9 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl9<F, P1, P2, P3,P4,P5,P6,P7,P8,P9> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
    {
        return ScopeGuardImpl9<F, P1, P2, P3,P4,P5,P6,P7,P8,P9>(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 F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7,typename P8, typename P9>
    inline ScopeGuardImpl9<F, P1, P2, P3,P4,P5,P6,P7,P8,P9> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
{
    return ScopeGuardImpl9<F, P1, P2, P3,P4,P5,P6,P7,P8,P9>::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9);
}

template <typename F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7,typename P8, typename P9,    typename P10>
class ScopeGuardImpl10 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl10<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10> MakeGuard(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10)
    {
        return ScopeGuardImpl10<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10>(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 F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7,typename P8, typename P9,    typename P10>
    inline ScopeGuardImpl10<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10> 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<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10>::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9,p10);
}

template <typename F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7,typename P8, typename P9,    typename P10,typename P11>
class ScopeGuardImpl11 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl11<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10,P11> 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<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10,P11>(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 F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7,typename P8, typename P9,    typename P10,typename P11>
    inline ScopeGuardImpl11<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10,P11> 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<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10,P11>::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9,p10,p11);
}

template <typename F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7,typename P8, typename P9,    typename P10,typename P11,typename P12>
class ScopeGuardImpl12 : public ScopeGuardImplBase
{
public:
    static ScopeGuardImpl12<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10,P11,P12> 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<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10,P11,P12>(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 F, typename P1, typename P2, typename P3, typename P4, typename P5,typename P6,
          typename P7,typename P8, typename P9,    typename P10,typename P11,typename P12>
    inline ScopeGuardImpl12<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10,P11,P12> 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<F, P1, P2, P3,P4,P5,P6,P7,P8,P9,P10,P11,P12>::MakeGuard(fun, p1, p2, p3,p4,p5,p6,p7,p8,p9,p10,p11,p12);
}

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

template <class Obj, typename MemFun>
class ObjScopeGuardImpl0 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl0<Obj, MemFun> MakeObjGuard(Obj& obj, MemFun memFun)
    {
        return ObjScopeGuardImpl0<Obj, MemFun>(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 <class Obj, typename MemFun>
inline ObjScopeGuardImpl0<Obj, MemFun> MakeObjGuard(Obj& obj, MemFun memFun)
{
    return ObjScopeGuardImpl0<Obj, MemFun>::MakeObjGuard(obj, memFun);
}

template <class Obj, typename MemFun, typename P1>
class ObjScopeGuardImpl1 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
    {
        return ObjScopeGuardImpl1<Obj, MemFun, P1>(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 <class Obj, typename MemFun, typename P1>
inline ObjScopeGuardImpl1<Obj, MemFun, P1> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
{
    return ObjScopeGuardImpl1<Obj, MemFun, P1>::MakeObjGuard(obj, memFun, p1);
}

template <class Obj, typename MemFun, typename P1, typename P2>
class ObjScopeGuardImpl2 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl2<Obj, MemFun, P1, P2> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
    {
        return ObjScopeGuardImpl2<Obj, MemFun, P1, P2>(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 <class Obj, typename MemFun, typename P1, typename P2>
inline ObjScopeGuardImpl2<Obj, MemFun, P1, P2> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
{
    return ObjScopeGuardImpl2<Obj, MemFun, P1, P2>::MakeObjGuard(obj, memFun, p1, p2);
}

template <class Obj, typename MemFun, typename P1, typename P2, typename P3>
class ObjScopeGuardImpl3 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl3<Obj, MemFun, P1, P2, P3> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3)
    {
        return ObjScopeGuardImpl3<Obj, MemFun, P1, P2, P3>(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 <class Obj, typename MemFun, typename P1, typename P2, typename P3>
inline ObjScopeGuardImpl3<Obj, MemFun, P1, P2, P3> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3)
{
    return ObjScopeGuardImpl3<Obj, MemFun, P1, P2, P3>::MakeObjGuard(obj, memFun, p1, p2, p3);
}

template <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4>
class ObjScopeGuardImpl4 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl4<Obj, MemFun, P1, P2, P3, P4> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4)
    {
        return ObjScopeGuardImpl4<Obj, MemFun, P1, P2, P3, P4>(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 <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4>
inline ObjScopeGuardImpl4<Obj, MemFun, P1, P2, P3, P4> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4)
{
    return ObjScopeGuardImpl4<Obj, MemFun, P1, P2, P3, P4>::MakeObjGuard(obj, memFun, p1, p2, p3, p4);
}

template <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5>
class ObjScopeGuardImpl5 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl5<Obj, MemFun, P1, P2, P3, P4, P5> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
    {
        return ObjScopeGuardImpl5<Obj, MemFun, P1, P2, P3, P4, P5>(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 <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5>
inline ObjScopeGuardImpl5<Obj, MemFun, P1, P2, P3, P4, P5> MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
{
    return ObjScopeGuardImpl5<Obj, MemFun, P1, P2, P3, P4, P5>::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5);
}

template <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
class ObjScopeGuardImpl6 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl6<Obj, MemFun, P1, P2, P3, P4, P5, P6> 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>(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 <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
inline ObjScopeGuardImpl6<Obj, MemFun, P1, P2, P3, P4, P5, P6> 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>::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6);
}

template <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
          typename P7>
class ObjScopeGuardImpl7 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl7<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7> 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>(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 <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
          typename P7>
inline ObjScopeGuardImpl7<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7> 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>::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7);
}

template <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
         typename P7,typename P8>
class ObjScopeGuardImpl8 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl8<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7, P8> 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>(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 <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
         typename P7,typename P8>
    inline ObjScopeGuardImpl8<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7, P8> 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>::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8);
}

template <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
    typename P7,typename P8, typename P9>
class ObjScopeGuardImpl9 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl9<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7, P8, P9> 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>(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 <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
    typename P7,typename P8, typename P9>
    inline ObjScopeGuardImpl9<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7, P8, P9> 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>::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9);
}

template <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
    typename P7,typename P8, typename P9, typename P10>
class ObjScopeGuardImpl10 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl10<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> 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>(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 <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
    typename P7,typename P8, typename P9, typename P10>
    inline ObjScopeGuardImpl10<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> 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>::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
}

template <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
    typename P7,typename P8, typename P9, typename P10, typename P11>
class ObjScopeGuardImpl11 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl11<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>
        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>(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 <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
    typename P7,typename P8, typename P9, typename P10, typename P11>
    inline ObjScopeGuardImpl11<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11>
    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>::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
}

template <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
    typename P7,typename P8, typename P9, typename P10, typename P11, typename P12>
class ObjScopeGuardImpl12 : public ScopeGuardImplBase
{
public:
    static ObjScopeGuardImpl12<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>
        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>(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 <class Obj, typename MemFun, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6,
    typename P7,typename P8, typename P9, typename P10, typename P11, typename P12>
    inline ObjScopeGuardImpl12<Obj, MemFun, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12>
    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>::MakeObjGuard(obj, memFun, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
}

NAMESPACE_CALL_HELPER_END
#endif
时间: 2024-11-07 02:58:35

谈一下关于C++函数包装问题的相关文章

函数包装器

在看express的源码中,经常看到函数包装的写法,有点难理解,函数包装器的作为是对一个函数进行包装,返回另外一个函数. 在包装的过程中,对旧函数和传递的参数进行改造加工.一般模式是: // oldF 旧函数, newF 新函数,callback回调函数 options 参数 newF = function(oldF,callback, options) { return function(){ // 在调用newF是,获取newF的参数 var args = Array.prototype.s

C++函数包装器

函数包装器把函数包装起来:有以下特点 1.设计通用的函数执行接口,可以设置计数(函数执行次数)和关卡 2.函数包装器依赖于函数模板,实现通用泛型 3.函数代码可以内嵌在函数中 4.原理是函数指针实现的 以下给出C++简单的函数包装器案例 #include<iostream> #include<functional> using std::cout; using std::endl; using std::cin; using std::function; //定义好了一个函数包装器

浅谈reverse_iterator的base()函数

非原创,原文链接:http://blog.csdn.net/shuchao/article/details/3705252 调用reverse_iterator的base成员函数可以产生"对应的"iterator,但这句话有些辞不达意.举个例子,看一下这段代码,我们首先把从数字1-5放进一个vector中,然后产生一个指向3的reverse_iterator,并且通过reverse_iterator的base初始化一个iterator: vector<int> v; v.r

【C/C++学院】0825-类模板/final_override/类模板与普通类的派生类模板虚函数抽象模板类/类模板友元/位运算算法以及类声明/Rtti 实时类型检测/高级new创建/类以及函数包装器

类模板 类模板多个类型默认类型简单数组模板 #pragma once template <class T=int>//类模板可以有一个默认的值 class myArray { public: myArray(); ~myArray(); }; #include "myArray.h" template <class T=int>//每一个函数都需要加上一个默认的值 myArray<T>::myArray() //类模板成员函数在外部,需要加载类型初始

再谈json - json常用函数

json常用的函数有JSON.parse().JSON.stringify(),用于json对象和字符串之间的互相转换. 1.JSON.parse() 将 JavaScript 对象表示法 (JSON) 字符串转换为对象. JSON.parse(text [, reviver]) var jsontext = '{"firstname":"Jesper","surname":"Aaberg","phone"

浅谈Kotlin中的函数

本文首发于 vivo互联网技术 微信公众号 链接:https://mp.weixin.qq.com/s/UV23Uw_969oVhiOdo4ZKAw作者:连凌能 Kotlin,已经被Android官方宣布 kotlin first 的存在,去翻 Android 官方文档的时候,发现提供的示例代码已经变成了 Kotlin.Kotlin的务实作风,提供了很多特性帮助开发者减少冗余代码的编写,可以提高效率,也能减少异常. 本文简单谈下Kotlin中的函数,包括表达式函数体,命名参数,默认参数,顶层函数

再谈正态分布或高斯函数

它的历史不知道,如何推导出来的,没管啊,不过我很有兴趣看看啊,但没有看.高斯函数的用处太多了: 首先说明一点哦:正态分布是高斯函数的积分为1的情况: 一维情况下: 一维高斯高斯函数的公式: 而正态分布的公式表示为: 它们的区别仅仅在于前面的系数不一样:正态分布之所以需要这样的系数是为了在区间的积分为1:由此也可以看出:的在区间的积分为 . 所以呢,高斯函数的关键就是那个指数函数形式: 另外:指明了锋值的位置:控制着曲线的形状,越小,曲线越陡峭: 注意1:在正态分布中,经常用于标准的正态分布:即服

浅谈DB2在线分析处理函数

最近碰到一个测试需求,使用到了在线分析处理(OLAP),现总结记录一下,也希望能帮到有相关问题的朋友. 1. 测试环境是DB2,通过ETL(数据抽取,数据转换,数据加载)技术将数据源数据加载到目标数据仓库. 2. 需求大概意思:验证能否将包含制定商品编码的订单从数据源加载到目标数据库. 3. 目标数据来源于7个不同的应用数据库,每个应用数据库都存储商品编码组相应的订单,其中的50个商品编码相关的订单需要加载到目标仓库. 分析需求后我们得到测试的方法: 1. 在源数据库查询样本订单数据,取得其中所

浅谈一类积性函数的前缀和(转载)

本文转自:http://blog.csdn.net/skywalkert/article/details/50500009 另外,莫比乌斯反演和杜教筛其他可转到 http://blog.leanote.com/post/totziens/%E8%8E%AB%E6%AF%94%E4%B9%8C%E6%96%AF%E5%8F%8D%E6%BC%94 写在前面 笔者在刷题过程中遇到一些求积性函数前缀和的问题,其中有一类问题需要在低于线性时间复杂度的算法,今天就来浅析一下这类问题的求解方法,当作以后讲课