Commit graph

321 commits

Author SHA1 Message Date
William S Fulton
02a00db9f5 Remove redundant code 2017-06-22 20:33:16 +01:00
William S Fulton
dd25f5b722 Java std::list rework to be consistent with std::vector wrappers 2017-06-22 20:33:09 +01:00
Alan Woodland
0083d451db Switched from autobox to jboxtype per #842 2017-06-05 21:58:58 +01:00
Alan Woodland
4db1300622 Merge branch 'master' into javalist 2017-06-05 21:55:12 +01:00
William S Fulton
10e73a5bfb Java jboxtype typemap documentation and tidy up 2017-06-05 20:47:49 +01:00
William S Fulton
5eb9f735da Add generic approach in fragments for converting size_t to Java int 2017-06-05 18:49:54 +01:00
William S Fulton
32e7074d9b Whitespace fixes in STL wrappers 2017-06-03 18:36:59 +01:00
William S Fulton
fdca8e9829 Better variable naming consistency in STL containers 2017-05-26 22:37:29 +01:00
William S Fulton
b51f32a915 Java std::vector tweaks
- Replace javacode typemap with %proxycode to make this typemap available to users
- Make doSize private.
2017-05-26 22:37:22 +01:00
William S Fulton
338acfabeb Merge branch 'vadz-java-vector'
* vadz-java-vector:
  Fix potential STL std::vector wrappers <: digraphs problems.
  Add runtime checks for vector size in Java
  Make std::vector<> wrappers conform to List interface in Java
  Add helper macro to avoid duplication in Java vector typemaps

Conflicts:
	CHANGES.current
2017-05-26 19:15:12 +01:00
William S Fulton
0bafadea5a Fix potential STL std::vector wrappers <: digraphs problems. 2017-05-26 18:55:52 +01:00
William S Fulton
98e67539dd Director testcase cosmetic fixes 2017-05-22 19:15:39 +01:00
William S Fulton
a271043555 Fix warnings in Java OUTPUT and INOUT typemaps 2017-05-14 00:39:08 +01:00
William S Fulton
07ab80b49e Add raise methods for throwing c++ exceptions in C#, Java, D
The director c++ exceptions are thrown in a helper method instead of in
the director overloaded method. This circumvents compiler warnings about
throwing exceptions when the method has an exception specification or
noexcept. If the exception is thrown, abort will still be called!
In Java, the "director:noexcept" typemap can be used to do something
else. This typemap should be ported to the other languages too.
2017-05-13 17:01:15 +01:00
William S Fulton
ab1e9f5bd9 Consistent whitespace amongst all the shared_ptr and intrusive_ptr typemaps
[skip ci]
2017-04-20 19:21:47 +01:00
William S Fulton
72ba741d1c Fix wrapping of references/pointers and qualifiers to member pointers
Also fix Go wrapping of member const function pointers.
2017-03-16 21:04:38 +00:00
William S Fulton
8a4ab380a1 Java director typemaps and test tweak
- Fix java_director_typemaps test name clash ensuring parallel tests work
- Replace assert with code that is guaranteed to run
- Nicer generated code from directorargout typemap
2017-01-24 23:47:30 +00:00
Andrey Starodubtsev
519f296579 WIP: #704 (java directorargout + java/typemaps.i fixes)
- failed tests fixed
2017-01-22 18:14:38 +03:00
Andrey Starodubtsev
7cb2663132 WIP: #704 (java directorargout + java/typemaps.i fixes)
- avoid JCALL calls in generated code
- avoid redundant blocks in generated code
2017-01-22 13:41:53 +03:00
Andrey Starodubtsev
710804c88f WIP: #704 (java directorargout + java/typemaps.i fixes)
- reverted changes in javahead.swg
2017-01-22 13:41:44 +03:00
Andrey Starodubtsev
4ba9de370e Merge branch 'master' into directorargout_and_java_typemaps 2017-01-21 17:41:31 +03:00
William S Fulton
449aa08124 %extend changes and remove default use of javatype, dtype, cstype %typemaps
1) The %extend directive can now optionally support one of the 'class', 'struct' or 'union'.
2) The SWIG library no longer uses the javatype, dtype or cstype typemaps, thereby
   completely freeing them up for users to use without having to replicate the library
   code that they previously added

Tested by changes to test: java_lib_arrays
2017-01-15 16:50:24 +00:00
William S Fulton
3d2e57b0f2 Add %proxycode directive for adding code into proxy classes for C#, D and Java 2017-01-13 20:43:50 +00:00
Vadim Zeitlin
eba70ed16f Add runtime checks for vector size in Java
It doesn't seem to be possible to have a Java collection with more than 2^31-1
items, but it is perfectly possible to have an std::vector with more elements
than that in C++, so add runtime checks verifying that we don't lose count of
elements in the Java wrappers.
2016-11-29 17:47:01 +01:00
Vadim Zeitlin
c79dd9d420 Make std::vector<> wrappers conform to List interface in Java
Derive the class wrapping std::vector<> in Java from java.util.AbstractList<>.
This makes it possible to use it with various algorithms working with Java
collections and, maybe even more importantly, makes it possible to iterate
over the wrapped vectors using for-each loops.

This commit is based on the original patch by Volker Diels-Grabsch from
https://sourceforge.net/p/swig/patches/278/
2016-11-29 17:46:38 +01:00
Vadim Zeitlin
7c4109c701 Add helper macro to avoid duplication in Java vector typemaps
No real changes yet, just use a C#-like macro in Java std::vector<> typemaps
too to avoid having to repeat almost exactly the same class declaration for
the general case and for the bool specialization.
2016-11-29 17:45:56 +01:00
William S Fulton
0a22fa0df1 Missing transient keywords in Java proxy class
Further security exploit refinements to a1771c
2016-11-13 19:55:50 +00:00
Andrey Starodubtsev
3e449ea05f Merge branch 'master' into directorargout_and_java_typemaps 2016-11-02 18:12:38 +03:00
Tobias Lau
26293546a6 Added LocalRefGuard for wstrings 2016-10-20 13:37:28 +02:00
Andrey Starodubtsev
b9cdc3c5e1 Merge branch 'master' into directorargout_and_java_typemaps 2016-10-13 14:14:59 +03:00
Daniel Vollmer
ce1cb85d86 Add <typeinfo> header for std::bad_cast 2016-09-17 13:24:32 +02:00
Daniel Vollmer
2dc87d7485 Add std::bad_cast to std_except.i
This exception occurs when dynamic_cast<T&> fails.

Fixes #783.
2016-09-17 10:26:54 +02:00
Andrey Starodubtsev
3ad041eede a lot of memory leak (local refs) fixed 2016-06-16 19:02:53 +03:00
Andrey Starodubtsev
b2bcf040c0 java directorargout + java/typemaps.i fixes
- directorargout didn't work - it used string "jresult" instead of
  argument name
- java/typemaps.i didn't work with directors
- test for using java/typemaps.i in directors added
2016-06-08 15:04:47 +03:00
Alan Woodland
3908817fc3 Document autobox.i 2016-05-31 22:11:15 +01:00
Alan Woodland
c5a724f1bb Made the conversion from long->int for size_type mapping onto Java interfaces cleaner. 2016-05-31 21:43:13 +01:00
Alan Woodland
5eb46d5f9f Be consistent in semantics of %extend on std::list::iterator 2016-05-31 21:06:09 +01:00
Alan Woodland
00ac1f38e5 Comment on consideration of making iterator non-static. 2016-05-31 21:06:09 +01:00
Alan Woodland
1f4a8e6231 Java style fix: iterator->Iterator 2016-05-31 20:28:08 +01:00
Alan Woodland
583fdce790 Moving iterator functionality into nested Java class now. 2016-05-31 20:22:39 +01:00
Alan Woodland
e561a78205 Added a best case workaround for std::list::size_type vs jint problem. There's a bit of commentry added around it too for clarity. 2016-05-31 14:49:03 +01:00
Alan Woodland
9ade17cc50 Drop non-const reference from autobox typemap macro to be consistent. 2016-05-31 14:49:03 +01:00
Alan Woodland
b09fce84a4 just use a forward declaration for C++ iterator types to fix enum errors 2016-05-31 14:49:02 +01:00
Alan Woodland
d217a68908 added more comments in a few places 2016-05-31 14:49:02 +01:00
Alan Woodland
a2b092ab7e Don't expose sort() to avoid adding dependencies on all std::list users 2016-05-31 14:49:01 +01:00
Alan Woodland
0094e3c90d Target each method specificly for setting modifiers 2016-05-31 14:49:01 +01:00
Alan Woodland
b0de71857e Don't expose remove() method from std::list to avoid confusing it with Java's remove() in List 2016-05-31 14:49:01 +01:00
Alan Woodland
6a4467721b - added std_list.i implemenatation that extends Java's AbstractSequentialList base class
- added autobox.i that provides supporting typemaps for generics in containers
2016-05-31 14:49:00 +01:00
William S Fulton
98a31ff633 Fix directorin SWIGTYPE typemaps to make a copy as these are used for pass by value.
Closes #434
2016-05-14 21:32:24 +01:00
William S Fulton
a15bbbaee5 Java - unsigned long long marshalling improvements for negative numbers
Affects marshalling of negative numbers from Java to C only.
A cast to signed long long in the C layer will now result in the expected value.

Closes #623.
2016-03-31 18:56:32 +01:00