public class CXCursor
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
The cursor abstraction unifies the different kinds of entities in a program --declaration, statements, expressions, references to declarations, etc.-- under a single "cursor" abstraction with a common set of operations. Common operation for a cursor include: getting the physical location in a source file where the cursor points, getting the name associated with a cursor, and retrieving cursors for any child nodes of a particular cursor.
Cursors can be produced in two specific ways. getTranslationUnitCursor produces a cursor for a translation unit, from which one can use
visitChildren to explore the rest of the translation unit. getCursor maps from a physical source location to the entity that resides at that
location, allowing one to map from the source code into the AST.
struct CXCursor {
enum CXCursorKind kind;
int xdata;
void const * data[3];
}| Modifier and Type | Class and Description |
|---|---|
static class |
CXCursor.Buffer
An array of
CXCursor structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
DATA
The struct member offsets.
|
static int |
KIND
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
static int |
XDATA
The struct member offsets.
|
| Constructor and Description |
|---|
CXCursor(java.nio.ByteBuffer container)
Creates a
CXCursor instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
static CXCursor |
calloc()
Returns a new
CXCursor instance allocated with memCalloc. |
static CXCursor.Buffer |
calloc(int capacity)
Returns a new
CXCursor.Buffer instance allocated with memCalloc. |
static CXCursor |
callocStack()
Returns a new
CXCursor instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static CXCursor.Buffer |
callocStack(int capacity)
Returns a new
CXCursor.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static CXCursor.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
CXCursor.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static CXCursor |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
CXCursor instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static CXCursor |
create()
Returns a new
CXCursor instance allocated with BufferUtils. |
static CXCursor.Buffer |
create(int capacity)
Returns a new
CXCursor.Buffer instance allocated with BufferUtils. |
static CXCursor |
create(long address)
Returns a new
CXCursor instance for the specified memory address. |
static CXCursor.Buffer |
create(long address,
int capacity)
Create a
CXCursor.Buffer instance at the specified memory. |
static CXCursor |
createSafe(long address)
|
static CXCursor.Buffer |
createSafe(long address,
int capacity)
|
org.lwjgl.PointerBuffer |
data()
Returns a
PointerBuffer view of the data field. |
long |
data(int index)
Returns the value at the specified index of the
data field. |
int |
kind()
Returns the value of the
kind field. |
static CXCursor |
malloc()
Returns a new
CXCursor instance allocated with memAlloc. |
static CXCursor.Buffer |
malloc(int capacity)
Returns a new
CXCursor.Buffer instance allocated with memAlloc. |
static CXCursor |
mallocStack()
Returns a new
CXCursor instance allocated on the thread-local MemoryStack. |
static CXCursor.Buffer |
mallocStack(int capacity)
Returns a new
CXCursor.Buffer instance allocated on the thread-local MemoryStack. |
static CXCursor.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
CXCursor.Buffer instance allocated on the specified MemoryStack. |
static CXCursor |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
CXCursor instance allocated on the specified MemoryStack. |
static org.lwjgl.PointerBuffer |
ndata(long struct)
Unsafe version of
data(). |
static long |
ndata(long struct,
int index)
Unsafe version of
data. |
static int |
nkind(long struct)
Unsafe version of
kind(). |
static int |
nxdata(long struct)
Unsafe version of
xdata(). |
int |
sizeof() |
int |
xdata()
Returns the value of the
xdata field. |
public static final int SIZEOF
public static final int ALIGNOF
public static final int KIND
public static final int XDATA
public static final int DATA
public CXCursor(java.nio.ByteBuffer container)
CXCursor 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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic int kind()
kind field.public int xdata()
xdata field.public org.lwjgl.PointerBuffer data()
PointerBuffer view of the data field.public long data(int index)
data field.public static CXCursor malloc()
CXCursor instance allocated with memAlloc. The instance must be explicitly freed.public static CXCursor calloc()
CXCursor instance allocated with memCalloc. The instance must be explicitly freed.public static CXCursor create()
CXCursor instance allocated with BufferUtils.public static CXCursor create(long address)
CXCursor instance for the specified memory address.@Nullable public static CXCursor createSafe(long address)
public static CXCursor.Buffer malloc(int capacity)
CXCursor.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static CXCursor.Buffer calloc(int capacity)
CXCursor.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static CXCursor.Buffer create(int capacity)
CXCursor.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static CXCursor.Buffer create(long address, int capacity)
CXCursor.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static CXCursor.Buffer createSafe(long address, int capacity)
public static CXCursor mallocStack()
CXCursor instance allocated on the thread-local MemoryStack.public static CXCursor callocStack()
CXCursor instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static CXCursor mallocStack(org.lwjgl.system.MemoryStack stack)
CXCursor instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static CXCursor callocStack(org.lwjgl.system.MemoryStack stack)
CXCursor instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static CXCursor.Buffer mallocStack(int capacity)
CXCursor.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static CXCursor.Buffer callocStack(int capacity)
CXCursor.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static CXCursor.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
CXCursor.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static CXCursor.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
CXCursor.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static int nkind(long struct)
kind().public static int nxdata(long struct)
xdata().public static org.lwjgl.PointerBuffer ndata(long struct)
data().public static long ndata(long struct,
int index)
data.Copyright LWJGL. All Rights Reserved. License terms.