Class AIExportDataBlob

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

    public class AIExportDataBlob
    extends Struct
    implements NativeResource
    Describes a blob of exported scene data. Use ExportSceneToBlob to create a blob containing an exported scene. The memory referred by this structure is owned by Assimp. to free its resources. Don't try to free the memory on your side - it will crash for most build configurations due to conflicting heaps.

    Blobs can be nested - each blob may reference another blob, which may in turn reference another blob and so on. This is used when exporters write more than one output file for a given AIScene. See the remarks for aiExportDataBlob::name for more information.

    Member documentation

    • size – Size of the data in bytes
    • data – The data.
    • name – Name of the blob. An empty string always indicates the first (and primary) blob, which contains the actual file data. Any other blobs are auxiliary files produced by exporters (i.e. material files). Existence of such files depends on the file format. Most formats don't split assets across multiple files.

      If used, blob names usually contain the file extension that should be used when writing the data to disc.

    • next – Pointer to the next blob in the chain or NULL if there is none.

    Layout

    
     struct aiExportDataBlob {
         size_t size;
         void * data;
         struct aiString name;
         struct aiExportDataBlob * next;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • SIZE, DATA, NAME, NEXT

        The struct member offsets.
    • Constructor Detail

      • AIExportDataBlob

        public AIExportDataBlob​(java.nio.ByteBuffer container)
        Creates a AIExportDataBlob 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
      • size

        public long size()
        Returns the value of the size field.
      • data

        public java.nio.ByteBuffer data()
        Returns a ByteBuffer view of the data pointed to by the data field.
      • data

        public AIExportDataBlob data​(java.nio.ByteBuffer value)
        Sets the address of the specified ByteBuffer to the data field.
      • name

        public AIExportDataBlob name​(java.util.function.Consumer<AIString> consumer)
        Passes the name field to the specified Consumer.
      • set

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

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

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

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

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

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

        public static AIExportDataBlob mallocStack()
        Returns a new AIExportDataBlob instance allocated on the thread-local MemoryStack.
      • callocStack

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

        public static AIExportDataBlob mallocStack​(MemoryStack stack)
        Returns a new AIExportDataBlob instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

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

        public static long nsize​(long struct)
        Unsafe version of size().
      • ndata

        public static java.nio.ByteBuffer ndata​(long struct)
        Unsafe version of data.
      • nname

        public static AIString nname​(long struct)
        Unsafe version of name().
      • nsize

        public static void nsize​(long struct,
                                 long value)
        Sets the specified value to the size field of the specified struct.
      • ndata

        public static void ndata​(long struct,
                                 java.nio.ByteBuffer value)
        Unsafe version of data.
      • nname

        public static void nname​(long struct,
                                 AIString value)
        Unsafe version of name.
      • nnext

        public static void nnext​(long struct,
                                 @Nullable
                                 AIExportDataBlob value)
        Unsafe version of next.
      • 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