JavaCpp v0.3 Release Notes
Release Date: 2012-11-04 // over 11 years ago-
- Added
Pointer.withDeallocator(Pointer)
method to attach easily a customDeallocator
created out of astatic void deallocate(Pointer)
method in the subclass, including native ones such as@Namespace @Name("delete") static native void deallocate(Pointer)
- A name starting with "::", for example
@Name("::std::string")
or@Namespace("::std")
, now drops the remaining enclosing scope - Removed confusing
cast
value of@Adapter
instead relying on newString[]
value of@Cast
to order multiple casts - Renamed various variables in
Generator
to make the generated code more readable - Fixed memory corruption when using an adapter or
@ByRef
on a function that returns by value anstd::vector<>
orstd::string
(issue #26) - Added
Pointer.zero()
method that callsmemset(0)
on the range - For easier memory management, more than one
Pointer
now allowed to share thedeallocator
when "casting" them - Upgraded references of the Android NDK to version r8b
- Fixed
JavaCPP_log()
not printing correctly (issue #27) - Added functionality to access easily
FunctionPointer
callbacks by their names from C/C++: We can annotate them with@Name
and build with the new-header
option to get their declarations in a header file, while theBuilder
links with thejvm
library by default Loader
now displays an informative error message when trying to use an undefinedcompiler.options
with@Platform(options="")
(issue #24)Pointer.deallocator()
would needlessly enqueueDeallocator
objects pointing to the nativeNULL
address- Added support for C++ "functors" based on the
operator()
, which gets used when annotating aFunctionPointer
method parameter with@ByRef
or@ByVal
- For convenience in Scala, added
apply()
as an acceptable caller method name within aFunctionPointer
, in addition tocall()
- Fixed
@Cast
not working along parameters with an@Adapter
or when attempting toreturn
the argument Generator
would ignorePointer.position()
in the case of@ByPtrPtr
and@ByPtrRef
parameters- Replaced hack to create a
Pointer
from aBuffer
object with something more standard - Fixed
Loader.sizeof(Pointer.class)
to return thesizeof(void*)
- In addition to methods and parameters, we may now apply
@Adapter
to annotation types as well, allowing us to shorten expressions like@Adapter("VectorAdapter<int>") int[]
to just@StdVector int[]
, forstd::vector<int>
support, and similarly for@StdString
andstd::string
- Fixed callback parameter casting of primitive and
String
types - An empty
@Namespace
can now be used to letGenerator
know of entities that are not part of any scope, such as macros and operators - Turned
FunctionPointer
into anabstract class
withprotected
constructors, but if users still try to use it as function parameters,Generator
now logs a warning indicating that a subclass should be used (issue #23) - Removed the
out
value of the@Adapter
annotation: All adapters are now "out" by default, unless@Const
also appears on the same element - Fixed
Pointer.equals(null)
throwingNullPointerException
(issue #22) @NoOffset
would erroneously preventsizeof()
operations from getting generated
- Added