]> sigrok.org Git - libsigrok.git/blame - bindings/swig/templates.i
java: Don't use SWIG attribute mechanism.
[libsigrok.git] / bindings / swig / templates.i
CommitLineData
c7855def
ML
1/*
2 * This file is part of the libsigrok project.
3 *
4 * Copyright (C) 2015 Martin Ling <martin-sigrok@earth.li>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20%{
21#include <libsigrokcxx/libsigrokcxx.hpp>
22using namespace std;
23%}
24
25%include "std_string.i"
26%include "std_shared_ptr.i"
27%include "std_vector.i"
28%include "std_map.i"
29
30%template(StringMap) std::map<std::string, std::string>;
31
32%template(DriverMap)
33 std::map<std::string, std::shared_ptr<sigrok::Driver> >;
34%template(InputFormatMap)
35 std::map<std::string, std::shared_ptr<sigrok::InputFormat> >;
36%template(OutputFormatMap)
37 std::map<std::string, std::shared_ptr<sigrok::OutputFormat> >;
38
39%template(HardwareDeviceVector)
40 std::vector<std::shared_ptr<sigrok::HardwareDevice> >;
41
42%template(DeviceVector)
43 std::vector<std::shared_ptr<sigrok::Device> >;
44
45%template(ChannelVector)
46 std::vector<std::shared_ptr<sigrok::Channel> >;
47
48%template(ChannelGroupMap)
49 std::map<std::string, std::shared_ptr<sigrok::ChannelGroup> >;
50
51/* Workaround for SWIG bug. The vector template instantiation
52 isn't needed but somehow fixes a bug that stops the wrapper
53 for the map instantiation from compiling. */
54%template(ConfigVector)
55 std::vector<const sigrok::ConfigKey *>;
56%template(ConfigMap)
57 std::map<const sigrok::ConfigKey *, Glib::VariantBase>;
58
59%template(OptionVector)
60 std::vector<std::shared_ptr<sigrok::Option> >;
61%template(OptionMap)
62 std::map<std::string, std::shared_ptr<sigrok::Option> >;
63
64%template(VariantVector)
65 std::vector<Glib::VariantBase>;
66%template(VariantMap)
67 std::map<std::string, Glib::VariantBase>;
68
69%template(QuantityFlagVector)
70 std::vector<const sigrok::QuantityFlag *>;
71
72%template(TriggerStageVector)
73 std::vector<std::shared_ptr<sigrok::TriggerStage> >;
74
75%template(TriggerMatchVector)
76 std::vector<std::shared_ptr<sigrok::TriggerMatch> >;