Class CXSourceRange

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class CXSourceRange extends Struct<CXSourceRange> implements NativeResource

 struct CXSourceRange {
     void const * ptr_data[2];
     unsigned begin_int_data;
     unsigned end_int_data;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int PTR_DATA
      The struct member offsets.
    • BEGIN_INT_DATA

      public static final int BEGIN_INT_DATA
      The struct member offsets.
    • END_INT_DATA

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

    • CXSourceRange

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

      public PointerBuffer ptr_data()
      Returns:
      a PointerBuffer view of the ptr_data field.
    • ptr_data

      public long ptr_data(int index)
      Returns:
      the value at the specified index of the ptr_data field.
    • begin_int_data

      public int begin_int_data()
      Returns:
      the value of the begin_int_data field.
    • end_int_data

      public int end_int_data()
      Returns:
      the value of the end_int_data field.
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static PointerBuffer nptr_data(long struct)
      Unsafe version of ptr_data().
    • nptr_data

      public static long nptr_data(long struct, int index)
      Unsafe version of ptr_data.
    • nbegin_int_data

      public static int nbegin_int_data(long struct)
      Unsafe version of begin_int_data().
    • nend_int_data

      public static int nend_int_data(long struct)
      Unsafe version of end_int_data().