Package org.lwjgl.nuklear
Class NkAllocator
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nuklear.NkAllocator
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class NkAllocator extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceLayout
struct nk_allocator {nk_handleuserdata;nk_plugin_allocalloc;nk_plugin_freemfree; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNkAllocator.BufferAn array ofNkAllocatorstructs.
-
Constructor Summary
Constructors Constructor Description NkAllocator(java.nio.ByteBuffer container)Creates aNkAllocatorinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NkPluginAllocalloc()Returns the value of theallocfield.NkAllocatoralloc(NkPluginAllocI value)Sets the specified value to theallocfield.static NkAllocatorcalloc()Returns a newNkAllocatorinstance allocated withmemCalloc.static NkAllocator.Buffercalloc(int capacity)Returns a newNkAllocator.Bufferinstance allocated withmemCalloc.static NkAllocatorcallocStack()Returns a newNkAllocatorinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NkAllocator.BuffercallocStack(int capacity)Returns a newNkAllocator.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NkAllocator.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkAllocator.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkAllocatorcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNkAllocatorinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkAllocatorcreate()Returns a newNkAllocatorinstance allocated withBufferUtils.static NkAllocator.Buffercreate(int capacity)Returns a newNkAllocator.Bufferinstance allocated withBufferUtils.static NkAllocatorcreate(long address)Returns a newNkAllocatorinstance for the specified memory address.static NkAllocator.Buffercreate(long address, int capacity)Create aNkAllocator.Bufferinstance at the specified memory.static NkAllocatorcreateSafe(long address)static NkAllocator.BuffercreateSafe(long address, int capacity)static NkAllocatormalloc()Returns a newNkAllocatorinstance allocated withmemAlloc.static NkAllocator.Buffermalloc(int capacity)Returns a newNkAllocator.Bufferinstance allocated withmemAlloc.static NkAllocatormallocStack()Returns a newNkAllocatorinstance allocated on the thread-localMemoryStack.static NkAllocator.BuffermallocStack(int capacity)Returns a newNkAllocator.Bufferinstance allocated on the thread-localMemoryStack.static NkAllocator.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkAllocator.Bufferinstance allocated on the specifiedMemoryStack.static NkAllocatormallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNkAllocatorinstance allocated on the specifiedMemoryStack.NkPluginFreemfree()Returns the value of themfreefield.NkAllocatormfree(NkPluginFreeI value)Sets the specified value to themfreefield.static NkPluginAllocnalloc(long struct)Unsafe version ofalloc().static voidnalloc(long struct, NkPluginAllocI value)Unsafe version ofalloc.static NkPluginFreenmfree(long struct)Unsafe version ofmfree().static voidnmfree(long struct, NkPluginFreeI value)Unsafe version ofmfree.static NkHandlenuserdata(long struct)Unsafe version ofuserdata().static voidnuserdata(long struct, NkHandle value)Unsafe version ofuserdata.NkAllocatorset(NkAllocator src)Copies the specified struct data to this struct.NkAllocatorset(NkHandle userdata, NkPluginAllocI alloc, NkPluginFreeI mfree)Initializes this struct with the specified values.intsizeof()NkHandleuserdata()Returns aNkHandleview of theuserdatafield.NkAllocatoruserdata(java.util.function.Consumer<NkHandle> consumer)Passes theuserdatafield to the specifiedConsumer.NkAllocatoruserdata(NkHandle value)Copies the specifiedNkHandleto theuserdatafield.
-
-
-
Constructor Detail
-
NkAllocator
public NkAllocator(java.nio.ByteBuffer container)
Creates aNkAllocatorinstance 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()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
userdata
public NkAllocator userdata(java.util.function.Consumer<NkHandle> consumer)
Passes theuserdatafield to the specifiedConsumer.
-
alloc
@Nullable public NkPluginAlloc alloc()
Returns the value of theallocfield.
-
mfree
@Nullable public NkPluginFree mfree()
Returns the value of themfreefield.
-
userdata
public NkAllocator userdata(NkHandle value)
Copies the specifiedNkHandleto theuserdatafield.
-
alloc
public NkAllocator alloc(@Nullable NkPluginAllocI value)
Sets the specified value to theallocfield.
-
mfree
public NkAllocator mfree(@Nullable NkPluginFreeI value)
Sets the specified value to themfreefield.
-
set
public NkAllocator set(NkHandle userdata, NkPluginAllocI alloc, NkPluginFreeI mfree)
Initializes this struct with the specified values.
-
set
public NkAllocator set(NkAllocator src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static NkAllocator malloc()
Returns a newNkAllocatorinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static NkAllocator calloc()
Returns a newNkAllocatorinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static NkAllocator create()
Returns a newNkAllocatorinstance allocated withBufferUtils.
-
create
public static NkAllocator create(long address)
Returns a newNkAllocatorinstance for the specified memory address.
-
createSafe
@Nullable public static NkAllocator createSafe(long address)
-
malloc
public static NkAllocator.Buffer malloc(int capacity)
Returns a newNkAllocator.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static NkAllocator.Buffer calloc(int capacity)
Returns a newNkAllocator.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static NkAllocator.Buffer create(int capacity)
Returns a newNkAllocator.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static NkAllocator.Buffer create(long address, int capacity)
Create aNkAllocator.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static NkAllocator.Buffer createSafe(long address, int capacity)
-
mallocStack
public static NkAllocator mallocStack()
Returns a newNkAllocatorinstance allocated on the thread-localMemoryStack.
-
callocStack
public static NkAllocator callocStack()
Returns a newNkAllocatorinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static NkAllocator mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkAllocatorinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static NkAllocator callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkAllocatorinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static NkAllocator.Buffer mallocStack(int capacity)
Returns a newNkAllocator.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static NkAllocator.Buffer callocStack(int capacity)
Returns a newNkAllocator.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static NkAllocator.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkAllocator.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static NkAllocator.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkAllocator.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nuserdata
public static NkHandle nuserdata(long struct)
Unsafe version ofuserdata().
-
nalloc
@Nullable public static NkPluginAlloc nalloc(long struct)
Unsafe version ofalloc().
-
nmfree
@Nullable public static NkPluginFree nmfree(long struct)
Unsafe version ofmfree().
-
nalloc
public static void nalloc(long struct, @Nullable NkPluginAllocI value)Unsafe version ofalloc.
-
nmfree
public static void nmfree(long struct, @Nullable NkPluginFreeI value)Unsafe version ofmfree.
-
-