Minimal working SWIG interface

mail@pastecode.io avatar
unknown
plain_text
2 years ago
484 B
1
Indexable
Never
%module test

// Define templates before SWIG processes the code.
%include "std_vector.i"
%include "std_string.i"
%template(vector_string) std::vector<std::string>;
%template(vector_1d_double) std::vector<double>;
%template(vector_2d_double) std::vector<std::vector<double>>;

%inline %{
#include <vector>
#include <string>

std::vector<std::string> getSignalNames() {
    return {"abc","123"};
}

std::vector<std::vector<double>> getSignals() {
    return {{1.1,2.2},{3.3,4.4}};
}
%}