aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/nio/NativeBuffer.java
Commit message (Collapse)AuthorAgeFilesLines
* NIO NativeBuffer, {Element,Pointer}Buffer: Add limit, clear and flip; ↵Sven Gothel2023-06-231-3/+25
| | | | | | | | Arrange wrap/deref arguments equal; Add equal set of absolute get/set methods Completing API to simplify usage by generated code. All absolute get/set method check arguments itself and against limit(), allow to drop checks in generated code (size).
* GlueGen Struct [1]: Enhance com.jogamp.common.nio.* to serve a most ↵Sven Gothel2023-06-161-10/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | native-free-code Struct-Code generation Recfactored all NIO buffer utils to Buffers, i.e. buffer <-> address, memcpy, strnlen, etc Buffers: - Added copyNativeToDirectByteBuffer(..), allowing to copy a native memory slice into a direct buffer. - Added typeNameToBufferClass(String) and sizeOfBufferElem(Class<? extends Buffer>) - Completed slize2<Type>(..) buffer-mapping methods - Exposure of safe getDirectByteBuffer(..) w/ null-check (package private) Added NativeBuffer.storeDirectAddress(..), allowing to write the array address into a native buffer (struct, etc), allowing to referencing the ElementBuffer (linear array of elements) and PointerBuffer (array of pointer). Hint: This can be read via PointerBuffer.wrap(..).get(0) Added ElementBuffer (a NativeBuffer) mapping an array of elements, completing native abstraction next to PointerBuffer (array of pointer). ElementBuffer can dereference an existing element-array by native address via ElementBuffer.derefPointer(..). Views of its content can be directly accessed via ElementBuffer.slice(..). +++ These utilities and buffer abstractions will allow to reuse code and simplify the GlueGen struct get/set implementations and help to reduce native code injection.
* gluegen: remove trailing whitespaceHarvey Harrison2013-10-171-8/+8
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Buffers: Expose 'getRemainingBytes(Object buffer)'Sven Gothel2013-04-271-0/+1
|
* Buffers: Add generic slice2Float(..) method from JOGL's ProjectFloat/FloatUtilSven Gothel2012-04-091-1/+0
|
* NativeBuffer/PointerBuffer API/Impl Change (remove explicit backup array, ↵Sven Gothel2011-04-271-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | alloc referenced data map if used only) This patch doesn't impact GlueGen's code generation, but enhance and fix PointerBuffer usage only. remove explicit backup array As suggested by Michael Bien with a proposed patch, PointerBuffer's backup array is not only redundant in case it's not used, but also erroneous - due to possible sliced buffers. Removes the explicit backup array implementation leaving it up to the user, ie how PointerBuffer is created (alloc/allocDirect) and use the underlying nio's buffer backup array, if available. This also fixes the (never tested) case of indirect w/ backup array usage on 32bit platform size. In this case the array shall be of type int[], holding 32bit pointer - on 64bit long[]. Previous to this patch, it was always long[]. Added more thorough tests of PointerBuffer, notably indirect w/ backup array and native deep copy and filling of a pointer array. alloc referenced data map if used only As suggested by Michael Bien with a proposed patch, the allocation of the dataMap hash map is redundant in case it's not used. The hash map will be initialized lazy, if needed only.
* - removed CDC impl for com.jogamp.common.nioMichael Bien2011-02-091-6/+2
| | | | - generified class hierarchy (casts no longer needed in client code) - @Override where needed and other minor changes
* LICENSE.txt changes:Sven Gothel2010-09-141-0/+28
| | | | | | | | | | | | | - Added JogAmp Community and common denominator: New BSD 3-clause license - Added note to make/lib binary file (source and license) Added source and license text for external binaries used in build process (make/lib folder). Changed 'Sven Gothel' and 'Michael Bien' New BSD 3-clause license to 'JogAmp Community' Simplified BSD 2-clause license.
* Merged with latest of mbienSven Gothel2010-03-311-13/+20
|
* introduced com.jogamp.common.{nio,os} packages and moved some classes.Michael Bien2010-03-311-0/+47