Package org.lwjgl.system.jni
Class JNINativeMethod
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.system.jni.JNINativeMethod
-
- All Implemented Interfaces:
java.lang.AutoCloseable,NativeResource,Pointer
public class JNINativeMethod extends Struct implements NativeResource
Layout
struct JNINativeMethod { char * name; char * signature; void * fnPtr; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJNINativeMethod.BufferAn array ofJNINativeMethodstructs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intFNPTR
NAME
SIGNATUREThe struct member offsets.static intSIZEOFThe struct size in bytes.-
Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
-
Constructor Summary
Constructors Constructor Description JNINativeMethod(java.nio.ByteBuffer container)Creates aJNINativeMethodinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JNINativeMethodcalloc()Returns a newJNINativeMethodinstance allocated withmemCalloc.static JNINativeMethod.Buffercalloc(int capacity)Returns a newJNINativeMethod.Bufferinstance allocated withmemCalloc.static JNINativeMethodcallocStack()Returns a newJNINativeMethodinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static JNINativeMethod.BuffercallocStack(int capacity)Returns a newJNINativeMethod.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static JNINativeMethod.BuffercallocStack(int capacity, MemoryStack stack)Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static JNINativeMethodcallocStack(MemoryStack stack)Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static JNINativeMethodcreate()Returns a newJNINativeMethodinstance allocated withBufferUtils.static JNINativeMethod.Buffercreate(int capacity)Returns a newJNINativeMethod.Bufferinstance allocated withBufferUtils.static JNINativeMethodcreate(long address)Returns a newJNINativeMethodinstance for the specified memory address.static JNINativeMethod.Buffercreate(long address, int capacity)Create aJNINativeMethod.Bufferinstance at the specified memory.static JNINativeMethodcreateSafe(long address)static JNINativeMethod.BuffercreateSafe(long address, int capacity)longfnPtr()Returns the value of thefnPtrfield.JNINativeMethodfnPtr(long value)Sets the specified value to thefnPtrfield.static JNINativeMethodmalloc()Returns a newJNINativeMethodinstance allocated withmemAlloc.static JNINativeMethod.Buffermalloc(int capacity)Returns a newJNINativeMethod.Bufferinstance allocated withmemAlloc.static JNINativeMethodmallocStack()Returns a newJNINativeMethodinstance allocated on the thread-localMemoryStack.static JNINativeMethod.BuffermallocStack(int capacity)Returns a newJNINativeMethod.Bufferinstance allocated on the thread-localMemoryStack.static JNINativeMethod.BuffermallocStack(int capacity, MemoryStack stack)Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStack.static JNINativeMethodmallocStack(MemoryStack stack)Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStack.java.nio.ByteBuffername()Returns aByteBufferview of the null-terminated string pointed to by thenamefield.JNINativeMethodname(java.nio.ByteBuffer value)Sets the address of the specified encoded string to thenamefield.java.lang.StringnameString()Decodes the null-terminated string pointed to by thenamefield.static longnfnPtr(long struct)Unsafe version offnPtr().static voidnfnPtr(long struct, long value)Unsafe version offnPtr.static java.nio.ByteBuffernname(long struct)Unsafe version ofname().static voidnname(long struct, java.nio.ByteBuffer value)Unsafe version ofname.static java.lang.StringnnameString(long struct)Unsafe version ofnameString().static java.nio.ByteBuffernsignature(long struct)Unsafe version ofsignature().static voidnsignature(long struct, java.nio.ByteBuffer value)Unsafe version ofsignature.static java.lang.StringnsignatureString(long struct)Unsafe version ofsignatureString().JNINativeMethodset(java.nio.ByteBuffer name, java.nio.ByteBuffer signature, long fnPtr)Initializes this struct with the specified values.JNINativeMethodset(JNINativeMethod src)Copies the specified struct data to this struct.java.nio.ByteBuffersignature()Returns aByteBufferview of the null-terminated string pointed to by thesignaturefield.JNINativeMethodsignature(java.nio.ByteBuffer value)Sets the address of the specified encoded string to thesignaturefield.java.lang.StringsignatureString()Decodes the null-terminated string pointed to by thesignaturefield.intsizeof()Returnssizeof(struct).static voidvalidate(long struct)Validates pointer members that should not beNULL.static voidvalidate(long array, int count)Callsvalidate(long)for each struct contained in the specified struct array.-
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
-
-
-
Constructor Detail
-
JNINativeMethod
public JNINativeMethod(java.nio.ByteBuffer container)
Creates aJNINativeMethodinstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Detail
-
sizeof
public int sizeof()
Description copied from class:StructReturnssizeof(struct).
-
name
public java.nio.ByteBuffer name()
Returns aByteBufferview of the null-terminated string pointed to by thenamefield.
-
nameString
public java.lang.String nameString()
Decodes the null-terminated string pointed to by thenamefield.
-
signature
public java.nio.ByteBuffer signature()
Returns aByteBufferview of the null-terminated string pointed to by thesignaturefield.
-
signatureString
public java.lang.String signatureString()
Decodes the null-terminated string pointed to by thesignaturefield.
-
fnPtr
public long fnPtr()
Returns the value of thefnPtrfield.
-
name
public JNINativeMethod name(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thenamefield.
-
signature
public JNINativeMethod signature(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thesignaturefield.
-
fnPtr
public JNINativeMethod fnPtr(long value)
Sets the specified value to thefnPtrfield.
-
set
public JNINativeMethod set(java.nio.ByteBuffer name, java.nio.ByteBuffer signature, long fnPtr)
Initializes this struct with the specified values.
-
set
public JNINativeMethod set(JNINativeMethod src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static JNINativeMethod malloc()
Returns a newJNINativeMethodinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static JNINativeMethod calloc()
Returns a newJNINativeMethodinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static JNINativeMethod create()
Returns a newJNINativeMethodinstance allocated withBufferUtils.
-
create
public static JNINativeMethod create(long address)
Returns a newJNINativeMethodinstance for the specified memory address.
-
createSafe
@Nullable public static JNINativeMethod createSafe(long address)
-
malloc
public static JNINativeMethod.Buffer malloc(int capacity)
Returns a newJNINativeMethod.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static JNINativeMethod.Buffer calloc(int capacity)
Returns a newJNINativeMethod.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static JNINativeMethod.Buffer create(int capacity)
Returns a newJNINativeMethod.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static JNINativeMethod.Buffer create(long address, int capacity)
Create aJNINativeMethod.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static JNINativeMethod.Buffer createSafe(long address, int capacity)
-
mallocStack
public static JNINativeMethod mallocStack()
Returns a newJNINativeMethodinstance allocated on the thread-localMemoryStack.
-
callocStack
public static JNINativeMethod callocStack()
Returns a newJNINativeMethodinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static JNINativeMethod mallocStack(MemoryStack stack)
Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static JNINativeMethod callocStack(MemoryStack stack)
Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static JNINativeMethod.Buffer mallocStack(int capacity)
Returns a newJNINativeMethod.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static JNINativeMethod.Buffer callocStack(int capacity)
Returns a newJNINativeMethod.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static JNINativeMethod.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static JNINativeMethod.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nname
public static java.nio.ByteBuffer nname(long struct)
Unsafe version ofname().
-
nnameString
public static java.lang.String nnameString(long struct)
Unsafe version ofnameString().
-
nsignature
public static java.nio.ByteBuffer nsignature(long struct)
Unsafe version ofsignature().
-
nsignatureString
public static java.lang.String nsignatureString(long struct)
Unsafe version ofsignatureString().
-
nfnPtr
public static long nfnPtr(long struct)
Unsafe version offnPtr().
-
nname
public static void nname(long struct, java.nio.ByteBuffer value)Unsafe version ofname.
-
nsignature
public static void nsignature(long struct, java.nio.ByteBuffer value)Unsafe version ofsignature.
-
nfnPtr
public static void nfnPtr(long struct, long value)Unsafe version offnPtr.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
validate
public static void validate(long array, int count)Callsvalidate(long)for each struct contained in the specified struct array.- Parameters:
array- the struct array to validatecount- the number of structs inarray
-
-