]> sigrok.org Git - libsigrok.git/blobdiff - bindings/swig/classes.i
java: Don't use SWIG attribute mechanism.
[libsigrok.git] / bindings / swig / classes.i
index 8f57e4186de996061f5bfc654051052b1fea53a8..b87bbe1b06a33c3566c19e62a188fcb45078536c 100644 (file)
 
 #pragma SWIG nowarn=325,401
 
-%{
-#include <libsigrokcxx/libsigrokcxx.hpp>
-using namespace std;
-%}
-
 %include "typemaps.i"
-%include "std_string.i"
-%include "std_vector.i"
-%include "std_map.i"
-%include "std_shared_ptr.i"
 %include "exception.i"
 
 %{
@@ -66,7 +57,6 @@ template< class T > class enable_shared_from_this;
 %shared_ptr(sigrok::HardwareDevice);
 %shared_ptr(sigrok::Channel);
 %shared_ptr(sigrok::ChannelGroup);
-%shared_ptr(sigrok::EventSource);
 %shared_ptr(sigrok::Session);
 %shared_ptr(sigrok::SessionDevice);
 %shared_ptr(sigrok::Packet);
@@ -86,59 +76,12 @@ template< class T > class enable_shared_from_this;
 %shared_ptr(sigrok::TriggerMatch);
 %shared_ptr(sigrok::UserDevice);
 
-%template(StringMap) std::map<std::string, std::string>;
-
-%template(DriverMap)
-    std::map<std::string, std::shared_ptr<sigrok::Driver> >;
-%template(InputFormatMap)
-    std::map<std::string, std::shared_ptr<sigrok::InputFormat> >;
-%template(OutputFormatMap)
-    std::map<std::string, std::shared_ptr<sigrok::OutputFormat> >;
-
-%template(HardwareDeviceVector)
-    std::vector<std::shared_ptr<sigrok::HardwareDevice> >;
-
-%template(DeviceVector)
-    std::vector<std::shared_ptr<sigrok::Device> >;
-
-%template(ChannelVector)
-    std::vector<std::shared_ptr<sigrok::Channel> >;
-
-%template(ChannelGroupMap)
-    std::map<std::string, std::shared_ptr<sigrok::ChannelGroup> >;
-
-/* Workaround for SWIG bug. The vector template instantiation
-   isn't needed but somehow fixes a bug that stops the wrapper
-   for the map instantiation from compiling. */
-%template(ConfigVector)
-    std::vector<const sigrok::ConfigKey *>;
-%template(ConfigMap)
-    std::map<const sigrok::ConfigKey *, Glib::VariantBase>;
-
-%template(OptionVector)
-    std::vector<std::shared_ptr<sigrok::Option> >;
-%template(OptionMap)
-    std::map<std::string, std::shared_ptr<sigrok::Option> >;
-
-%template(VariantVector)
-    std::vector<Glib::VariantBase>;
-%template(VariantMap)
-    std::map<std::string, Glib::VariantBase>;
-
-%template(QuantityFlagVector)
-    std::vector<const sigrok::QuantityFlag *>;
-
-%template(TriggerStageVector)
- std::vector<std::shared_ptr<sigrok::TriggerStage> >;
-
-%template(TriggerMatchVector)
- std::vector<std::shared_ptr<sigrok::TriggerMatch> >;
-
 #define SR_API
 #define SR_PRIV
 
 %ignore sigrok::DatafeedCallbackData;
-%ignore sigrok::SourceCallbackData;
+
+#ifndef SWIGJAVA
 
 #define SWIG_ATTRIBUTE_TEMPLATE
 
@@ -268,6 +211,8 @@ typedef std::map<const sigrok::ConfigKey *, Glib::VariantBase>
 %attribute(sigrok::Analog, const sigrok::Unit *, unit, unit);
 %attributevector(Analog, std::vector<const sigrok::QuantityFlag *>, mq_flags, mq_flags);
 
+#endif
+
 %include <libsigrokcxx/libsigrokcxx.hpp>
 
 %include "swig/enums.i"