Commit Graph

15 Commits

Author SHA1 Message Date
William S Fulton 24a66e6125 Add const std::unique_ptr & input typemaps 2024-03-06 21:46:58 +00:00
William S Fulton 846b40793e Add non-const std::unique_ptr & input typemaps 2024-03-06 21:46:58 +00:00
William S Fulton 5712ce6464 std::unique_ptr return by reference typemaps added 2024-03-06 21:46:58 +00:00
William S Fulton 3f1e40d2f4 Add std::unique_ptr && output typemaps
Move semantics are not supported by default.
They behave as if a lvalue reference was returned.
2024-03-06 21:46:58 +00:00
William S Fulton ae22a97f1b Movable std::unique_ptr - add std::unique_ptr && typemaps
Closes #2650
2024-03-06 21:46:58 +00:00
Olly Betts ec56bff28d [java] Suppress System.runFinalization() removal warnings
These need to be addressed, but meanwhile it makes running the testsuite
with OpenJDK 21 or newer unhelpfully noisy so suppressing it seems more
helpful than not.

Closes: #2819
2024-03-01 10:42:22 +13:00
William S Fulton e97181ebc0 Add missing typecheck typemaps for std::auto_ptr and std::unique_ptr
To fix overloading when using these types.
2022-09-17 10:23:51 +01:00
William S Fulton 7934561874 Test/fixes to handle NULL pointer for unique_ptr/auto_ptr
Also add missing unique_ptr tests for Lua and Racket.
2022-08-31 19:42:55 +01:00
William S Fulton d4b1152d4b Add raw pointer handling test for virtual inheritance
This is a test added for D in previous commit, now expanded to all target languages.

Tidy up counting object instances.
2022-08-05 22:30:23 +01:00
William S Fulton a741c7dbcf auto_ptr and unique_ptr test tweaks 2022-08-04 07:14:30 +01:00
William S Fulton 1b63af0f2c std::unique_ptr std::auto_ptr tidyup
Add docs on additional support
Additional testing for invalid usage for parameter inputs
2022-07-19 20:23:06 +01:00
William S Fulton 8bd9eb3f16 Java unique_ptr test ownership enhancement to test
Make sure the object is owned before releasing ownership
and passing ownership to unique_ptr instance.
2022-07-17 15:15:24 +01:00
William S Fulton 1bf15210ef Java unique_ptr enhance test for double release 2022-07-17 15:15:24 +01:00
William S Fulton 6b361bf050 Add Java support for std::unique<T> for input parameters.
This works by transferring ownership of the underlying C++ memory
from the target language proxy class to an instance of the unique_ptr
which is passed to the wrapped function via std::move.

The proxy class has a new swigRelease() method which sets the
underlying C++ pointer for the proxy class to null, so working
in much the same way as std::unique_ptr::release(). Any attempt at
using the proxy class will be the same as if the delete() function
has been called on the proxy class. That is, using a C++ null pointer,
when a non-null pointer is usually expected.

This commit relies on the previous commit that uses std::move
on the temporary variable used for the wrapped function's input parameter
as std::unique_ptr is not copyable, it has move-only semantics.
2022-07-17 15:15:24 +01:00
William S Fulton 299880e6a6 Add std::unique support
Simple copy of current auto_ptr support (just suppport for
functions returning std::unique_ptr).

Closes #1722
2022-07-02 16:17:18 +01:00