Package org.lwjgl.system.linux.liburing
Class IOURingCQE
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.system.linux.liburing.IOURingCQE
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class IOURingCQE extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceIO completion data structure (Completion Queue Entry).Layout
struct io_uring_cqe { __u64user_data(); __s32res(); __u32flags(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIOURingCQE.BufferAn array ofIOURingCQEstructs.
-
Constructor Summary
Constructors Constructor Description IOURingCQE(java.nio.ByteBuffer container)Creates aIOURingCQEinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IOURingCQEcalloc()Returns a newIOURingCQEinstance allocated withmemCalloc.static IOURingCQE.Buffercalloc(int capacity)Returns a newIOURingCQE.Bufferinstance allocated withmemCalloc.static IOURingCQE.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newIOURingCQE.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static IOURingCQEcalloc(org.lwjgl.system.MemoryStack stack)Returns a newIOURingCQEinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static IOURingCQEcreate()Returns a newIOURingCQEinstance allocated withBufferUtils.static IOURingCQE.Buffercreate(int capacity)Returns a newIOURingCQE.Bufferinstance allocated withBufferUtils.static IOURingCQEcreate(long address)Returns a newIOURingCQEinstance for the specified memory address.static IOURingCQE.Buffercreate(long address, int capacity)Create aIOURingCQE.Bufferinstance at the specified memory.static IOURingCQEcreateSafe(long address)static IOURingCQE.BuffercreateSafe(long address, int capacity)intflags()is used for certain commands, likeOP_POLL_ADDor in conjunction withLibIOURing.IOSQE_BUFFER_SELECT, see those entriesIOURingCQEflags(int value)Sets the specified value to theflags()field.static IOURingCQEmalloc()Returns a newIOURingCQEinstance allocated withmemAlloc.static IOURingCQE.Buffermalloc(int capacity)Returns a newIOURingCQE.Bufferinstance allocated withmemAlloc.static IOURingCQE.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newIOURingCQE.Bufferinstance allocated on the specifiedMemoryStack.static IOURingCQEmalloc(org.lwjgl.system.MemoryStack stack)Returns a newIOURingCQEinstance allocated on the specifiedMemoryStack.static intnflags(long struct)Unsafe version offlags().static voidnflags(long struct, int value)Unsafe version offlags.static intnres(long struct)Unsafe version ofres().static voidnres(long struct, int value)Unsafe version ofres.static longnuser_data(long struct)Unsafe version ofuser_data().static voidnuser_data(long struct, long value)Unsafe version ofuser_data.intres()is the operation-specific result, butio_uring-specific errors (e.g.IOURingCQEres(int value)Sets the specified value to theres()field.IOURingCQEset(long user_data, int res, int flags)Initializes this struct with the specified values.IOURingCQEset(IOURingCQE src)Copies the specified struct data to this struct.intsizeof()longuser_data()is copied from the field of the same name in the submission queue entry.IOURingCQEuser_data(long value)Sets the specified value to theuser_data()field.
-
-
-
Constructor Detail
-
IOURingCQE
public IOURingCQE(java.nio.ByteBuffer container)
Creates aIOURingCQEinstance 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
-
user_data
public long user_data()
is copied from the field of the same name in the submission queue entry.The primary use case is to store data that the application will need to access upon completion of this particular I/O.
-
res
public int res()
is the operation-specific result, butio_uring-specific errors (e.g.flagsoropcodeinvalid) are returned through this field.For read and write
opcodes, the return values matcherrnovalues documented in thepreadv2(2)andpwritev2(2)man pages, withresholding the equivalent of-errnofor error cases, or the transferred number of bytes in case the operation is successful. Hence both error and success return can be found in that field in the CQE. For other request types, the return values are documented in the matching man page for that type, or in theopcodessection forio_uring-specificopcodes.
-
flags
public int flags()
is used for certain commands, likeOP_POLL_ADDor in conjunction withLibIOURing.IOSQE_BUFFER_SELECT, see those entries
-
user_data
public IOURingCQE user_data(long value)
Sets the specified value to theuser_data()field.
-
res
public IOURingCQE res(int value)
Sets the specified value to theres()field.
-
flags
public IOURingCQE flags(int value)
Sets the specified value to theflags()field.
-
set
public IOURingCQE set(long user_data, int res, int flags)
Initializes this struct with the specified values.
-
set
public IOURingCQE set(IOURingCQE src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static IOURingCQE malloc()
Returns a newIOURingCQEinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static IOURingCQE calloc()
Returns a newIOURingCQEinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static IOURingCQE create()
Returns a newIOURingCQEinstance allocated withBufferUtils.
-
create
public static IOURingCQE create(long address)
Returns a newIOURingCQEinstance for the specified memory address.
-
createSafe
@Nullable public static IOURingCQE createSafe(long address)
-
malloc
public static IOURingCQE.Buffer malloc(int capacity)
Returns a newIOURingCQE.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static IOURingCQE.Buffer calloc(int capacity)
Returns a newIOURingCQE.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static IOURingCQE.Buffer create(int capacity)
Returns a newIOURingCQE.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static IOURingCQE.Buffer create(long address, int capacity)
Create aIOURingCQE.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static IOURingCQE.Buffer createSafe(long address, int capacity)
-
malloc
public static IOURingCQE malloc(org.lwjgl.system.MemoryStack stack)
Returns a newIOURingCQEinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static IOURingCQE calloc(org.lwjgl.system.MemoryStack stack)
Returns a newIOURingCQEinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static IOURingCQE.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newIOURingCQE.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static IOURingCQE.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newIOURingCQE.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nuser_data
public static long nuser_data(long struct)
Unsafe version ofuser_data().
-
nres
public static int nres(long struct)
Unsafe version ofres().
-
nflags
public static int nflags(long struct)
Unsafe version offlags().
-
nuser_data
public static void nuser_data(long struct, long value)Unsafe version ofuser_data.
-
nres
public static void nres(long struct, int value)Unsafe version ofres.
-
nflags
public static void nflags(long struct, int value)Unsafe version offlags.
-
-