Class CLNameVersion

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class CLNameVersion extends Struct<CLNameVersion> implements NativeResource

 struct cl_name_version {
     cl_version version;
     char name[64];
 }
  • Field Details

    • SIZEOF

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

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

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

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

    • CLNameVersion

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

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

      public ByteBuffer name()
      Returns:
      a ByteBuffer view of the name field.
    • nameString

      public String nameString()
      Returns:
      the null-terminated string stored in the name field.
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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