Package org.lwjgl.util.lmdb
Class MDBVal
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.lmdb.MDBVal
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class MDBVal extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceGeneric structure used for passing keys and data in and out of the database.Values returned from the database are valid only until a subsequent update operation, or the end of the transaction. Do not modify or free them, they commonly point into the database itself.
Key sizes must be between 1 and
env_get_maxkeysizeinclusive. The same applies to data sizes in databases with theDUPSORTflag. Other data items can in theory be from 0 to0xffffffffbytes long.Layout
struct MDB_val { size_tmv_size(); void *mv_data(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMDBVal.BufferAn array ofMDBValstructs.
-
Constructor Summary
Constructors Constructor Description MDBVal(java.nio.ByteBuffer container)Creates aMDBValinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static MDBValcalloc()Returns a newMDBValinstance allocated withmemCalloc.static MDBVal.Buffercalloc(int capacity)Returns a newMDBVal.Bufferinstance allocated withmemCalloc.static MDBVal.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newMDBVal.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static MDBValcalloc(org.lwjgl.system.MemoryStack stack)Returns a newMDBValinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static MDBValcallocStack()Deprecated.static MDBVal.BuffercallocStack(int capacity)Deprecated.static MDBVal.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static MDBValcallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.static MDBValcreate()Returns a newMDBValinstance allocated withBufferUtils.static MDBVal.Buffercreate(int capacity)Returns a newMDBVal.Bufferinstance allocated withBufferUtils.static MDBValcreate(long address)Returns a newMDBValinstance for the specified memory address.static MDBVal.Buffercreate(long address, int capacity)Create aMDBVal.Bufferinstance at the specified memory.static MDBValcreateSafe(long address)static MDBVal.BuffercreateSafe(long address, int capacity)static MDBValmalloc()Returns a newMDBValinstance allocated withmemAlloc.static MDBVal.Buffermalloc(int capacity)Returns a newMDBVal.Bufferinstance allocated withmemAlloc.static MDBVal.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newMDBVal.Bufferinstance allocated on the specifiedMemoryStack.static MDBValmalloc(org.lwjgl.system.MemoryStack stack)Returns a newMDBValinstance allocated on the specifiedMemoryStack.static MDBValmallocStack()Deprecated.static MDBVal.BuffermallocStack(int capacity)Deprecated.static MDBVal.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static MDBValmallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.java.nio.ByteBuffermv_data()Address of the data item.MDBValmv_data(java.nio.ByteBuffer value)Sets the address of the specifiedByteBufferto themv_data()field.longmv_size()Size of the data item.MDBValmv_size(long value)Sets the specified value to themv_size()field.static java.nio.ByteBuffernmv_data(long struct)Unsafe version ofmv_data.static voidnmv_data(long struct, java.nio.ByteBuffer value)Unsafe version ofmv_data.static longnmv_size(long struct)Unsafe version ofmv_size().static voidnmv_size(long struct, long value)Sets the specified value to themv_sizefield of the specifiedstruct.MDBValset(long mv_size, java.nio.ByteBuffer mv_data)Initializes this struct with the specified values.MDBValset(MDBVal src)Copies the specified struct data to this struct.intsizeof()
-
-
-
Constructor Detail
-
MDBVal
public MDBVal(java.nio.ByteBuffer container)
Creates aMDBValinstance 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
-
mv_size
public long mv_size()
Size of the data item.
-
mv_data
@Nullable public java.nio.ByteBuffer mv_data()
Address of the data item.
-
mv_data
public MDBVal mv_data(@Nullable java.nio.ByteBuffer value)
Sets the address of the specifiedByteBufferto themv_data()field.
-
set
public MDBVal set(long mv_size, @Nullable java.nio.ByteBuffer mv_data)
Initializes this struct with the specified values.
-
set
public MDBVal set(MDBVal src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static MDBVal malloc()
Returns a newMDBValinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static MDBVal calloc()
Returns a newMDBValinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static MDBVal create()
Returns a newMDBValinstance allocated withBufferUtils.
-
create
public static MDBVal create(long address)
Returns a newMDBValinstance for the specified memory address.
-
createSafe
@Nullable public static MDBVal createSafe(long address)
-
malloc
public static MDBVal.Buffer malloc(int capacity)
Returns a newMDBVal.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static MDBVal.Buffer calloc(int capacity)
Returns a newMDBVal.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static MDBVal.Buffer create(int capacity)
Returns a newMDBVal.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static MDBVal.Buffer create(long address, int capacity)
Create aMDBVal.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static MDBVal.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static MDBVal mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static MDBVal callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static MDBVal mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static MDBVal callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static MDBVal.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static MDBVal.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static MDBVal.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 MDBVal.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static MDBVal malloc(org.lwjgl.system.MemoryStack stack)
Returns a newMDBValinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static MDBVal calloc(org.lwjgl.system.MemoryStack stack)
Returns a newMDBValinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static MDBVal.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newMDBVal.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static MDBVal.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newMDBVal.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nmv_size
public static long nmv_size(long struct)
Unsafe version ofmv_size().
-
nmv_data
@Nullable public static java.nio.ByteBuffer nmv_data(long struct)
Unsafe version ofmv_data.
-
nmv_size
public static void nmv_size(long struct, long value)Sets the specified value to themv_sizefield of the specifiedstruct.
-
nmv_data
public static void nmv_data(long struct, @Nullable java.nio.ByteBuffer value)Unsafe version ofmv_data.
-
-