- java.lang.Object
-
- jnr.ffi.Struct.Member
-
- jnr.ffi.Struct.NumberField
-
- jnr.ffi.Struct.PointerField
-
- jnr.ffi.Struct.StructRef<T>
-
- Type Parameters:
T- - Struct type
- Enclosing class:
- Struct
public class Struct.StructRef<T extends Struct> extends Struct.PointerField
Represents a reference to a Struct or and array of Structs
-
-
Field Summary
-
Fields inherited from class jnr.ffi.Struct.NumberField
type
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tget()T[]get(int length)voidset(T struct)voidset(T[] structs)StringtoString()Returns a string representation of thisPointer.-
Methods inherited from class jnr.ffi.Struct.PointerField
getPointer, intValue, longValue, set, set, size
-
Methods inherited from class jnr.ffi.Struct.NumberField
byteValue, doubleValue, floatValue, getMemory, offset, shortValue, struct
-
-
-
-
Constructor Detail
-
StructRef
public StructRef(Class<T> structType, int initialStructCount)
- Parameters:
structType- Struct typeinitialStructCount- the number of struct instances. Use this to allocate memory without setting value.
-
StructRef
public StructRef(Struct.Offset offset, Class<T> structType)
-
StructRef
public StructRef(Struct.Offset offset, Class<T> structType, int initialStructCount)
- Parameters:
offset- offset of the fieldstructType- Struct typeinitialStructCount- the number of struct instances. Use this to allocate memory without setting value.
-
-
Method Detail
-
set
public final void set(T struct)
-
set
public final void set(T[] structs)
-
get
public final T get()
- Returns:
- struct from memory
-
get
public final T[] get(int length)
- Parameters:
length- the length of struct in memory to get- Returns:
- struct from memory
-
toString
public String toString()
Description copied from class:Struct.PointerFieldReturns a string representation of thisPointer.- Overrides:
toStringin classStruct.PointerField- Returns:
- a string representation of this
Pointer.
-
-