Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/343.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 使用c+的swig包装问题+;模板_C++_Python_Swig_Swig Template - Fatal编程技术网

C++ 使用c+的swig包装问题+;模板

C++ 使用c+的swig包装问题+;模板,c++,python,swig,swig-template,C++,Python,Swig,Swig Template,我有一个swig文件,其中包含以下代码: %module vgSofa #define VG_SOFA_API %import vgd/vgd.i %import vgm/vgm.i %template(BasicHandlerShp1) boost::shared_ptr<vgSofa::handler::BasicHandler>; %{ #include "vgSofa/handler/BasicHandler.hpp" %} %template(BasicH

我有一个swig文件,其中包含以下代码:

%module vgSofa

#define VG_SOFA_API

%import vgd/vgd.i
%import vgm/vgm.i


%template(BasicHandlerShp1) boost::shared_ptr<vgSofa::handler::BasicHandler>;


%{

#include "vgSofa/handler/BasicHandler.hpp"

%}

%template(BasicHandlerShp) vgd::Shp<vgSofa::handler::BasicHandler>;


%include "vgSofa/handler/BasicHandler.hpp"
%vgSofa模块
#定义VG_SOFA_API
%导入vgd/vgd.i
%导入vgm/vgm.i
%模板(BasicHandlerShp1)boost::shared_ptr;
%{
#包括“vgSofa/handler/BasicHandler.hpp”
%}
%模板(BasicHandlerShp)vgd::Shp;
%包括“vgSofa/handler/BasicHandler.hpp”
其中
vgd::Shp
继承到
boost::shared\u ptr
。 此代码生成包装器和python文件,但在生成的python文件中,我无法访问模板
BasicHandlerShp
中的
vgSofa::handler::BasicHandler
函数。 如何在
BasicHandlerShp
中访问这些函数?
谢谢

基本课程对你有用吗?我不知道为什么您希望vgd::Shp从shared_ptr继承,这真的是您想要做的吗