Package org.lwjgl.sdl

Class SDL_AsyncIOOutcome

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SDL_AsyncIOOutcome extends Struct<SDL_AsyncIOOutcome> implements NativeResource

 struct SDL_AsyncIOOutcome {
     SDL_AsyncIO * asyncio;
     SDL_AsyncIOTaskType type;
     SDL_AsyncIOResult result;
     void * buffer;
     Uint64 offset;
     Uint64 bytes_requested;
     Uint64 bytes_transferred;
     void * userdata;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • ASYNCIO

      public static final int ASYNCIO
      The struct member offsets.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • RESULT

      public static final int RESULT
      The struct member offsets.
    • BUFFER

      public static final int BUFFER
      The struct member offsets.
    • OFFSET

      public static final int OFFSET
      The struct member offsets.
    • BYTES_REQUESTED

      public static final int BYTES_REQUESTED
      The struct member offsets.
    • BYTES_TRANSFERRED

      public static final int BYTES_TRANSFERRED
      The struct member offsets.
    • USERDATA

      public static final int USERDATA
      The struct member offsets.
  • Constructor Details

    • SDL_AsyncIOOutcome

      public SDL_AsyncIOOutcome(ByteBuffer container)
      Creates a SDL_AsyncIOOutcome 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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<SDL_AsyncIOOutcome>
    • asyncio

      public long asyncio()
      Returns:
      the value of the asyncio field.
    • type

      public int type()
      Returns:
      the value of the type field.
    • result

      public int result()
      Returns:
      the value of the result field.
    • buffer

      public ByteBuffer buffer(int capacity)
      Returns:
      a ByteBuffer view of the data pointed to by the buffer field.
    • offset

      public long offset()
      Returns:
      the value of the offset field.
    • bytes_requested

      public long bytes_requested()
      Returns:
      the value of the bytes_requested field.
    • bytes_transferred

      public long bytes_transferred()
      Returns:
      the value of the bytes_transferred field.
    • userdata

      public long userdata()
      Returns:
      the value of the userdata field.
    • malloc

      public static SDL_AsyncIOOutcome malloc()
      Returns a new SDL_AsyncIOOutcome instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

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

      public static SDL_AsyncIOOutcome calloc(MemoryStack stack)
      Returns a new SDL_AsyncIOOutcome instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static SDL_AsyncIOOutcome.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new SDL_AsyncIOOutcome.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

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

      public static long nasyncio(long struct)
      Unsafe version of asyncio().
    • ntype

      public static int ntype(long struct)
      Unsafe version of type().
    • nresult

      public static int nresult(long struct)
      Unsafe version of result().
    • nbuffer

      public static ByteBuffer nbuffer(long struct, int capacity)
      Unsafe version of buffer.
    • noffset

      public static long noffset(long struct)
      Unsafe version of offset().
    • nbytes_requested

      public static long nbytes_requested(long struct)
      Unsafe version of bytes_requested().
    • nbytes_transferred

      public static long nbytes_transferred(long struct)
      Unsafe version of bytes_transferred().
    • nuserdata

      public static long nuserdata(long struct)
      Unsafe version of userdata().