]> sigrok.org Git - libsigrok.git/blame - bindings/swig/templates.i
zketech-ebd-usb: Don't ignore errors
[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"
f2831ab3
ML
29#ifdef SWIGJAVA
30namespace std {
31 template <class _Key> class set {};
32}
33#else
34%include "std_set.i"
35#endif
c7855def
ML
36
37%template(StringMap) std::map<std::string, std::string>;
38
39%template(DriverMap)
40 std::map<std::string, std::shared_ptr<sigrok::Driver> >;
41%template(InputFormatMap)
42 std::map<std::string, std::shared_ptr<sigrok::InputFormat> >;
43%template(OutputFormatMap)
44 std::map<std::string, std::shared_ptr<sigrok::OutputFormat> >;
45
46%template(HardwareDeviceVector)
47 std::vector<std::shared_ptr<sigrok::HardwareDevice> >;
48
49%template(DeviceVector)
50 std::vector<std::shared_ptr<sigrok::Device> >;
51
52%template(ChannelVector)
53 std::vector<std::shared_ptr<sigrok::Channel> >;
54
55%template(ChannelGroupMap)
56 std::map<std::string, std::shared_ptr<sigrok::ChannelGroup> >;
57
58/* Workaround for SWIG bug. The vector template instantiation
59 isn't needed but somehow fixes a bug that stops the wrapper
60 for the map instantiation from compiling. */
61%template(ConfigVector)
62 std::vector<const sigrok::ConfigKey *>;
36bb818d 63
c7855def
ML
64%template(ConfigMap)
65 std::map<const sigrok::ConfigKey *, Glib::VariantBase>;
66
36bb818d
ML
67%template(ConfigSet)
68 std::set<const sigrok::ConfigKey *>;
69
70/* Workaround for SWIG bug. The vector template instantiation
71 isn't needed but somehow fixes a bug that stops the wrapper
72 for the set instantiation from compiling. */
73%template(CapabilityVector)
74 std::vector<const sigrok::Capability *>;
12f2f640 75
f2831ab3 76%template(CapabilitySet)
12f2f640 77 std::set<const sigrok::Capability *>;
f2831ab3 78
c7855def
ML
79%template(OptionVector)
80 std::vector<std::shared_ptr<sigrok::Option> >;
81%template(OptionMap)
82 std::map<std::string, std::shared_ptr<sigrok::Option> >;
83
84%template(VariantVector)
85 std::vector<Glib::VariantBase>;
86%template(VariantMap)
87 std::map<std::string, Glib::VariantBase>;
88
89%template(QuantityFlagVector)
90 std::vector<const sigrok::QuantityFlag *>;
91
92%template(TriggerStageVector)
93 std::vector<std::shared_ptr<sigrok::TriggerStage> >;
94
95%template(TriggerMatchVector)
96 std::vector<std::shared_ptr<sigrok::TriggerMatch> >;