- java.lang.Object
-
- de.ibapl.jnhw.common.memory.AbstractNativeMemory
-
- de.ibapl.jnhw.common.memory.OpaqueMemory64
-
- All Implemented Interfaces:
Native
- Direct Known Subclasses:
Memory64Heap
public abstract class OpaqueMemory64 extends AbstractNativeMemory implements Native
The base class for any chunk (i.e. pointer to or structs) of native memory. The run method in MemoryCleaner will clean up the allocated memory after finalizing this instance - if this instance owns the memory.- Author:
- aploese
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.ibapl.jnhw.common.memory.AbstractNativeMemory
AbstractNativeMemory.SetMem
-
-
Field Summary
Fields Modifier and Type Field Description longsizeInBytes-
Fields inherited from class de.ibapl.jnhw.common.memory.AbstractNativeMemory
baseAddress, CLEANER, LOG, MEM_ACCESS, MEM_ACCESS_PROPERTY, NULL, parent
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedOpaqueMemory64(NativeAddressHolder addressHolder, long sizeInBytes)Create a static memory slice which will NOT be freed - its static.protectedOpaqueMemory64(OpaqueMemory64 owner, long offset, long sizeInBytes, AbstractNativeMemory.SetMem setMem)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcheckIndex(OpaqueMemory64 mem, long offset, long length)static voidclear(OpaqueMemory64 mem)static voidcopy(byte[] src, int srcPos, OpaqueMemory64 dest, long destPos, int length)static voidcopy(OpaqueMemory64 src, long srcPos, byte[] dest, int destPos, int length)booleanequals(Object obj)static bytegetByte(OpaqueMemory64 mem, long index)protected longgetSizeInBytes()inthashCode()static voidmemset(OpaqueMemory64 mem, byte c)StringnativeToString()voidnativeToString(Appendable sb, String indentPrefix, String indent)static StringprintMemory(OpaqueMemory64 mem, boolean printAddress)static voidprintMemory(Appendable sb, OpaqueMemory64 mem, boolean printAddress)static voidsetByte(OpaqueMemory64 mem, long index, byte value)static byte[]toBytes(OpaqueMemory64 mem, long pos, int size)StringtoString()-
Methods inherited from class de.ibapl.jnhw.common.memory.AbstractNativeMemory
calcOffsetForAlignment, getOffset, getSizeInBytes, isSameAddress, offsetof, toNativeAddressHolder, toUintptr_t, toUintptr_tOrNULL
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.ibapl.jnhw.common.datatypes.Native
getBaseDataType, nativeToHexString
-
-
-
-
Constructor Detail
-
OpaqueMemory64
protected OpaqueMemory64(NativeAddressHolder addressHolder, long sizeInBytes)
Create a static memory slice which will NOT be freed - its static.- Parameters:
addressHolder- the base address.sizeInBytes- the size.
-
OpaqueMemory64
protected OpaqueMemory64(OpaqueMemory64 owner, long offset, long sizeInBytes, AbstractNativeMemory.SetMem setMem)
-
-
Method Detail
-
checkIndex
public static void checkIndex(OpaqueMemory64 mem, long offset, long length)
-
clear
public static void clear(OpaqueMemory64 mem)
-
copy
public static void copy(byte[] src, int srcPos, OpaqueMemory64 dest, long destPos, int length)
-
copy
public static void copy(OpaqueMemory64 src, long srcPos, byte[] dest, int destPos, int length)
-
memset
public static void memset(OpaqueMemory64 mem, byte c)
-
getByte
public static byte getByte(OpaqueMemory64 mem, long index)
-
setByte
public static void setByte(OpaqueMemory64 mem, long index, byte value)
-
toBytes
public static byte[] toBytes(OpaqueMemory64 mem, long pos, int size)
-
nativeToString
public void nativeToString(Appendable sb, String indentPrefix, String indent) throws IOException
- Specified by:
nativeToStringin interfaceNative- Throws:
IOException
-
nativeToString
public String nativeToString()
- Specified by:
nativeToStringin interfaceNative
-
printMemory
public static final String printMemory(OpaqueMemory64 mem, boolean printAddress)
-
printMemory
public static void printMemory(Appendable sb, OpaqueMemory64 mem, boolean printAddress) throws IOException
- Throws:
IOException
-
getSizeInBytes
protected final long getSizeInBytes()
- Specified by:
getSizeInBytesin classAbstractNativeMemory
-
-