[英]Auto proxy class for interfaces
I have few interfaces IFace1
, IFace2
, etc. The interfaces have different set of methods, all the methods have different return and input params types. 我只有几个接口
IFace1
, IFace2
等。这些接口具有不同的方法集,所有方法都具有不同的返回和输入参数类型。
I'd like to have a proxy class like 我想要一个像
template<typename IFace>
class TheProxyClass : public<IFace>
{
/*...................*/
private:
IFace * iface;
}
I need the class to have IFace
methods, making them transit calling via iface
attribute. 我需要该类具有
IFace
方法,以使其通过iface
属性进行IFace
调用。 A kind of automatic generation IFace
methods, doing only calling corresponding ones via iface
. 一种自动生成的
IFace
方法,仅通过iface
调用相应的方法。
Is there way i can do it? 有办法吗? No C++11, boost is allowed.
没有C ++ 11,允许升压。
Here - http://yadi.sk/d/dyOfa8yo2SbRf - is a Python script of mine, that generates impementation for given interface. 这里- http://yadi.sk/d/dyOfa8yo2SbRf -是我的Python脚本,产生了给定接口impementation。 Now method bodies are empty, but I think it's not so hard to modify them to insert something like that
现在方法主体为空,但我认为修改它们以插入类似内容并不难
"iface->" + funcName
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.