Class 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();
         __s32 res();
         __u32 flags();
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  IOURingCQE.Buffer
      An array of IOURingCQE structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
      • Nested classes/interfaces inherited from class org.lwjgl.system.Struct

        org.lwjgl.system.Struct.StructValidation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int FLAGS
      RES
      The struct member offsets.
      static int SIZEOF
      The struct size in bytes.
      static int USER_DATA
      The struct member offsets.
      • Fields inherited from interface org.lwjgl.system.Pointer

        BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      IOURingCQE​(java.nio.ByteBuffer container)
      Creates a IOURingCQE instance at the current position of the specified ByteBuffer container.
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • USER_DATA, RES, FLAGS

        The struct member offsets.
    • Constructor Detail

      • IOURingCQE

        public IOURingCQE​(java.nio.ByteBuffer container)
        Creates a IOURingCQE instance at the current position of the specified ByteBuffer 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 class org.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, but io_uring-specific errors (e.g. flags or opcode invalid) are returned through this field.

        For read and write opcodes, the return values match errno values documented in the preadv2(2) and pwritev2(2) man pages, with res 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 the opcodes section for io_uring-specific opcodes.

      • user_data

        public IOURingCQE user_data​(long value)
        Sets the specified value to the user_data() field.
      • res

        public IOURingCQE res​(int value)
        Sets the specified value to the res() field.
      • flags

        public IOURingCQE flags​(int value)
        Sets the specified value to the flags() 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 new IOURingCQE instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static IOURingCQE calloc()
        Returns a new IOURingCQE instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static IOURingCQE create()
        Returns a new IOURingCQE instance allocated with BufferUtils.
      • create

        public static IOURingCQE create​(long address)
        Returns a new IOURingCQE instance for the specified memory address.
      • createSafe

        @Nullable
        public static IOURingCQE createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static IOURingCQE.Buffer malloc​(int capacity)
        Returns a new IOURingCQE.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static IOURingCQE.Buffer calloc​(int capacity)
        Returns a new IOURingCQE.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static IOURingCQE.Buffer create​(int capacity)
        Returns a new IOURingCQE.Buffer instance allocated with BufferUtils.
        Parameters:
        capacity - the buffer capacity
      • create

        public static IOURingCQE.Buffer create​(long address,
                                               int capacity)
        Create a IOURingCQE.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static IOURingCQE.Buffer createSafe​(long address,
                                                   int capacity)
        Like create, but returns null if address is NULL.
      • malloc

        public static IOURingCQE malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new IOURingCQE instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static IOURingCQE calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new IOURingCQE instance allocated on the specified MemoryStack 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 new IOURingCQE.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static IOURingCQE.Buffer calloc​(int capacity,
                                               org.lwjgl.system.MemoryStack stack)
        Returns a new IOURingCQE.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nuser_data

        public static long nuser_data​(long struct)
        Unsafe version of user_data().
      • nres

        public static int nres​(long struct)
        Unsafe version of res().
      • nflags

        public static int nflags​(long struct)
        Unsafe version of flags().
      • nuser_data

        public static void nuser_data​(long struct,
                                      long value)
        Unsafe version of user_data.
      • nres

        public static void nres​(long struct,
                                int value)
        Unsafe version of res.
      • nflags

        public static void nflags​(long struct,
                                  int value)
        Unsafe version of flags.