java: Don't use SWIG attribute mechanism.

Using the attribute mechanism results in badly named wrappers like
getLog_level(), as well as incompletely applied typemaps for templated
container types. If we just avoid this mechanism entirely, we get the
same foo() and set_foo() accessors as we have in the C++ API.
This commit is contained in:
Martin Ling 2015-10-21 00:29:50 +01:00 committed by Uwe Hermann
parent d4db558810
commit d0fa4ac1e7
2 changed files with 5 additions and 8 deletions

View File

@ -293,20 +293,13 @@ typedef jobject jdatafeedcallback;
%include "doc.i"
%define %attributevector(Class, Type, Name, Get)
%attributeval(sigrok::Class, Type, Name, Get);
%enddef
%define %attributemap(Class, Type, Name, Get)
%attributeval(sigrok::Class, Type, Name, Get);
%enddef
%define %enumextras(Class)
%enddef
/* Ignore these for now, need fixes. */
%ignore sigrok::Context::create_analog_packet;
%ignore sigrok::Context::create_meta_packet;
%ignore sigrok::Meta::config;
%include "bindings/swig/classes.i"

View File

@ -81,6 +81,8 @@ template< class T > class enable_shared_from_this;
%ignore sigrok::DatafeedCallbackData;
#ifndef SWIGJAVA
#define SWIG_ATTRIBUTE_TEMPLATE
%include "attribute.i"
@ -209,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"