Class SpvcReflectedResource

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SpvcReflectedResource extends Struct<SpvcReflectedResource> implements NativeResource

 struct spvc_reflected_resource {
     spvc_variable_id id;
     spvc_type_id base_type_id;
     spvc_type_id type_id;
     char const * name;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int ID
      The struct member offsets.
    • BASE_TYPE_ID

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

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

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

    • SpvcReflectedResource

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

      public int id()
      Returns:
      the value of the id field.
    • base_type_id

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

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

      public ByteBuffer name()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the name field.
    • nameString

      public String nameString()
      Returns:
      the null-terminated string pointed to by the name field.
    • id

      public SpvcReflectedResource id(int value)
      Sets the specified value to the id field.
    • base_type_id

      public SpvcReflectedResource base_type_id(int value)
      Sets the specified value to the base_type_id field.
    • type_id

      public SpvcReflectedResource type_id(int value)
      Sets the specified value to the type_id field.
    • name

      public SpvcReflectedResource name(ByteBuffer value)
      Sets the address of the specified encoded string to the name field.
    • set

      public SpvcReflectedResource set(int id, int base_type_id, int type_id, ByteBuffer name)
      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 SpvcReflectedResource malloc()
      Returns a new SpvcReflectedResource instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static int nid(long struct)
      Unsafe version of id().
    • nbase_type_id

      public static int nbase_type_id(long struct)
      Unsafe version of base_type_id().
    • ntype_id

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

      public static ByteBuffer nname(long struct)
      Unsafe version of name().
    • nnameString

      public static String nnameString(long struct)
      Unsafe version of nameString().
    • nid

      public static void nid(long struct, int value)
      Unsafe version of id.
    • nbase_type_id

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

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

      public static void nname(long struct, ByteBuffer value)
      Unsafe version of name.
    • validate

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