Class AIMetaDataEntry

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class AIMetaDataEntry extends Struct<AIMetaDataEntry> implements NativeResource

 struct aiMetadataEntry {
     aiMetadataType mType;
     void * mData;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int MTYPE
      The struct member offsets.
    • MDATA

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

    • AIMetaDataEntry

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

      public int mType()
      Returns:
      the value of the mType field.
    • mData

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

      public AIMetaDataEntry mType(int value)
      Sets the specified value to the mType field.
    • mData

      public AIMetaDataEntry mData(ByteBuffer value)
      Sets the address of the specified ByteBuffer to the mData field.
    • set

      public AIMetaDataEntry set(int mType, ByteBuffer mData)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static int nmType(long struct)
      Unsafe version of mType().
    • nmData

      public static ByteBuffer nmData(long struct, int capacity)
      Unsafe version of mData.
    • nmType

      public static void nmType(long struct, int value)
      Unsafe version of mType.
    • nmData

      public static void nmData(long struct, ByteBuffer value)
      Unsafe version of mData.
    • validate

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