summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/nio
Commit message (Collapse)AuthorAgeFilesLines
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-035-177/+177
| | | | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Buffers: Split slice2Float(..) into dedicated methods for FloatBuffer and ↵Sven Gothel2014-06-271-32/+53
| | | | float[] backing-array - refine API doc w/ backing-array semantics
* Bug 1025 - GlueGen: Add accessor for compound fields of type array, pointer ↵Sven Gothel2014-06-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and string (code generation) Enhance compound access as delivered by Bug 1022, to also generate accessors (getter and setter) for array, pointer and string types. Allow configuration of array length either via their internal size (c-header) or config 'ReturnedArrayLength'. 'ReturnedArrayLength' allows specifying a java expression. Canonical field names of compounds are _now_ specified as follows for configuration entries: COMPOUND.FIELD e.g. StructA.fieldB Also allow configuration of pointer fields to be treated as referenced arrays via 'ReturnedArrayLength'. Further, allow specifying 'pointer fields' as String values via 'ReturnsString' configuration. ++++ Implementation details: - handle above described accessor features - enhance JavaDoc for generated accessors - generate native JNI compound and string accessor on demand - encapsule accessor code generation in their own methods - enhance exception messages - enhance type verbosity in debug mode - verbose debug output via GlueGen.debug() Tests: - Features covered by test1.[ch] and Test1p1JavaEmitter and Test1p2ProcAddressEmitter - Validated compilation and unit tests for modules: - joal - jogl (minor config changes req.) - jocl (minor config changes req.)
* gluegen: add all missing @Override annotationsHarvey Harrison2013-10-172-0/+18
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: remove trailing whitespaceHarvey Harrison2013-10-176-170/+170
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Buffers.java - spellingMatthew Gibson2013-08-261-12/+12
|
* Refine commit 5e01e993aeba4e95fc8aa6e75b3e295011e27bbb, skip ↵Sven Gothel2013-06-252-18/+22
| | | | Buffers.sizeOfBufferElem(..) call.
* AbstractBuffer: Generalize 'capacity' calculation, since we may encounter a ↵Sven Gothel2013-06-251-1/+1
| | | | byte-buffer w/ given elementSize semantics
* Buffers: getRemainingBytes(Object) -> remainingBytes(Object); ↵Sven Gothel2013-04-291-60/+60
| | | | | | | | | | | | sizeOfBufferElem(Buffer) -> sizeOfBufferElem(Object) to include NativeBuffer<?> Misc: - Add remainingElem(Object buffer). - Removed 'sizeOfBufferType(Class<?> bufferType)', since we don't use such calling convention w/ class type Note: remainingBytes(..) exist to allow using only one branch traversal to return the remaining size in bytes instead of 2, remaining(obj) and sizeOfBufferElem(obj). Note: The methods can take NativeBuffer<?> as an argument.
* Buffers: Add 'sizeOfBufferType(Class<?> bufferType)'Sven Gothel2013-04-271-1/+24
|
* Buffers: Expose 'getRemainingBytes(Object buffer)'Sven Gothel2013-04-272-6/+31
|
* gluegen: remove executable bit from java and c source filesHarvey Harrison2013-04-091-0/+0
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Modified Java 1.5 Buffers patch 2b7d1b1d25cb2cd73311ec9159b465f0391bf5e0 - ↵Sven Gothel2013-01-191-19/+27
| | | | | | | | | | | | | | May break GCJ/ECJ .. needs to be revised. - Adding JAVA_6 in PlatformPropsImpl - Buffers.isDirect() chooses fast-path iff JAVA_6, otherwise using reflection (GCJ/ECJ) - Adding JAVA_6 info in VersionUtil - API doc: Refine JAVA_SE and JAVA_6 spec. TODO: In case GCJ etc is unable to compile the JAVA_6 code even though it uses a static condition (probably not), We have to wrap isStatic in an own class, one for JAVA_6 and one for <= 1.5. This will be a good exercise for further issues we may have w/ Java <= 1.5.
* Merge remote-tracking branch 'xranby/gcj-gij'Sven Gothel2013-01-181-3/+17
|\
| * Buffer.isDirect() operation is undefined w/ Eclipse ecj and GCJ gij JRE.Xerxes Rånby2013-01-181-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix for the runtime error using GCJ gij JRE: java.lang.NoSuchMethodError: method java.nio.Buffer.isDirect with signature ()Z was not found. at com.jogamp.common.nio.Buffers.isDirect(Buffers.java:363) Also Eclipse ecj refuses to compile code using java.nio.Buffer.isDirect(). ---------- 1. ERROR ... return ((Buffer) buf).isDirect(); ^^^^^^^^ The method isDirect() is undefined for the type Buffer Signed-off-by: Xerxes Rånby <[email protected]>
* | Buffers: Fix typoSven Gothel2013-01-181-2/+2
|/
* Fix Bug625: StructAccessor missing setShortsAt() and getShortsAt() methods ↵Sven Gothel2012-12-301-0/+13
| | | | | | | | | | for short[] For short[] Java code gets emitted for an StructAccessor object that uses: void setShortsAt(int i, short[] shorts) short[] getShortsAt(int i, short[] shorts) Problem was that StructAccessor.java had no such methods - added.
* Fix Buffers.copy<Type>Buffer[asByteBuffer](..): Reset position of the passed ↵Sven Gothel2012-10-181-14/+15
| | | | | | | | | buffer (was missing). This is an API regression as introduced in commit 25cc744f6bd5ca97e0ae58fa7e1c35f7b0f3046d where JOGL's BufferUtil and GlueGen's were merged and API doc elaborated. The latter states the desired fact that the source passed buffer's position shall remain unchanged, however no code was added to take care of this detail.
* Buffers: Add normalized put methods, i.e. incl. value range conversion; New ↵Sven Gothel2012-10-171-2/+108
| | | | util. ValueConv for primitive type value conversion
* Buffers.toString(): Add optional format string for single elementSven Gothel2012-10-101-8/+39
|
* Buffers: Add convenient "public static StringBuilder toString(StringBuilder ↵Sven Gothel2012-10-101-1/+63
| | | | | | sb, Buffer buffer)" Sometimes we need to see details of a Buffer w/ it's content, e.g. for debugging purposes.
* Fix NPE in Buffers.slice2Float(), regression of commit ↵Sven Gothel2012-10-091-3/+12
| | | | 86e8c3a8d9f430700e07c485127130da68618e9d
* Buffers.slice2Float(): Reset position and limit of host bufferSven Gothel2012-10-091-22/+25
|
* Refine API doc of Buffers, fix API doc Platform.NEWLINE.Sven Gothel2012-10-031-0/+8
|
* Buffers: Add generic slice2Float(..) method from JOGL's ProjectFloat/FloatUtilSven Gothel2012-04-092-5/+46
|
* Minor edits: Fix API doc / Remove Thread.dumpStack()Sven Gothel2012-03-221-2/+1
|
* Add 'asset' URLConnection; IOUtil uses URLConnection / incr. effeciency; ↵Sven Gothel2012-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Android ClassLoaderUtil cleanup; - Add 'asset' URLConnection - Please read API doc 'PiggybackURLConnection' and 'AssetURLConnection' - Solves generic resource handling where platform locations may differ, ie ClassLoader lookup on Android in the 'assets/' subfolder. - New Android 'AssetDexClassLoader' uses 'assets/' folder for findResource(..) - aapt.signed (our APK ant task) - uses 'assets/' folder - adds the 'assetsdir' attribute allowing to copy other assets into the APK - IOUtil uses URLConnection / incr. effeciency - using URLConnection on all getResource(..) since URL is connected anyways for validation and URLConnection can be used by caller right away - String getRelativeOf(URL, String) -> URL getRelativeOf(URL, String) - preserves scheme, authority, etc - simple parentOf handling, more efficient - reusing new 'asset' protocol impl. - Android ClassLoaderUtil cleanup; - Use createClassLoader(..) impl for build-in static jogamp and user APKs, which removes code redundancy Tests: New code path, especially 'assets' are covered by new unit tests, no regressions on Linux.
* Fix NIO Buffers<T> .put<Type1>(<Type2>) - Add appropriate source -> ↵Sven Gothel2012-03-051-0/+25
| | | | destination handling (Float/Long/Double/..)
* Add some warning supression tagsSven Gothel2011-10-071-0/+5
|
* gluegen-rt lib loading: Moved to Platform static init incl. ↵Sven Gothel2011-09-222-6/+2
| | | | | | | | | | | | | | | | TempJarCache.bootstrapNativeLib(..) usage - Moving to Platform solves former interdependencies between GlueGenJNILibLoader/Platform - TempJarCache is being setup w/ bootstraping the gluegen-rt native lib jar file. Interesting here is that when using Oracle's JRE w/ Applets/JNLP the current dbg output is: gluegen-rt: url-root http://risa/deployment/test/jau02s/jar/ gluegen-rt: nativeJarURL jar:http://risa/deployment/test/jau02s/jar/gluegen-rt-natives-linux-amd64.jar!/ gluegen-rt: nativeJar /home/sven/.java/deployment/cache/6.0/49/3c6d1e31-2c90f42e IE the JRE implementation already deduces the online link to the Applet/JNLP cache. This makes the implementation much simpler, ie. same for application and Applets/JNLP. Have to verify w/ other Java impl. sure - and add same logic for the JOGL part.
* Unify JNI Library Loading into JNILibLoaderBase and use it for the ↵Sven Gothel2011-09-212-4/+4
| | | | | | | | gluegen-rt native lib as well - removed redundance - move proper JNLPAppletLauncher custom libloader code into JNILibLoaderBase - prepares for new JAR temp cache ..
* Remove redundant: NativeLibrary.ensureNativeLibLoaded()Sven Gothel2011-09-202-2/+4
|
* CachedBufferFactory: Cosmetic changes - comments, -1 -> 0Sven Gothel2011-08-091-2/+11
|
* GlueGen proper size / alignment of primitive and compound types usage [2/2] ↵Sven Gothel2011-07-211-6/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | - Fin MachineDesction == MD MD.StaticConfig: - enum for all supported static configs (ID -> MD) - verified at runtime: test runtime queried-MD versus static-MD, hard fail if not compatible (size/alignment) SizeThunk primitive sizes: - Add notion of fixed native size (eg. int64_t) and otherwise (eg. long) java struct 'wrappers' code generation: - single class using size/offset arrays of all MachineDescription configurations - at runtime the array idx is queried in static block - type aligment for not fixed-native-size types (SizeThunk, undef long/int) via StructAccessor junit test: - add float test - fix native code - add java (create, write) -> native (verify) test works (tested) on: linux 32/64 and windows 32/64
* minor refinementSven Gothel2011-07-201-30/+30
|
* FIX StructAccessor / JavaEmitter's struct-emitter: Using byte offsetsSven Gothel2011-07-201-132/+84
| | | | | | | | | | | | | | | | | | | | Problem: typedef struct { int8_t bits1; // +1 - 0 // +3 (p32) int32_t id; // +4 - 4 int8_t bits2; // +1 - 8 // +3 (p32) - int64_t long0; // +8 - 12 "longBuffer.get(<type-sized index>)" is invalid, but "byteBuffer.getLong(<byte index>)" must be done. The actual impl. doesn't matter, hence dropping the other nio type mappings is good. FIXES 32bit unit test, works well (static) on 32/64 bit (unix). TODO: Respect diff alignment for OS/ARCH either by offset tables for all, or runtime computing.
* PointerBuffer: Add duplicate() method (as req by JOCL)Sven Gothel2011-05-011-0/+19
|
* NativeBuffer/PointerBuffer API/Impl Change (remove explicit backup array, ↵Sven Gothel2011-04-276-298/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* refactoring in common.nio public api - removed Int64BufferMichael Bien2011-04-263-156/+2
| | | | | | - removed Int64Buffer since it is no longer needed for LongBuffer emulation Signed-off-by: Sven Gothel <[email protected]>
* Fix commentSven Gothel2011-02-221-2/+2
|
* - Buffers.slice() should maintain byteorder when sliceing ByteBuffersMichael Bien2011-02-221-31/+9
| | | - simplified isDirect() and getArray()
* - ensure slice uses the buffers original byteorder.Michael Bien2011-02-221-2/+2
| | | - create new buffers only if size > capacity not if >= capacity
* Merge remote branch 'mbien/master'Sven Gothel2011-02-141-0/+340
|\
| * added CachedBufferFactory + test.Michael Bien2011-02-131-0/+340
| | | | | | factory supports dynamic and static allocation schemes and has a synchronized and a unsynchronized implementation.
* | Fix: Buffers cstr back to protectedSven Gothel2011-02-131-1/+1
| |
* | Fix: Buffers back to non final ; Added missing JogAmp (c)Sven Gothel2011-02-134-1/+5
|/
* - generified com.jogamp.common.nio.Buffers.Michael Bien2011-02-131-37/+46
| | | | - class is now final (change it back on demand) - added concurrency warning to slice() method doc
* - removed CDC impl for com.jogamp.common.nioMichael Bien2011-02-0911-372/+83
| | | | - generified class hierarchy (casts no longer needed in client code) - @Override where needed and other minor changes
* Buffers float/double conversion: Add arg for given destination buffer; Add ↵Sven Gothel2010-11-191-7/+86
| | | | back conversion; Add unit test for arrays
* Enhance API doc .. package description etcSven Gothel2010-11-091-0/+9
|