关于C++函数包装问题
还是需要用到模板技巧,写这种类库没有模板将是不可能实现的任务,大家顺便学习一下模板编写也挺好的.
还是不废话,先上实例,后贴完整类库,这个类库需要用到前面写的萃取和序列化库,当然了,序列化库是可以被替换的,只要满足接口一致.
这里多废话一句:本人致力于写跨平台的C++开源代码,我之前以及现在以及将来上传的所有代码均以hpp文件发布,这种文件的好处就是可以直接包含到源码里使用,而不需要产生各种烦人的dll或者lib.这个库附带了一个scope_guard文件,也是一个很好的安全调用设计,有兴趣的看看
用例代码(看注释基本就可以了):
#include
#include “../../traits/traits.hpp”
#include “../../serialization/archive.hpp”
#include “../../call_helper/call.hpp”
using namespace std;
int show(char i, int j)
{
return 1;
}
struct Stu
{
int show(char i, int j)
{
return 1;
}
};
int main()
{
// C函数包装
callhelper::call_helper
helper1.call(‘a’, 6);
// 类成员函数包装
Stu stu;
callhelper::call_helper
helper2.call(‘a’, 6);
// 另一种形式的C函数包装
callhelper::icall* helper3 = new callhelper::ccall
//helper3->call(serialization::default_string_iarchive(str));
// 另一种形式的类成员函数包装
callhelper::icall* helper4 = new callhelper::ccall
//helper4->call(serialization::default_string_iarchive(str));
// 放到同一集合中
std::list
_list.push_back(helper3);
_list.push_back(helper4);
std::string str;
serialization::default_string_oarchive oarc(str);
oarc & ‘a’ & 6;
// 调用
for (std::list
{
(*iter)->call(serialization::default_string_iarchive(str));
}
delete helper3;
delete helper4;
return 0;
}
完整的类库截图
// call.hpp
#ifndef CALL_INCLUDE
#define CALL_INCLUDE
#include “call_helper.hpp”
#include “param_get_set.hpp”
#include “marshal.hpp”
#include “scope_guard.hpp”
#include “call_wrapper.hpp”
#include “call_container.hpp”
#endif
// call_container.hpp
#ifndef CALL_CONTAINER_INCLUDE
#define CALL_CONTAINER_INCLUDE
#include “call_helper_config.hpp”
#include “call_helper.hpp”
#include #include
#include
NAMESPACE_CALL_HELPER_BEGIN
struct basic_call_container
{
virtual void call(IArchive& iarc)=0;
virtual ~basic_call_container(){}
};
////////////////////////////////////////////////////////////
template
struct _call_container : public basic_call_container{};
///////////////////////////////////////////////////////////
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call();
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get20,get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
//////////////////////////////////////////////////////////////
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call();
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
template
struct _call_container
{
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
for (typename containertype::iterator iter=_container.begin();
iter!=_container.end(); ++iter)
{
call_helper
c_helper.call(get20,get19,get18,get17,get16,get15,get14,get13,get12,get11,get10,get9,get8,get7,get6,get5,get4,get3,get2,get1);
}
}
containertype _container;
};
//////////////////////////////////////////////////////////////
template
struct call_container : public _call_container<_containertype,classtype,funtype,traits::mfunction_traits
{
typedef _containertype containertype;
};
template
struct call_container<_containertype,funtype,void> : public _call_container<_containertype,void,funtype,traits::function_traits
{
typedef _containertype containertype;
};
#define call_list(funtype,classtype) callhelper::call_container
#define call_set(funtype,classtype) callhelper::call_container
#define call_vector(funtype,classtype) callhelper::call_container
NAMESPACE_CALL_HELPER_END
#endif
————————————-
// call_helper.hpp
#ifndef CALL_HELPER_INCLUDE
#define CALL_HELPER_INCLUDE
#include “call_helper_config.hpp”
#include “traits/traits.hpp”
#include “param_get_set.hpp”
NAMESPACE_CALL_HELPER_BEGIN
template
struct _call_result: public value_storage<_result_type>
{
static bool has_value(){ return true; }
enum{Has_Value=true};
};
template<>
struct _call_result
{
static bool has_value(){ return false; }
int get_value()const{return -1;}
operator int()const{return -1;}
enum{Has_Value=false};
};
// 存储对象及方法指针
template
struct _call_helper_obj : public _call_result
{
_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
void funAddr(unsigned int addr){ _fun = traits::pointer_integer_traits
unsigned int objAddr()const{ return reinterpret_cast
void objAddr(unsigned int addr){ _obj = (_class_type*)(addr);}
bool operator ==(const _call_helper_obj<_class_type,_funtype>& c)const { return (funAddr()==c.funAddr() && objAddr()==c.objAddr());}
bool operator !=(const _call_helper_obj<_class_type,_funtype>& c)const { return !(c==*this);}
bool operator < (const _call_helper_obj<_class_type,_funtype>& c)const {
// 先比较函数地址,然后才是对象地址
if (funAddr() < c.funAddr())
return true;
else if (funAddr() > c.funAddr())
return false;
else
{
return (objAddr() < c.objAddr());
}
}
};
template
struct _call_helper_obj_p : public _call_result
{
_funtype _fun;
_call_helper_obj_p(_funtype fun):_fun(fun){}
unsigned int funAddr()const{ return traits::pointer_integer_traits
void funAddr(unsigned int addr){ _fun = traits::pointer_integer_traits
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
template
struct _invoke
{
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
{
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
{
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
{
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
{
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
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16)
{
_MyBase::set_value((_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16));
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17)
{
_MyBase::set_value( (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17) );
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18)
{
_MyBase::set_value( (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18) );
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18,
typename P19
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19)
{
_MyBase::set_value( (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19) );
return _MyBase::get_value();
}
};
template
<
typename _class_type,typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18,
typename P19,
typename P20
>
struct _invoke
: public _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)>
{
typedef _call_helper_obj<_class_type,R(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)> _MyBase;
_invoke(_class_type* obj,R(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)):_MyBase(obj,fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19,P20 p20)
{
_MyBase::set_value( (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20) );
return _MyBase::get_value();
}
};
///
template
template
struct _invoke_p
{
typedef _call_helper_obj_p
_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
{
typedef _call_helper_obj_p
_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
{
typedef _call_helper_obj_p
_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
{
typedef _call_helper_obj_p
_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
{
typedef _call_helper_obj_p
_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
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18,
typename P19
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(R(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)):_MyBase(fun){}
R call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19)
{
_MyBase::set_value( (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19) );
return _MyBase::get_value();
}
};
template
<
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18,
typename P19,
typename P20
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_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
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)()):_MyBase(fun){}
void call()
{
return (_MyBase::_fun)();
}
};
template
<
typename P1
>
struct _invoke_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1)):_MyBase(fun){}
void call(P1 p1)
{
return (_MyBase::_fun)(p1);
}
};
template
<
typename P1,
typename P2
>
struct _invoke_p
{
typedef _call_helper_obj_p
_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
{
typedef _call_helper_obj_p
_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
{
typedef _call_helper_obj_p
_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
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18,
typename P19
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19);
}
};
template
<
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18,
typename P19,
typename P20
>
struct _invoke_p
: public _call_helper_obj_p
{
typedef _call_helper_obj_p
_invoke_p(void(*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)):_MyBase(fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19,P20 p20)
{
return (_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20);
}
};
/////
template
struct _invoke
{
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
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1)):_MyBase(obj,fun){}
void call(P1 p1)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1);
}
};
template
<
typename _class_type,
typename P1,
typename P2
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18,
typename P19
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19);
}
};
template
<
typename _class_type,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename P7,
typename P8,
typename P9,
typename P10,
typename P11,
typename P12,
typename P13,
typename P14,
typename P15,
typename P16,
typename P17,
typename P18,
typename P19,
typename P20
>
struct _invoke
: public _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)>
{
typedef _call_helper_obj<_class_type,void(_class_type::*)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)> _MyBase;
_invoke(_class_type* obj,void(_class_type::*fun)(P1,P2,P3,P4,P5,P6,P7,P8,P9,P10,P11,P12,P13,P14,P15,P16,P17,P18,P19,P20)):_MyBase(obj,fun){}
void call(P1 p1,P2 p2,P3 p3,P4 p4,P5 p5,P6 p6,P7 p7,P8 p8,P9 p9,P10 p10,P11 p11,P12 p12,P13 p13,P14 p14,P15 p15,P16 p16,P17 p17,P18 p18,P19 p19,P20 p20)
{
return (_MyBase::_obj->*_MyBase::_fun)(p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20);
}
};
////////////////////////////////////////////////////////////////////////////////////////////////
// 方法调用包装
// class
template
struct call_helper : public _invoke
{
typedef _invoke
call_helper(
_class_type* obj,
typename traits::mfunction_traits<_funtype>::MFunctionP_Type fun
)
:_MyBase(obj,fun){}
virtual ~call_helper(){}
};
// func
template
struct call_helper<_funtype,void> : public _invoke_p
{
typedef _invoke_p
call_helper(typename traits::function_traits<_funtype>::FunctionP_Type fun)
: _MyBase(fun){}
virtual ~call_helper(){}
};
NAMESPACE_CALL_HELPER_END
#endif
————————
//call_helper_config.hpp
#ifndef CALL_HELPER_CONFIG_INCLUDE
#define CALL_HELPER_CONFIG_INCLUDE
#define NAMESPACE_CALL_HELPER_BEGIN namespace callhelper{
#define NAMESPACE_CALL_HELPER_END }
#include “serialization/archive.hpp”
NAMESPACE_CALL_HELPER_BEGIN
typedef serialization::default_string_iarchive IArchive;
typedef serialization::default_string_oarchive OArchive;
NAMESPACE_CALL_HELPER_END
#endif
————————————–
//call_wrapper.hpp
#ifndef CALL_WRAPPER_INCLUDE
#define CALL_WRAPPER_INCLUDE
#include “call_helper_config.hpp”
#include “param_get_set.hpp”
#include “call_helper.hpp”
NAMESPACE_CALL_HELPER_BEGIN
struct icall
{
virtual void call(IArchive& iarc)=0;
virtual unsigned int funAddr()const=0;
virtual void funAddr(unsigned int addr)=0;
virtual unsigned int objAddr()const=0;
virtual void objAddr(unsigned int addr)=0;
virtual bool equal(const icall* c){ return (funAddr()==c->funAddr() && objAddr()==c->objAddr());}
virtual bool result()const=0;
virtual void result(std::string& out)const=0;
virtual ~icall(){}
};
template
struct _calladdr : public icall
{
call_helper
enum{Has_Value=call_helper
_calladdr(funtype fun)
:_call_helper(fun){}
virtual unsigned int funAddr()const{ return _call_helper.funAddr();}
virtual void funAddr(unsigned int addr){ _call_helper.funAddr(addr);}
virtual unsigned int objAddr()const{ return _call_helper.objAddr();}
virtual void objAddr(unsigned int addr){_call_helper.objAddr(addr);}
virtual bool result()const{ return _call_helper.has_value();}
virtual void result(std::string& out)const
{
OArchive oarc(out);
oarc << _call_helper.get_value();
}
};
template
struct _calladdr2 : public icall
{
call_helper
enum{Has_Value=call_helper
_calladdr2(classtype* obj,funtype fun)
:_call_helper(obj,fun){}
virtual unsigned int funAddr()const{ return _call_helper.funAddr();}
virtual void funAddr(unsigned int addr){ _call_helper.funAddr(addr);}
virtual unsigned int objAddr()const{ return _call_helper.objAddr();}
virtual void objAddr(unsigned int addr){ _call_helper.objAddr(addr);}
virtual bool result()const{ return _call_helper.has_value();}
virtual void result(std::string& out)const
{
OArchive oarc(out);
oarc << _call_helper.get_value();
}
};
////////////////// 继承
template
struct _ccall : public _calladdr
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc){}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
template
struct _ccall
{
_ccall(funtype fun):_calladdr
virtual void call(IArchive& iarc)
{
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
typedef typename traits::function_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr
}
};
////////////////////////
template
struct _ccall2 : public _calladdr2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc){}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
template
struct _ccall2
{
_ccall2(classtype* obj,funtype fun):_calladdr2
virtual void call(IArchive& iarc)
{
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
typedef typename traits::mfunction_traits
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
param_get
_calladdr2
}
};
///////////////////////////////// 包装
template
struct ccall : public _ccall2
{
typedef _ccall2
ccall(classtype* obj,typename traits::mfunction_traits
:_MyBase(obj,fun){}
};
template
struct ccall
: public _ccall
{
typedef _ccall
ccall(typename traits::function_traits
:_MyBase(fun){}
};
NAMESPACE_CALL_HELPER_END
#endif
————————
//marshal.hpp
#ifndef MARSHAL_INCLUDE
#define MARSHAL_INCLUDE
#include “call_helper_config.hpp”
NAMESPACE_CALL_HELPER_BEGIN
// 近程序列化输出
template
struct OutParameter
{
OutParameter(const T& t,Arch& arch)
{
arch << t;
}
};
template
struct OutParameter
{
OutParameter(const T& t,Arch& arch)
{
arch << t;
}
};
template
struct OutParameter
{
OutParameter(T& t,Arch& arch)
{
unsigned int addr = traits::pointer_integer_traits
arch << addr;
}
};
template
struct OutParameter
{
OutParameter(const T& t,Arch& arch)
{
unsigned int addr = traits::pointer_integer_traits
arch << addr;
}
};
template
struct OutParameter
{
OutParameter(const T* t,Arch& arch)
{
arch << t;
}
};
template
struct OutParameter
{
OutParameter(const T* t,Arch& arch)
{
arch << t;
}
};
template
struct OutParameter
{
OutParameter(T** t,Arch& arch)
{
unsigned int addr = traits::pointer_integer_traits
arch << addr;
}
};
template
struct OutParameter
{
OutParameter(const T** t,Arch& arch)
{
unsigned int addr = traits::pointer_integer_traits
arch << addr;
}
};
template
struct OutParameter
{
OutParameter(T*& t,Arch& arch)
{
unsigned int addr = traits::pointer_integer_traits
arch << addr;
}
};
template
struct OutParameter
{
OutParameter(const T*& t,Arch& arch)
{
unsigned int addr = traits::pointer_integer_traits
arch << addr;
}
};
// 近程序列化输入
template
struct InParameter
{
typename traits::type_traits
InParameter(Arch& arch)
{
arch >> _t;
}
operator T&(){ return _t;}
};
template
struct InParameter
{
typename traits::type_traits
InParameter(Arch& arch)
{
arch >> _t;
}
operator const T&(){ return _t;}
};
template
struct InParameter
{
typename traits::type_traits
InParameter(Arch& arch)
{
unsigned int addr =0;
arch >> addr;
_t = traits::pointer_integer_traits
}
operator T&(){ return *_t;}
};
template
struct InParameter
{
typename traits::type_traits
InParameter(Arch& arch)
{
unsigned int addr =0;
arch >> addr;
_t = traits::pointer_integer_traits
}
operator const T&(){ return *_t;}
};
template
struct InParameter
{
typename traits::type_traits
InParameter(Arch& arch)
{
unsigned int addr =0;
arch >> addr;
_t = traits::pointer_integer_traits
}
operator T*(){ return _t;}
};
template
struct InParameter
{
typename traits::type_traits
InParameter(Arch& arch)
{
unsigned int addr =0;
arch >> addr;
_t = traits::pointer_integer_traits
}
operator const T*(){ return _t;}
};
template
struct InParameter
{
typename traits::type_traits
InParameter(Arch& arch)
{
unsigned int addr =0;
arch >> addr;
_t = traits::pointer_integer_traits
}
operator T**(){ return _t;}
};
template
struct InParameter
{
typename traits::type_traits
InParameter(Arch& arch)
{
unsigned int addr =0;
arch >> addr;
_t = traits::pointer_integer_traits
}
operator const T**(){ return _t;}
};
template
struct InParameter
{
typename traits::type_traits
InParameter(Arch& arch)
{
unsigned int addr =0;
arch >> addr;
_t = traits::pointer_integer_traits
}
operator T*&(){ return *_t;}
};
template
struct InParameter
{
typename traits::type_traits
InParameter(Arch& arch)
{
unsigned int addr =0;
arch >> addr;
_t = traits::pointer_integer_traits
}
operator const T*&(){ return *_t;}
};
// 远程序列化输出,只支持值类型,引用类型,const值类型,const 引用类型
template
struct OutParameterR
{
OutParameterR(const T& t,Arch& arch)
{
arch << t;
}
};
template
struct OutParameterR
{
OutParameterR(T& t,Arch& arch)
{
arch << t;
}
};
template
struct OutParameterR
{
OutParameterR(const T& t,Arch& arch)
{
arch << t;
}
};
// 远程序列化输入
template
struct InParameterR
{
typename traits::type_traits
InParameterR(Arch& arch)
{
arch >> _t;
}
operator T&(){ return _t;}
};
template
struct InParameterR
{
typename traits::type_traits
InParameterR(Arch& arch)
{
arch >> _t;
}
operator const T&(){ return _t;}
};
template
struct InParameterR
{
typename traits::type_traits
InParameterR(Arch& arch)
{
arch >> _t;
}
operator T&(){ return _t;}
};
template
struct InParameterR
{
typename traits::type_traits
InParameterR(Arch& arch)
{
arch >> _t;
}
operator const T&(){ return _t;}
};
NAMESPACE_CALL_HELPER_END
#endif
————————
//param_get_set.hpp
#ifndef PARAM_GET_SET_INCLUDE
#define PARAM_GET_SET_INCLUDE
#include “call_helper_config.hpp”
#include “marshal.hpp”
#include “traits/traits.hpp”
NAMESPACE_CALL_HELPER_BEGIN
template
struct param_set : public OutParameter
{
param_set(T t,Arch& arch):OutParameter(t,arch){}
};
template
struct param_get : public InParameter
{
param_get(Arch& arch):InParameter(arch){}
};
// 值存储
template
struct value_storage
{
typename traits::type_traits
value_storage(T v):_value(v){}
value_storage(){}
operator T()const{ return get_value(); }
void set_value(T v){ _value = v;}
T get_value()const{ return (_value); }
};
template
struct value_storage
{
typename traits::type_traits
value_storage(T& v){ set_value(v);}
value_storage(){}
operator T&(){ return get_value(); }
void set_value(T& v)
{
_value = const_cast
}
T& get_value()const{ return const_cast
};
template
struct value_storage
{
typename traits::type_traits
value_storage(T* v){ set_value(v); }
value_storage(){}
operator T*()const{ return get_value(); }
void set_value(T* v)
{
_value = const_cast
}
T* get_value()const{ return const_cast
};
template
struct value_storage
{
typename traits::type_traits
value_storage(T** v){ set_value(v); }
value_storage(){}
operator T**()const{ return get_value(); }
void set_value(T** v)
{
_value = const_cast
}
T** get_value()const{ return (_value); }
};
template
struct value_storage
{
typename traits::type_traits
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
}
const T** get_value()const{ return const_cast
};
template
struct value_storage
{
typename traits::type_traits
value_storage(T*& v){ set_value(v); }
value_storage(){}
operator T*&()const{ return get_value(); }
void set_value(T*& v)
{
_value = const_cast
}
T*& get_value()const{ return (*_value); }
};
template
struct value_storage
{
typename traits::type_traits
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
}
const T*& get_value()const{ return const_cast
};
NAMESPACE_CALL_HELPER_END
#endif
—————————
//scope_guard.hpp
#ifndef SCOPE_GUARD_INCLUDE
#define SCOPE_GUARD_INCLUDE
#include “call_helper_config.hpp”
NAMESPACE_CALL_HELPER_BEGIN
class ScopeGuardImplBase
{
ScopeGuardImplBase& operator =(const ScopeGuardImplBase&);
protected:
~ScopeGuardImplBase()
{
}
ScopeGuardImplBase(const ScopeGuardImplBase& other) throw()
: dismissed_(other.dismissed_)
{
other.Dismiss();
}
template
static void SafeExecute(J& j) throw()
{
if (!j.dismissed_)
try
{
j.Execute();
}
catch(…)
{
}
}
mutable bool dismissed_;
public:
ScopeGuardImplBase() throw() : dismissed_(false)
{
}
void Dismiss() const throw()
{
dismissed_ = true;
}
};
typedef const ScopeGuardImplBase& ScopeGuard;
//*************************************************************************
template
class ScopeGuardImpl0 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl0
{
return ScopeGuardImpl0
}
~ScopeGuardImpl0() throw()
{
SafeExecute(*this);
}
void Execute()
{
fun_();
}
protected:
ScopeGuardImpl0(F fun) : fun_(fun)
{
}
F fun_;
};
template
inline ScopeGuardImpl0
{
return ScopeGuardImpl0
}
template
class ScopeGuardImpl1 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl1
{
return ScopeGuardImpl1
}
~ScopeGuardImpl1() throw()
{
SafeExecute(*this);
}
void Execute()
{
fun_(p1_);
}
protected:
ScopeGuardImpl1(F fun, P1 p1) : fun_(fun), p1_(p1)
{
}
F fun_;
const P1 p1_;
};
template
inline ScopeGuardImpl1
{
return ScopeGuardImpl1
}
template
class ScopeGuardImpl2: public ScopeGuardImplBase
{
public:
static ScopeGuardImpl2
{
return ScopeGuardImpl2
}
~ScopeGuardImpl2() throw()
{
SafeExecute(*this);
}
void Execute()
{
fun_(p1_, p2_);
}
protected:
ScopeGuardImpl2(F fun, P1 p1, P2 p2) : fun_(fun), p1_(p1), p2_(p2)
{
}
F fun_;
const P1 p1_;
const P2 p2_;
};
template
inline ScopeGuardImpl2
{
return ScopeGuardImpl2
}
template
class ScopeGuardImpl3 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl3
{
return ScopeGuardImpl3
}
~ScopeGuardImpl3() throw()
{
SafeExecute(*this);
}
void Execute()
{
fun_(p1_, p2_, p3_);
}
protected:
ScopeGuardImpl3(F fun, P1 p1, P2 p2, P3 p3) : fun_(fun), p1_(p1), p2_(p2), p3_(p3)
{
}
F fun_;
const P1 p1_;
const P2 p2_;
const P3 p3_;
};
template
inline ScopeGuardImpl3
{
return ScopeGuardImpl3
}
template
class ScopeGuardImpl4 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl4
{
return ScopeGuardImpl4
}
~ScopeGuardImpl4() throw()
{
SafeExecute(*this);
}
void Execute()
{
fun_(p1_, p2_, p3_,p4_);
}
protected:
ScopeGuardImpl4(F fun, P1 p1, P2 p2, P3 p3,P4 p4) : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4)
{
}
F fun_;
const P1 p1_;
const P2 p2_;
const P3 p3_;
const P4 p4_;
};
template
inline ScopeGuardImpl4
{
return ScopeGuardImpl4
}
template
class ScopeGuardImpl5 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl5
{
return ScopeGuardImpl5
}
~ScopeGuardImpl5() throw()
{
SafeExecute(*this);
}
void Execute()
{
fun_(p1_, p2_, p3_,p4_,p5_);
}
protected:
ScopeGuardImpl5(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5) : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4),p5_(p5)
{
}
F fun_;
const P1 p1_;
const P2 p2_;
const P3 p3_;
const P4 p4_;
const P5 p5_;
};
template
inline ScopeGuardImpl5
{
return ScopeGuardImpl5
}
template
class ScopeGuardImpl6 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl6
{
return ScopeGuardImpl6
}
~ScopeGuardImpl6() throw()
{
SafeExecute(*this);
}
void Execute()
{
fun_(p1_, p2_, p3_,p4_,p5_,p6_);
}
protected:
ScopeGuardImpl6(F fun, P1 p1, P2 p2, P3 p3,P4 p4,P5 p5,P6 p6) : fun_(fun), p1_(p1), p2_(p2), p3_(p3), p4_(p4),p5_(p5),p6_(p6)
{
}
F fun_;
const P1 p1_;
const P2 p2_;
const P3 p3_;
const P4 p4_;
const P5 p5_;
const P6 p6_;
};
template
inline ScopeGuardImpl6
{
return ScopeGuardImpl6
}
template
class ScopeGuardImpl7 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl7
{
return ScopeGuardImpl7
}
~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
inline ScopeGuardImpl7
{
return ScopeGuardImpl7
}
template
class ScopeGuardImpl8 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl8
{
return ScopeGuardImpl8
}
~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
inline ScopeGuardImpl8
{
return ScopeGuardImpl8
}
template
class ScopeGuardImpl9 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl9
{
return ScopeGuardImpl9
}
~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
inline ScopeGuardImpl9
{
return ScopeGuardImpl9
}
template
class ScopeGuardImpl10 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl10
{
return ScopeGuardImpl10
}
~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
inline ScopeGuardImpl10
{
return ScopeGuardImpl10
}
template
class ScopeGuardImpl11 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl11
{
return ScopeGuardImpl11
}
~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
inline ScopeGuardImpl11
{
return ScopeGuardImpl11
}
template
class ScopeGuardImpl12 : public ScopeGuardImplBase
{
public:
static ScopeGuardImpl12
{
return ScopeGuardImpl12
}
~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
inline ScopeGuardImpl12
{
return ScopeGuardImpl12
}
//************************************************************
template
class ObjScopeGuardImpl0 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl0
{
return ObjScopeGuardImpl0
}
~ObjScopeGuardImpl0() throw()
{
SafeExecute(*this);
}
void Execute()
{
(obj_.*memFun_)();
}
protected:
ObjScopeGuardImpl0(Obj& obj, MemFun memFun)
: obj_(obj), memFun_(memFun) {}
Obj& obj_;
MemFun memFun_;
};
template
inline ObjScopeGuardImpl0
{
return ObjScopeGuardImpl0
}
template
class ObjScopeGuardImpl1 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl1
{
return ObjScopeGuardImpl1
}
~ObjScopeGuardImpl1() throw()
{
SafeExecute(*this);
}
void Execute()
{
(obj_.*memFun_)(p1_);
}
protected:
ObjScopeGuardImpl1(Obj& obj, MemFun memFun, P1 p1)
: obj_(obj), memFun_(memFun), p1_(p1) {}
Obj& obj_;
MemFun memFun_;
const P1 p1_;
};
template
inline ObjScopeGuardImpl1
{
return ObjScopeGuardImpl1
}
template
class ObjScopeGuardImpl2 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl2
{
return ObjScopeGuardImpl2
}
~ObjScopeGuardImpl2() throw()
{
SafeExecute(*this);
}
void Execute()
{
(obj_.*memFun_)(p1_, p2_);
}
protected:
ObjScopeGuardImpl2(Obj& obj, MemFun memFun, P1 p1, P2 p2)
: obj_(obj), memFun_(memFun), p1_(p1), p2_(p2) {}
Obj& obj_;
MemFun memFun_;
const P1 p1_;
const P2 p2_;
};
template
inline ObjScopeGuardImpl2
{
return ObjScopeGuardImpl2
}
template
class ObjScopeGuardImpl3 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl3
{
return ObjScopeGuardImpl3
}
~ObjScopeGuardImpl3() throw()
{
SafeExecute(*this);
}
void Execute()
{
(obj_.*memFun_)(p1_, p2_,p3_);
}
protected:
ObjScopeGuardImpl3(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3)
: obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3) {}
Obj& obj_;
MemFun memFun_;
const P1 p1_;
const P2 p2_;
const P3 p3_;
};
template
inline ObjScopeGuardImpl3
{
return ObjScopeGuardImpl3
}
template
class ObjScopeGuardImpl4 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl4
{
return ObjScopeGuardImpl4
}
~ObjScopeGuardImpl4() throw()
{
SafeExecute(*this);
}
void Execute()
{
(obj_.*memFun_)(p1_, p2_,p3_,p4_);
}
protected:
ObjScopeGuardImpl4(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4)
: obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4) {}
Obj& obj_;
MemFun memFun_;
const P1 p1_;
const P2 p2_;
const P3 p3_;
const P4 p4_;
};
template
inline ObjScopeGuardImpl4
{
return ObjScopeGuardImpl4
}
template
class ObjScopeGuardImpl5 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl5
{
return ObjScopeGuardImpl5
}
~ObjScopeGuardImpl5() throw()
{
SafeExecute(*this);
}
void Execute()
{
(obj_.*memFun_)(p1_, p2_,p3_,p4_,p5_);
}
protected:
ObjScopeGuardImpl5(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
: obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5) {}
Obj& obj_;
MemFun memFun_;
const P1 p1_;
const P2 p2_;
const P3 p3_;
const P4 p4_;
const P5 p5_;
};
template
inline ObjScopeGuardImpl5
{
return ObjScopeGuardImpl5
}
template
class ObjScopeGuardImpl6 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl6
{
return ObjScopeGuardImpl6
}
~ObjScopeGuardImpl6() throw()
{
SafeExecute(*this);
}
void Execute()
{
(obj_.*memFun_)(p1_, p2_,p3_,p4_,p5_,p6_);
}
protected:
ObjScopeGuardImpl6(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6)
: obj_(obj), memFun_(memFun), p1_(p1), p2_(p2), p3_(p3), p4_(p4), p5_(p5), p6_(p6) {}
Obj& obj_;
MemFun memFun_;
const P1 p1_;
const P2 p2_;
const P3 p3_;
const P4 p4_;
const P5 p5_;
const P6 p6_;
};
template
inline ObjScopeGuardImpl6
{
return ObjScopeGuardImpl6
}
template
class ObjScopeGuardImpl7 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl7
{
return ObjScopeGuardImpl7
}
~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
inline ObjScopeGuardImpl7
{
return ObjScopeGuardImpl7
}
template
class ObjScopeGuardImpl8 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl8
{
return ObjScopeGuardImpl8
}
~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
inline ObjScopeGuardImpl8
{
return ObjScopeGuardImpl8
}
template
class ObjScopeGuardImpl9 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl9
{
return ObjScopeGuardImpl9
}
~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
inline ObjScopeGuardImpl9
{
return ObjScopeGuardImpl9
}
template
class ObjScopeGuardImpl10 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl10
{
return ObjScopeGuardImpl10
}
~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
inline ObjScopeGuardImpl10
{
return ObjScopeGuardImpl10
}
template
class ObjScopeGuardImpl11 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl11
MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11)
{
return ObjScopeGuardImpl11
}
~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
inline ObjScopeGuardImpl11
MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11)
{
return ObjScopeGuardImpl11
}
template
class ObjScopeGuardImpl12 : public ScopeGuardImplBase
{
public:
static ObjScopeGuardImpl12
MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12)
{
return ObjScopeGuardImpl12
}
~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
inline ObjScopeGuardImpl12
MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10, P11 p11, P12 p12)
{
return ObjScopeGuardImpl12
}
NAMESPACE_CALL_HELPER_END
#endif