MappedObjectTransformer#register(Class).
Subclasses may only specify the default constructor. Any code
inside that constructor is optional, but will not run when the
view is instantiated, see runViewConstructor().
Bounds checking may be enabled through a JVM system property: org.lwjgl.util.mapped.Checks=true
| Modifier and Type | Field and Description |
|---|---|
| public long | baseAddress
The mapped object base memory address, in bytes. |
| pack-priv static final boolean | |
| pack-priv ByteBuffer | preventGC
The mapped buffer. |
| public static int | SIZEOF
Holds the value of sizeof of the sub-type of this MappedObject The behavior of this (transformed) method does not follow the normal Java behavior. |
| public int | view
The mapped object view offset, in elements. |
| public long | viewAddress
The mapped object view memory address, in bytes. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final <T extends MappedObject> T[] | |
| public final ByteBuffer | Returns: the backing bufferReturns the |
| public final int | Returns: the mapped object capacityReturns the number of mapped objects that fit in the mapped buffer. |
| pack-priv final void | |
| pack-priv final void | |
| public final <T extends MappedObject> void | copyRange(T target, int instances)
Copies and amount of |
| public final <T extends MappedObject> void | copyTo(T target)
Copies and amount of |
| public final <T extends MappedObject> T | dup()
Creates an identical new MappedObject instance, comparable to the
contract of |
| public static <T extends MappedObject> Iterable | |
| public static <T extends MappedObject> Iterable | |
| public final int | |
| public final int | |
| protected final long | |
| public static <T extends MappedObject> T | malloc(int elementCount)
Creates a MappedObject instance, mapping the memory region of an allocated direct ByteBuffer with a capacity of The behavior of this (transformed) method does not follow the normal Java behavior. |
| public static <T extends MappedObject> T | map(ByteBuffer bb)
Creates a MappedObject instance, mapping the memory region of the specified direct ByteBuffer. |
| public static <T extends MappedObject> T | map(long address, int capacity)
Creates a MappedObject instance, mapping the memory region specified. |
| public final void | |
| public final void | |
| public final void | |
| public final <T extends MappedObject> T | slice()
Creates a new MappedObject instance, with a base offset equal to
the offset of the current view, comparable to the contract of |
| baseAddress | back to summary |
|---|---|
| public long baseAddress The mapped object base memory address, in bytes. Read-only. | |
| CHECKS | back to summary |
|---|---|
| pack-priv static final boolean CHECKS | |
| preventGC | back to summary |
|---|---|
| pack-priv ByteBuffer preventGC The mapped buffer. | |
| SIZEOF | back to summary |
|---|---|
| public static int SIZEOF Holds the value of sizeof of the sub-type of this MappedObject | |
| view | back to summary |
|---|---|
| public int view The mapped object view offset, in elements. Read/write.
This is a virtual field, used as a convenient getter/setter for
| |
| viewAddress | back to summary |
|---|---|
| public long viewAddress The mapped object view memory address, in bytes. Read-only. | |
| MappedObject | back to summary |
|---|---|
| protected MappedObject() | |
| asArray | back to summary |
|---|---|
public final <T extends MappedObject> T[] asArray()
| |
| backingByteBuffer | back to summary |
|---|---|
| public final ByteBuffer backingByteBuffer() Returns the
| |
| capacity | back to summary |
|---|---|
| public final int capacity() Returns the number of mapped objects that fit in the mapped buffer.
| |
| checkAddress | back to summary |
|---|---|
| pack-priv final void checkAddress(final long address) | |
| checkRange | back to summary |
|---|---|
| pack-priv final void checkRange(final int bytes) | |
| copyRange | back to summary |
|---|---|
| public final <T extends MappedObject> void copyRange(T target, int instances) Copies and amount of
| |
| copyTo | back to summary |
|---|---|
| public final <T extends MappedObject> void copyTo(T target) Copies and amount of
| |
| dup | back to summary |
|---|---|
| public final <T extends MappedObject> T dup() Creates an identical new MappedObject instance, comparable to the
contract of | |
| foreach | back to summary |
|---|---|
| public static <T extends MappedObject> Iterable Creates an
For convenience you are encouraged to static-import this specific method:
| |
| foreach | back to summary |
|---|---|
| public static <T extends MappedObject> Iterable Creates an
For convenience you are encouraged to static-import this specific method:
| |
| getAlign | back to summary |
|---|---|
| public final int getAlign() Returns the mapped object memory alignment, in bytes.
| |
| getSizeof | back to summary |
|---|---|
| public final int getSizeof() Returns the mapped object memory sizeof, in bytes.
| |
| getViewAddress | back to summary |
|---|---|
| protected final long getViewAddress(final int view) | |
| malloc | back to summary |
|---|---|
| public static <T extends MappedObject> T malloc(int elementCount) Creates a MappedObject instance, mapping the memory region of an allocated direct ByteBuffer with a capacity of
The behavior of this (transformed) method does not follow the normal Java behavior.
| |
| map | back to summary |
|---|---|
| public static <T extends MappedObject> T map(ByteBuffer bb) Creates a MappedObject instance, mapping the memory region of the specified direct ByteBuffer.
The behavior of this (transformed) method does not follow the normal Java behavior.
| |
| map | back to summary |
|---|---|
| public static <T extends MappedObject> T map(long address, int capacity) Creates a MappedObject instance, mapping the memory region specified. This is useful for mapping arbitrary regions in memory, e.g. OpenCL CLMem objects, without creating a ByteBuffer first.
The behavior of this (transformed) method does not follow the normal Java behavior.
| |
| next | back to summary |
|---|---|
| public final void next() Moves the current view to the next element. | |
| runViewConstructor | back to summary |
|---|---|
| public final void runViewConstructor() Any code in the default constructor will not run automatically. This method can be used to execute that code on the current view. | |
| setViewAddress | back to summary |
|---|---|
| public final void setViewAddress(final long address) | |
| slice | back to summary |
|---|---|
| public final <T extends MappedObject> T slice() Creates a new MappedObject instance, with a base offset equal to
the offset of the current view, comparable to the contract of | |