Class ExrDataSink

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class ExrDataSink extends Struct<ExrDataSink> implements NativeResource
struct ExrDataSink {
    void * userdata;
    ExrWriteCallback write;
    ExrFetchCancel cancel;
    uint32_t flags;
}
  • Field Details

    • SIZEOF

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

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

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

      public static final int WRITE
      The struct member offsets.
    • CANCEL

      public static final int CANCEL
      The struct member offsets.
    • FLAGS

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

    • ExrDataSink

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

      @NativeType("void *") public long userdata()
      Returns:
      the value of the userdata field.
    • write

      public ExrWriteCallback write()
      Returns:
      the value of the write field.
    • cancel

      public @Nullable ExrFetchCancel cancel()
      Returns:
      the value of the cancel field.
    • flags

      @NativeType("uint32_t") public int flags()
      Returns:
      the value of the flags field.
    • userdata

      public ExrDataSink userdata(@NativeType("void *") long value)
      Sets the specified value to the userdata field.
    • write

      public ExrDataSink write(@NativeType("ExrWriteCallback") ExrWriteCallbackI value)
      Sets the specified value to the write field.
    • cancel

      public ExrDataSink cancel(@NativeType("ExrFetchCancel") @Nullable ExrFetchCancelI value)
      Sets the specified value to the cancel field.
    • flags

      public ExrDataSink flags(@NativeType("uint32_t") int value)
      Sets the specified value to the flags field.
    • set

      public ExrDataSink set(long userdata, ExrWriteCallbackI write, ExrFetchCancelI cancel, int flags)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static ExrWriteCallback nwrite(long struct)
      Unsafe version of write().
    • ncancel

      public static @Nullable ExrFetchCancel ncancel(long struct)
      Unsafe version of cancel().
    • nflags

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

      public static void nuserdata(long struct, long value)
      Unsafe version of userdata.
    • nwrite

      public static void nwrite(long struct, ExrWriteCallbackI value)
      Unsafe version of write.
    • ncancel

      public static void ncancel(long struct, @Nullable ExrFetchCancelI value)
      Unsafe version of cancel.
    • nflags

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

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