Class AIMetaData

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class AIMetaData
    extends Struct
    implements NativeResource

    Member documentation

    • mNumProperties – Length of the mKeys and mValues arrays, respectively
    • mKeys – Arrays of keys, may not be NULL. Entries in this array may not be NULL as well.
    • mValues – Arrays of values, may not be NULL. Entries in this array may be NULL if the corresponding property key has no assigned value.

    Layout

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

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • MNUMPROPERTIES, MKEYS, MVALUES

        The struct member offsets.
    • Constructor Detail

      • AIMetaData

        public AIMetaData​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • mNumProperties

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

        public AIMetaData mNumProperties​(int value)
        Sets the specified value to the mNumProperties field.
      • 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.
      • create

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

        @Nullable
        public static 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​(long address,
                                               int capacity)
        Create a AIMetaData.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

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

        public static AIMetaData callocStack()
        Returns a new AIMetaData instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • callocStack

        public static AIMetaData callocStack​(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
      • callocStack

        public static AIMetaData.Buffer callocStack​(int capacity)
        Returns a new AIMetaData.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • callocStack

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

        public static int nmNumProperties​(long struct)
        Unsafe version of mNumProperties().
      • 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.
      • validate

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

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array