歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux編程 >> Linux編程

關於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

Copyright © Linux教程網 All Rights Reserved