Class AILogStream

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class AILogStream extends Struct<AILogStream> implements NativeResource

 struct aiLogStream {
     aiLogStreamCallback callback;
     char * user;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int CALLBACK
      The struct member offsets.
    • USER

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

    • AILogStream

      public AILogStream(ByteBuffer container)
      Creates a AILogStream 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<AILogStream>
    • callback

      public AILogStreamCallback callback()
      Returns:
      the value of the callback field.
    • user

      public @Nullable ByteBuffer user(int capacity)
      Returns:
      a ByteBuffer view of the data pointed to by the user field.
    • callback

      public AILogStream callback(AILogStreamCallbackI value)
      Sets the specified value to the callback field.
    • user

      public AILogStream user(@Nullable ByteBuffer value)
      Sets the address of the specified ByteBuffer to the user field.
    • set

      public AILogStream set(AILogStreamCallbackI callback, @Nullable ByteBuffer user)
      Initializes this struct with the specified values.
    • set

      public AILogStream set(AILogStream src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static AILogStream.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new AILogStream.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
    • ncallback

      public static AILogStreamCallback ncallback(long struct)
      Unsafe version of callback().
    • nuser

      public static @Nullable ByteBuffer nuser(long struct, int capacity)
      Unsafe version of user.
    • ncallback

      public static void ncallback(long struct, AILogStreamCallbackI value)
      Unsafe version of callback.
    • nuser

      public static void nuser(long struct, @Nullable ByteBuffer value)
      Unsafe version of user.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate