Commit Graph

9 Commits

Author SHA1 Message Date
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