-
Notifications
You must be signed in to change notification settings - Fork 29
/
foobar.i
63 lines (47 loc) · 2.12 KB
/
foobar.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
61
62
63
%module csFooBar
%include "stdint.i"
%include "std_vector.i"
%include "std_string.i"
%include "std_pair.i"
%include "base.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 <foobar/FooBar.hpp>
%}
%ignore ""; // ignore all
%define %unignore %rename("%s") %enddef
%unignore foobar;
namespace foobar {
%rename("StringVectorOutput") stringVectorOutput(int);
%rename("StringVectorInput") stringVectorInput(std::vector<std::string>);
%rename("StringVectorRefInput") stringVectorRefInput(const std::vector<std::string>&);
%unignore stringJaggedArrayOutput(int);
%unignore stringJaggedArrayInput(std::vector<std::vector<std::string>>);
%unignore stringJaggedArrayRefInput(const std::vector<std::vector<std::string>>&);
%rename("PairVectorOutput") pairVectorOutput(int);
%rename("PairVectorInput") pairVectorInput(std::vector<std::pair<int, int>>);
%rename("PairVectorRefInput") pairVectorRefInput(const std::vector<std::pair<int, int>>&);
%rename("PairJaggedArrayOutput") pairJaggedArrayOutput(int);
%rename("PairJaggedArrayInput") pairJaggedArrayInput(std::vector<std::vector<std::pair<int, int>>>);
%rename("PairJaggedArrayRefInput") pairJaggedArrayRefInput(const std::vector<std::vector<std::pair<int, int>>>&);
%rename("FreeFunction") freeFunction(int);
%rename("FreeFunction") freeFunction(int64_t);
%unignore FooBar;
%rename("StaticFunction") FooBar::staticFunction(int);
%rename("StaticFunction") FooBar::staticFunction(int64_t);
%rename("GetInt") FooBar::getInt() const;
%rename("SetBarInt") FooBar::setBarInt(int);
%rename("SetFooInt") FooBar::setFooInt(int);
%rename("GetInt64") FooBar::getInt64() const;
%rename("SetBarInt64") FooBar::setBarInt64(int64_t);
%rename("SetFooInt64") FooBar::setFooInt64(int64_t);
%rename ("ToString") FooBar::operator();
} // namespace foo
// Process symbols in header
%include "foobar/FooBar.hpp"
%unignore ""; // unignore all