Class SPVParsedInstruction

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SPVParsedInstruction extends Struct<SPVParsedInstruction> implements NativeResource

 struct spv_parsed_instruction_t {
     uint32_t const * words;
     uint16_t num_words;
     uint16_t opcode;
     spv_ext_inst_type_t ext_inst_type;
     uint32_t type_id;
     uint32_t result_id;
     spv_parsed_operand_t const * operands;
     uint16_t num_operands;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int WORDS
      The struct member offsets.
    • NUM_WORDS

      public static final int NUM_WORDS
      The struct member offsets.
    • OPCODE

      public static final int OPCODE
      The struct member offsets.
    • EXT_INST_TYPE

      public static final int EXT_INST_TYPE
      The struct member offsets.
    • TYPE_ID

      public static final int TYPE_ID
      The struct member offsets.
    • RESULT_ID

      public static final int RESULT_ID
      The struct member offsets.
    • OPERANDS

      public static final int OPERANDS
      The struct member offsets.
    • NUM_OPERANDS

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

    • SPVParsedInstruction

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

      public IntBuffer words()
      Returns:
      a IntBuffer view of the data pointed to by the words field.
    • num_words

      public short num_words()
      Returns:
      the value of the num_words field.
    • opcode

      public short opcode()
      Returns:
      the value of the opcode field.
    • ext_inst_type

      public int ext_inst_type()
      Returns:
      the value of the ext_inst_type field.
    • type_id

      public int type_id()
      Returns:
      the value of the type_id field.
    • result_id

      public int result_id()
      Returns:
      the value of the result_id field.
    • operands

      public SPVParsedOperand.Buffer operands()
      Returns:
      a SPVParsedOperand.Buffer view of the struct array pointed to by the operands field.
    • num_operands

      public short num_operands()
      Returns:
      the value of the num_operands field.
    • words

      public SPVParsedInstruction words(IntBuffer value)
      Sets the address of the specified IntBuffer to the words field.
    • opcode

      public SPVParsedInstruction opcode(short value)
      Sets the specified value to the opcode field.
    • ext_inst_type

      public SPVParsedInstruction ext_inst_type(int value)
      Sets the specified value to the ext_inst_type field.
    • type_id

      public SPVParsedInstruction type_id(int value)
      Sets the specified value to the type_id field.
    • result_id

      public SPVParsedInstruction result_id(int value)
      Sets the specified value to the result_id field.
    • operands

      Sets the address of the specified SPVParsedOperand.Buffer to the operands field.
    • set

      public SPVParsedInstruction set(IntBuffer words, short opcode, int ext_inst_type, int type_id, int result_id, SPVParsedOperand.Buffer operands)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static IntBuffer nwords(long struct)
      Unsafe version of words.
    • nnum_words

      public static short nnum_words(long struct)
      Unsafe version of num_words().
    • nopcode

      public static short nopcode(long struct)
      Unsafe version of opcode().
    • next_inst_type

      public static int next_inst_type(long struct)
      Unsafe version of ext_inst_type().
    • ntype_id

      public static int ntype_id(long struct)
      Unsafe version of type_id().
    • nresult_id

      public static int nresult_id(long struct)
      Unsafe version of result_id().
    • noperands

      public static SPVParsedOperand.Buffer noperands(long struct)
      Unsafe version of operands().
    • nnum_operands

      public static short nnum_operands(long struct)
      Unsafe version of num_operands().
    • nwords

      public static void nwords(long struct, IntBuffer value)
      Unsafe version of words.
    • nnum_words

      public static void nnum_words(long struct, short value)
      Sets the specified value to the num_words field of the specified struct.
    • nopcode

      public static void nopcode(long struct, short value)
      Unsafe version of opcode.
    • next_inst_type

      public static void next_inst_type(long struct, int value)
      Unsafe version of ext_inst_type.
    • ntype_id

      public static void ntype_id(long struct, int value)
      Unsafe version of type_id.
    • nresult_id

      public static void nresult_id(long struct, int value)
      Unsafe version of result_id.
    • noperands

      public static void noperands(long struct, SPVParsedOperand.Buffer value)
      Unsafe version of operands.
    • nnum_operands

      public static void nnum_operands(long struct, short value)
      Sets the specified value to the num_operands field of the specified struct.
    • validate

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