Class AIMetaDataEntry

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

    public class AIMetaDataEntry
    extends Struct
    implements NativeResource

    Layout

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

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • MTYPE, MDATA

        The struct member offsets.
    • Constructor Detail

      • AIMetaDataEntry

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

      • sizeof

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

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

        public java.nio.ByteBuffer mData​(int capacity)
        Returns a ByteBuffer view of the data pointed to by the mData field.
        Parameters:
        capacity - the number of elements in the returned buffer
      • mType

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

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

        public AIMetaDataEntry set​(int mType,
                                   java.nio.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
      • createSafe

        @Nullable
        public static AIMetaDataEntry createSafe​(long address)
        Like create, but returns null if address is NULL.
      • 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

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

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

        public static java.nio.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,
                                  java.nio.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
      • 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