如何转换(类型映射)C++;带SWIG的Java向量向量 P> >有人能帮助我描述 SWIG类型映射> >将一个类型为C++的java向量向量转换为一个等价的JAG锯齿向量?
这就是到目前为止我在接口文件中所做的,我仍然需要在java端进行指针访问 如果可能的话,希望有描述性代码 谢谢你的时间和帮助如何转换(类型映射)C++;带SWIG的Java向量向量 P> >有人能帮助我描述 SWIG类型映射> >将一个类型为C++的java向量向量转换为一个等价的JAG锯齿向量?,java,c++,swig,Java,C++,Swig,这就是到目前为止我在接口文件中所做的,我仍然需要在java端进行指针访问 如果可能的话,希望有描述性代码 谢谢你的时间和帮助 %include "std_vector.i" %{ #define SWIG_JAVA_EXTRA_NATIVE_CONTAINERS %} %typemap(out) uint32_t %{ $result = (jlong)$1; %} // Instantiate vector templates used by SimpleR namespace s
%include "std_vector.i"
%{
#define SWIG_JAVA_EXTRA_NATIVE_CONTAINERS
%}
%typemap(out) uint32_t %{ $result = (jlong)$1; %}
// Instantiate vector templates used by SimpleR
namespace std {
%template(IntVector) vector<int>;
%template(DoubleVector) vector<double>;
%template(LongVector) vector<uint32_t>;
%rename(LongVector) vector<uint32_t>;
%template(LongVectorVector) vector<vector<uint32_t> >;
%template(BooleanVector) vector<bool>;
%template(StringVector) vector<string>;
%template(ConstCharVector) vector<const char*>;
%template(RepresentationVector) vector<SimpleR::ModelRepresentation *>;
}
// In pop()
%typemap(out) std::vector<std::vector<uint32_t> >::value_type {
$result = SWIG_NewPointerObj(SWIG_as_voidptr(&$1), $descriptor(std::vector<uint32_t>), 0 | 0 );
}
// In front(), back(), __getitem__()
%typemap(out) std::vector<std::vector<uint32_t> >::value_type & {
$result = SWIG_NewPointerObj(SWIG_as_voidptr($1), $descriptor(std::vector<uint32_t>), 0 | 0 );
}
%包括“std_vector.i”
%{
#定义SWIG_JAVA_EXTRA_NATIVE_容器
%}
%typemap(out)uint32_t%{$result=(jlong)$1;%}
//实例化SimpleR使用的向量模板
名称空间标准{
%模板(IntVector)向量;
%模板(双向量)向量;
%模板(长向量)向量;
%重命名(长向量)向量;
%模板(长向量)向量;
%模板(布尔向量)向量;
%模板(StringVector)向量;
%模板(ConstCharVector)向量;
%模板(表示向量)向量;
}
//流行音乐()
%typemap(out)std::vector::value_type{
$result=SWIG_NewPointerObj(SWIG_as_voidptr(&$1),$descriptor(std::vector),0 | 0);
}
//在前面(),后面(),_获取项目
%typemap(out)std::vector::value\u type&{
$result=SWIG_NewPointerObj(SWIG_as_voidptr($1),$descriptor(std::vector),0 | 0);
}
类似:或者也许?类似:或者也许?