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.NativeResource
IO completion data structure (Completion Queue Entry).Layout
struct io_uring_cqe { __u64
user_data()
; __s32res()
; __u32flags()
; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IOURingCQE.Buffer
An array ofIOURingCQE
structs.
-
Constructor Summary
Constructors Constructor Description IOURingCQE(java.nio.ByteBuffer container)
Creates aIOURingCQE
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IOURingCQE
calloc()
Returns a newIOURingCQE
instance allocated withmemCalloc
.static IOURingCQE.Buffer
calloc(int capacity)
Returns a newIOURingCQE.Buffer
instance allocated withmemCalloc
.static IOURingCQE.Buffer
calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newIOURingCQE.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static IOURingCQE
calloc(org.lwjgl.system.MemoryStack stack)
Returns a newIOURingCQE
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static IOURingCQE
create()
Returns a newIOURingCQE
instance allocated withBufferUtils
.static IOURingCQE.Buffer
create(int capacity)
Returns a newIOURingCQE.Buffer
instance allocated withBufferUtils
.static IOURingCQE
create(long address)
Returns a newIOURingCQE
instance for the specified memory address.static IOURingCQE.Buffer
create(long address, int capacity)
Create aIOURingCQE.Buffer
instance at the specified memory.static IOURingCQE
createSafe(long address)
static IOURingCQE.Buffer
createSafe(long address, int capacity)
int
flags()
is used for certain commands, likeOP_POLL_ADD
or in conjunction withLibIOURing.IOSQE_BUFFER_SELECT
, see those entriesIOURingCQE
flags(int value)
Sets the specified value to theflags()
field.static IOURingCQE
malloc()
Returns a newIOURingCQE
instance allocated withmemAlloc
.static IOURingCQE.Buffer
malloc(int capacity)
Returns a newIOURingCQE.Buffer
instance allocated withmemAlloc
.static IOURingCQE.Buffer
malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newIOURingCQE.Buffer
instance allocated on the specifiedMemoryStack
.static IOURingCQE
malloc(org.lwjgl.system.MemoryStack stack)
Returns a newIOURingCQE
instance allocated on the specifiedMemoryStack
.static int
nflags(long struct)
Unsafe version offlags()
.static void
nflags(long struct, int value)
Unsafe version offlags
.static int
nres(long struct)
Unsafe version ofres()
.static void
nres(long struct, int value)
Unsafe version ofres
.static long
nuser_data(long struct)
Unsafe version ofuser_data()
.static void
nuser_data(long struct, long value)
Unsafe version ofuser_data
.int
res()
is the operation-specific result, butio_uring
-specific errors (e.g.IOURingCQE
res(int value)
Sets the specified value to theres()
field.IOURingCQE
set(long user_data, int res, int flags)
Initializes this struct with the specified values.IOURingCQE
set(IOURingCQE src)
Copies the specified struct data to this struct.int
sizeof()
long
user_data()
is copied from the field of the same name in the submission queue entry.IOURingCQE
user_data(long value)
Sets the specified value to theuser_data()
field.
-
-
-
Constructor Detail
-
IOURingCQE
public IOURingCQE(java.nio.ByteBuffer container)
Creates aIOURingCQE
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
-
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.flags
oropcode
invalid) are returned through this field.For read and write
opcodes
, the return values matcherrno
values documented in thepreadv2(2)
andpwritev2(2)
man pages, withres
holding the equivalent of-errno
for 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 theopcodes
section forio_uring
-specificopcodes
.
-
flags
public int flags()
is used for certain commands, likeOP_POLL_ADD
or 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 newIOURingCQE
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static IOURingCQE calloc()
Returns a newIOURingCQE
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static IOURingCQE create()
Returns a newIOURingCQE
instance allocated withBufferUtils
.
-
create
public static IOURingCQE create(long address)
Returns a newIOURingCQE
instance for the specified memory address.
-
createSafe
@Nullable public static IOURingCQE createSafe(long address)
-
malloc
public static IOURingCQE.Buffer malloc(int capacity)
Returns a newIOURingCQE.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static IOURingCQE.Buffer calloc(int capacity)
Returns a newIOURingCQE.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static IOURingCQE.Buffer create(int capacity)
Returns a newIOURingCQE.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static IOURingCQE.Buffer create(long address, int capacity)
Create aIOURingCQE.Buffer
instance 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 newIOURingCQE
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
public static IOURingCQE calloc(org.lwjgl.system.MemoryStack stack)
Returns a newIOURingCQE
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-
-