Package jnr.ffi
Class StructLayout
- java.lang.Object
-
- jnr.ffi.Type
-
- jnr.ffi.StructLayout
-
public class StructLayout extends Type
-
-
Nested Class Summary
-
Constructor Summary
Constructors Modifier Constructor Description protectedStructLayout(Runtime runtime)Creates a newStructLayout.protectedStructLayout(Runtime runtime, int structSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intaddField(int size, int align)protected intaddField(int size, int align, StructLayout.Offset offset)protected intaddField(Type t)protected intaddField(Type t, StructLayout.Offset offset)intalignment()The native alignment of this type, in bytesprotected <T extends StructLayout.Field>
T[]array(T[] array)Creates an array ofMemberinstances.protected voidarrayBegin()Starts an array construction sessionprotected voidarrayEnd()Ends an array construction sessionprotected StructLayout.Offsetat(int offset)protected <T> StructLayout.Function<T>function(Class<T> closureClass)protected <T> StructLayout.Function<T>function(Class<T> closureClass, StructLayout.Offset offset)NativeTypegetNativeType()The native type of this typeRuntimegetRuntime()protected <T extends StructLayout>
Tinner(T structLayout)intoffset()intsize()The size in bytes of this type.StringtoString()Returns a human readableStringrepresentation of the structure.
-
-
-
Method Detail
-
getRuntime
public final Runtime getRuntime()
-
size
public final int size()
Description copied from class:TypeThe size in bytes of this type.
-
alignment
public final int alignment()
Description copied from class:TypeThe native alignment of this type, in bytes
-
offset
public final int offset()
-
getNativeType
public NativeType getNativeType()
Description copied from class:TypeThe native type of this type- Specified by:
getNativeTypein classType- Returns:
- the native type of this type
-
addField
protected final int addField(int size, int align)
-
addField
protected final int addField(int size, int align, StructLayout.Offset offset)
-
addField
protected final int addField(Type t)
-
addField
protected final int addField(Type t, StructLayout.Offset offset)
-
at
protected final StructLayout.Offset at(int offset)
-
arrayBegin
protected final void arrayBegin()
Starts an array construction session
-
arrayEnd
protected final void arrayEnd()
Ends an array construction session
-
array
protected <T extends StructLayout.Field> T[] array(T[] array)
Creates an array ofMemberinstances.- Type Parameters:
T- The type of theMembersubclass to create.- Parameters:
array- the array to store the instances in- Returns:
- the array that was passed in
-
inner
protected final <T extends StructLayout> T inner(T structLayout)
-
function
protected final <T> StructLayout.Function<T> function(Class<T> closureClass)
-
function
protected final <T> StructLayout.Function<T> function(Class<T> closureClass, StructLayout.Offset offset)
-
-