Class AIMetaData

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class AIMetaData extends Struct<AIMetaData> implements NativeResource

 struct aiMetadata {
     unsigned int mNumProperties;
     struct aiString * mKeys;
     struct aiMetadataEntry * mValues;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int MNUMPROPERTIES
      The struct member offsets.
    • MKEYS

      public static final int MKEYS
      The struct member offsets.
    • MVALUES

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

    • AIMetaData

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

      public int mNumProperties()
      Returns:
      the value of the mNumProperties field.
    • mKeys

      public AIString.Buffer mKeys()
      Returns:
      a AIString.Buffer view of the struct array pointed to by the mKeys field.
    • mValues

      public AIMetaDataEntry.Buffer mValues()
      Returns:
      a AIMetaDataEntry.Buffer view of the struct array pointed to by the mValues field.
    • mNumProperties

      public AIMetaData mNumProperties(int value)
      Sets the specified value to the mNumProperties field.
    • mKeys

      public AIMetaData mKeys(AIString.Buffer value)
      Sets the address of the specified AIString.Buffer to the mKeys field.
    • mValues

      public AIMetaData mValues(AIMetaDataEntry.Buffer value)
      Sets the address of the specified AIMetaDataEntry.Buffer to the mValues field.
    • set

      public AIMetaData set(int mNumProperties, AIString.Buffer mKeys, AIMetaDataEntry.Buffer mValues)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static int nmNumProperties(long struct)
      Unsafe version of mNumProperties().
    • nmKeys

      public static AIString.Buffer nmKeys(long struct)
      Unsafe version of mKeys().
    • nmValues

      public static AIMetaDataEntry.Buffer nmValues(long struct)
      Unsafe version of mValues().
    • nmNumProperties

      public static void nmNumProperties(long struct, int value)
      Sets the specified value to the mNumProperties field of the specified struct.
    • nmKeys

      public static void nmKeys(long struct, AIString.Buffer value)
      Unsafe version of mKeys.
    • nmValues

      public static void nmValues(long struct, AIMetaDataEntry.Buffer value)
      Unsafe version of mValues.
    • validate

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