X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=bindings%2Fswig%2Fclasses.i;h=523995dad9e19882b354d2891a8de7577ffe8716;hb=b41562f6ce3ba5572d65965811e0eb1f62a4b223;hp=4fb37315821d6d4d7004c7906f02bd9fddd5aaa1;hpb=ea22dc108b1da4c1f43c5cb2b8433a44fad726bf;p=libsigrok.git diff --git a/bindings/swig/classes.i b/bindings/swig/classes.i index 4fb37315..523995da 100644 --- a/bindings/swig/classes.i +++ b/bindings/swig/classes.i @@ -19,16 +19,7 @@ #pragma SWIG nowarn=325,401 -%{ -#include "libsigrok/libsigrok.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); @@ -84,60 +74,14 @@ template< class T > class enable_shared_from_this; %shared_ptr(sigrok::Trigger); %shared_ptr(sigrok::TriggerStage); %shared_ptr(sigrok::TriggerMatch); - -%template(StringMap) std::map; - -%template(DriverMap) - std::map >; -%template(InputFormatMap) - std::map >; -%template(OutputFormatMap) - std::map >; - -%template(HardwareDeviceVector) - std::vector >; - -%template(DeviceVector) - std::vector >; - -%template(ChannelVector) - std::vector >; - -%template(ChannelGroupMap) - std::map >; - -/* 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; -%template(ConfigMap) - std::map; - -%template(OptionVector) - std::vector >; -%template(OptionMap) - std::map >; - -%template(VariantVector) - std::vector; -%template(VariantMap) - std::map; - -%template(QuantityFlagVector) - std::vector; - -%template(TriggerStageVector) - std::vector >; - -%template(TriggerMatchVector) - std::vector >; +%shared_ptr(sigrok::UserDevice); #define SR_API #define SR_PRIV %ignore sigrok::DatafeedCallbackData; -%ignore sigrok::SourceCallbackData; + +#ifndef SWIGJAVA #define SWIG_ATTRIBUTE_TEMPLATE @@ -175,9 +119,6 @@ typedef std::map %attribute(sigrok::Context, const sigrok::LogLevel *, log_level, log_level, set_log_level); -%attributestring(sigrok::Context, - std::string, log_domain, log_domain, set_log_domain); - %attributestring(sigrok::Driver, std::string, name, name); %attributestring(sigrok::Driver, std::string, long_name, long_name); @@ -263,15 +204,17 @@ typedef std::map %attributemap(Meta, map_ConfigKey_Variant, config, config); +%attributevector(Analog, + std::vector >, channels, channels); %attribute(sigrok::Analog, int, num_samples, num_samples); %attribute(sigrok::Analog, const sigrok::Quantity *, mq, mq); %attribute(sigrok::Analog, const sigrok::Unit *, unit, unit); %attributevector(Analog, std::vector, mq_flags, mq_flags); -%include "libsigrok/libsigrok.hpp" +#endif -%include "enums.i" +%include -namespace sigrok { -%include "libsigrok/enums.hpp" -} +%include "swig/enums.i" + +%include