【问题标题】:Make bindings aware of ancestor bindings使绑定知道祖先绑定
【发布时间】:2015-02-15 22:48:33
【问题描述】:

我有一个从库类派生的 C++ 类。

class Derived : public LargeLibrary::ParentWithHugeInterface
{
  // add some methods
  // override some other methods
};

这个库有自己的 Python 和 Perl 绑定(使用 SWIG 创建)。现在我想为我自己的类创建类似的绑定。我可以让我的绑定了解LargeLibrary 的遗留问题,以便将DerivedLargeLibrary 的方法一起使用并获取其父接口吗?

更新: 我找到了 Python 的 PyTypeObject* PyTypeObject.tp_base 插槽,但是我仍然不明白如何使用它。

【问题讨论】:

    标签: python c++ perl swig


    【解决方案1】:

    终于找到了解决办法。

    就像在接口文件中添加%import "LargeLibrary.i"一样简单。

    【讨论】:

      猜你喜欢
      • 2011-10-13
      • 1970-01-01
      • 1970-01-01
      • 2011-03-25
      • 2011-01-05
      • 1970-01-01
      • 2012-07-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多