Class SPVBinary
- All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer
@NativeType("struct spv_binary_t")
public class SPVBinary
extends Struct<SPVBinary>
implements NativeResource
struct spv_binary_t {
uint32_t * code;
size_t wordCount;
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Struct
Struct.StructValidationNested classes/interfaces inherited from interface Pointer
Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.Fields inherited from interface Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionSPVBinary(ByteBuffer container) Creates aSPVBinaryinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic SPVBinarycalloc()Returns a newSPVBinaryinstance allocated withmemCalloc.static SPVBinary.Buffercalloc(int capacity) Returns a newSPVBinary.Bufferinstance allocated withmemCalloc.static SPVBinary.Buffercalloc(int capacity, MemoryStack stack) Returns a newSPVBinary.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static SPVBinarycalloc(MemoryStack stack) Returns a newSPVBinaryinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.code()static SPVBinarycreate()Returns a newSPVBinaryinstance allocated withBufferUtils.static SPVBinary.Buffercreate(int capacity) Returns a newSPVBinary.Bufferinstance allocated withBufferUtils.static SPVBinarycreate(long address) Returns a newSPVBinaryinstance for the specified memory address.static SPVBinary.Buffercreate(long address, int capacity) Create aSPVBinary.Bufferinstance at the specified memory.static @Nullable SPVBinarycreateSafe(long address) static @Nullable SPVBinary.BuffercreateSafe(long address, int capacity) static SPVBinarymalloc()Returns a newSPVBinaryinstance allocated withmemAlloc.static SPVBinary.Buffermalloc(int capacity) Returns a newSPVBinary.Bufferinstance allocated withmemAlloc.static SPVBinary.Buffermalloc(int capacity, MemoryStack stack) Returns a newSPVBinary.Bufferinstance allocated on the specifiedMemoryStack.static SPVBinarymalloc(MemoryStack stack) Returns a newSPVBinaryinstance allocated on the specifiedMemoryStack.static IntBufferncode(long struct) Unsafe version ofcode.static longnwordCount(long struct) Unsafe version ofwordCount().intsizeof()Returnssizeof(struct).longMethods inherited from class Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
CODE
public static final int CODEThe struct member offsets. -
WORDCOUNT
public static final int WORDCOUNTThe struct member offsets.
-
-
Constructor Details
-
SPVBinary
Creates aSPVBinaryinstance at the current position of the specifiedByteBuffercontainer. 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
-
code
- Returns:
- a
IntBufferview of the data pointed to by thecodefield.
-
wordCount
- Returns:
- the value of the
wordCountfield.
-
malloc
-
calloc
-
create
Returns a newSPVBinaryinstance allocated withBufferUtils. -
create
Returns a newSPVBinaryinstance for the specified memory address. -
createSafe
-
malloc
Returns a newSPVBinary.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newSPVBinary.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newSPVBinary.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aSPVBinary.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newSPVBinaryinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newSPVBinaryinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newSPVBinary.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newSPVBinary.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
ncode
-
nwordCount
public static long nwordCount(long struct) Unsafe version ofwordCount().
-