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.NativeResource
Layout
struct nk_allocator {
nk_handle
userdata;nk_plugin_alloc
alloc;nk_plugin_free
mfree; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NkAllocator.Buffer
An array ofNkAllocator
structs.
-
Constructor Summary
Constructors Constructor Description NkAllocator(java.nio.ByteBuffer container)
Creates aNkAllocator
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NkPluginAlloc
alloc()
Returns the value of thealloc
field.NkAllocator
alloc(NkPluginAllocI value)
Sets the specified value to thealloc
field.static NkAllocator
calloc()
Returns a newNkAllocator
instance allocated withmemCalloc
.static NkAllocator.Buffer
calloc(int capacity)
Returns a newNkAllocator.Buffer
instance allocated withmemCalloc
.static NkAllocator
callocStack()
Returns a newNkAllocator
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkAllocator.Buffer
callocStack(int capacity)
Returns a newNkAllocator.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkAllocator.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkAllocator.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkAllocator
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkAllocator
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkAllocator
create()
Returns a newNkAllocator
instance allocated withBufferUtils
.static NkAllocator.Buffer
create(int capacity)
Returns a newNkAllocator.Buffer
instance allocated withBufferUtils
.static NkAllocator
create(long address)
Returns a newNkAllocator
instance for the specified memory address.static NkAllocator.Buffer
create(long address, int capacity)
Create aNkAllocator.Buffer
instance at the specified memory.static NkAllocator
createSafe(long address)
static NkAllocator.Buffer
createSafe(long address, int capacity)
static NkAllocator
malloc()
Returns a newNkAllocator
instance allocated withmemAlloc
.static NkAllocator.Buffer
malloc(int capacity)
Returns a newNkAllocator.Buffer
instance allocated withmemAlloc
.static NkAllocator
mallocStack()
Returns a newNkAllocator
instance allocated on the thread-localMemoryStack
.static NkAllocator.Buffer
mallocStack(int capacity)
Returns a newNkAllocator.Buffer
instance allocated on the thread-localMemoryStack
.static NkAllocator.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkAllocator.Buffer
instance allocated on the specifiedMemoryStack
.static NkAllocator
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkAllocator
instance allocated on the specifiedMemoryStack
.NkPluginFree
mfree()
Returns the value of themfree
field.NkAllocator
mfree(NkPluginFreeI value)
Sets the specified value to themfree
field.static NkPluginAlloc
nalloc(long struct)
Unsafe version ofalloc()
.static void
nalloc(long struct, NkPluginAllocI value)
Unsafe version ofalloc
.static NkPluginFree
nmfree(long struct)
Unsafe version ofmfree()
.static void
nmfree(long struct, NkPluginFreeI value)
Unsafe version ofmfree
.static NkHandle
nuserdata(long struct)
Unsafe version ofuserdata()
.static void
nuserdata(long struct, NkHandle value)
Unsafe version ofuserdata
.NkAllocator
set(NkAllocator src)
Copies the specified struct data to this struct.NkAllocator
set(NkHandle userdata, NkPluginAllocI alloc, NkPluginFreeI mfree)
Initializes this struct with the specified values.int
sizeof()
NkHandle
userdata()
Returns aNkHandle
view of theuserdata
field.NkAllocator
userdata(java.util.function.Consumer<NkHandle> consumer)
Passes theuserdata
field to the specifiedConsumer
.NkAllocator
userdata(NkHandle value)
Copies the specifiedNkHandle
to theuserdata
field.
-
-
-
Constructor Detail
-
NkAllocator
public NkAllocator(java.nio.ByteBuffer container)
Creates aNkAllocator
instance at the current position of the specifiedByteBuffer
container. 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:
sizeof
in classorg.lwjgl.system.Struct
-
alloc
@Nullable public NkPluginAlloc alloc()
Returns the value of thealloc
field.
-
mfree
@Nullable public NkPluginFree mfree()
Returns the value of themfree
field.
-
userdata
public NkAllocator userdata(NkHandle value)
Copies the specifiedNkHandle
to theuserdata
field.
-
userdata
public NkAllocator userdata(java.util.function.Consumer<NkHandle> consumer)
Passes theuserdata
field to the specifiedConsumer
.
-
alloc
public NkAllocator alloc(@Nullable NkPluginAllocI value)
Sets the specified value to thealloc
field.
-
mfree
public NkAllocator mfree(@Nullable NkPluginFreeI value)
Sets the specified value to themfree
field.
-
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 newNkAllocator
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static NkAllocator calloc()
Returns a newNkAllocator
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static NkAllocator create()
Returns a newNkAllocator
instance allocated withBufferUtils
.
-
create
public static NkAllocator create(long address)
Returns a newNkAllocator
instance for the specified memory address.
-
createSafe
@Nullable public static NkAllocator createSafe(long address)
-
malloc
public static NkAllocator.Buffer malloc(int capacity)
Returns a newNkAllocator.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static NkAllocator.Buffer calloc(int capacity)
Returns a newNkAllocator.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static NkAllocator.Buffer create(int capacity)
Returns a newNkAllocator.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static NkAllocator.Buffer create(long address, int capacity)
Create aNkAllocator.Buffer
instance 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 newNkAllocator
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static NkAllocator callocStack()
Returns a newNkAllocator
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static NkAllocator mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkAllocator
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NkAllocator callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkAllocator
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static NkAllocator.Buffer callocStack(int capacity)
Returns a newNkAllocator.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-
-