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 Deprecated Methods Modifier and Type Method Description NkPluginAllocalloc()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 NkAllocator.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkAllocator.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkAllocatorcalloc(org.lwjgl.system.MemoryStack stack)Returns a newNkAllocatorinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkAllocatorcallocStack()Deprecated.static NkAllocator.BuffercallocStack(int capacity)Deprecated.static NkAllocator.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static NkAllocatorcallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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 NkAllocator.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkAllocator.Bufferinstance allocated on the specifiedMemoryStack.static NkAllocatormalloc(org.lwjgl.system.MemoryStack stack)Returns a newNkAllocatorinstance allocated on the specifiedMemoryStack.static NkAllocatormallocStack()Deprecated.static NkAllocator.BuffermallocStack(int capacity)Deprecated.static NkAllocator.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static NkAllocatormallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.NkPluginFreemfree()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()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
-
alloc
@Nullable public NkPluginAlloc alloc()
- Returns:
- the value of the
allocfield.
-
mfree
@Nullable public NkPluginFree mfree()
- Returns:
- the value of the
mfreefield.
-
userdata
public NkAllocator userdata(NkHandle value)
Copies the specifiedNkHandleto theuserdatafield.
-
userdata
public NkAllocator userdata(java.util.function.Consumer<NkHandle> consumer)
Passes theuserdatafield to the specifiedConsumer.
-
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
@Deprecated public static NkAllocator mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static NkAllocator callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static NkAllocator mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static NkAllocator callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static NkAllocator.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static NkAllocator.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static NkAllocator.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static NkAllocator.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static NkAllocator malloc(org.lwjgl.system.MemoryStack stack)
Returns a newNkAllocatorinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static NkAllocator calloc(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
-
malloc
public static NkAllocator.Buffer malloc(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
-
calloc
public static NkAllocator.Buffer calloc(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.
-
-