-
Notifications
You must be signed in to change notification settings - Fork 2
/
bar.i
60 lines (44 loc) · 2.07 KB
/
bar.i
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
%module pyBar
%include "stdint.i"
%include "std_vector.i"
%include "std_string.i"
%include "std_pair.i"
%template(StringVector) std::vector<std::string>;
%template(StringJaggedArray) std::vector<std::vector<std::string>>;
%template(IntPair) std::pair<int, int>;
%template(PairVector) std::vector<std::pair<int, int>>;
%template(PairJaggedArray) std::vector<std::vector<std::pair<int, int>>>;
// Add necessary symbols to generated header
%{
#include <bar/Bar.hpp>
%}
%ignore ""; // ignore all
%define %unignore %rename("%s") %enddef
%unignore bar;
namespace bar {
%rename("string_vector_output") stringVectorOutput(int);
%rename("string_vector_input") stringVectorInput(std::vector<std::string>);
%rename("string_vector_ref_input") stringVectorRefInput(const std::vector<std::string>&);
%rename("string_jagged_array_output") stringJaggedArrayOutput(int);
%rename("string_jagged_array_input") stringJaggedArrayInput(std::vector<std::vector<std::string>>);
%rename("string_jagged_array_ref_input") stringJaggedArrayRefInput(const std::vector<std::vector<std::string>>&);
%rename("pair_vector_output") pairVectorOutput(int);
%rename("pair_vector_input") pairVectorInput(std::vector<std::pair<int, int>>);
%rename("pair_vector_ref_input") pairVectorRefInput(const std::vector<std::pair<int, int>>&);
%rename("pair_jagged_array_output") pairJaggedArrayOutput(int);
%rename("pair_jagged_array_input") pairJaggedArrayInput(std::vector<std::vector<std::pair<int, int>>>);
%rename("pair_jagged_array_ref_input") pairJaggedArrayRefInput(const std::vector<std::vector<std::pair<int, int>>>&);
%rename("free_function") freeFunction(int);
%rename("free_function") freeFunction(int64_t);
%unignore Bar;
%rename ("static_function") Bar::staticFunction(int);
%rename ("static_function") Bar::staticFunction(int64_t);
%rename ("get_int") Bar::getInt() const;
%rename ("set_int") Bar::setInt(int);
%rename ("get_int64") Bar::getInt64() const;
%rename ("set_int64") Bar::setInt64(int64_t);
%rename ("__str__") Bar::operator();
} // namespace bar
// Process symbols in header
%include "bar/Bar.hpp"
%unignore ""; // unignore all