Package jnr.ffi
Class StructLayout
java.lang.Object
jnr.ffi.Type
jnr.ffi.StructLayout
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
Base class for Boolean fieldsprotected class
Base implementation of Memberclass
class
final class
final class
final class
protected final class
A normal C boolean - 1 byte in sizefinal class
final class
final class
final class
class
StructLayout.Enum<T extends Enum<T>>
class
StructLayout.Enum16<E extends Enum<E>>
class
StructLayout.Enum32<E extends Enum<E>>
class
StructLayout.Enum64<E extends Enum<E>>
class
StructLayout.Enum8<E extends Enum<E>>
An 8 bit enum field.protected class
StructLayout.EnumField<E extends Enum<E>>
Base for all the Enum fields.class
StructLayout.EnumLong<E extends Enum<E>>
protected class
Interface all Struct members must implement.class
final class
final class
protected final class
final class
final class
final class
final class
final class
final class
final class
final class
final class
final class
class
final class
final class
final class
final class
protected class
Base class for all Number structure fields.final class
protected static final class
protected final class
Specialized padding fields for structs.final class
class
Represents a native memory address.final class
final class
class
A 16 bit signed integer field.class
A 32 bit signed integer field.class
A 64 bit signed integer field.class
An 8 bit signed integerclass
A native long integer field.final class
final class
final class
class
final class
final class
final class
final class
final class
final class
final class
final class
class
A 16 bit signed integer field.class
A 32 bit signed integer field.class
A 64 bit unsigned integer field.class
An 8 bit unsigned integerclass
A native long integer field.class
class
class
class
protected final class
A Windows BOOL - 4 bytes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
StructLayout
(Runtime runtime) Creates a newStructLayout
.protected
StructLayout
(Runtime runtime, int structSize) -
Method Summary
Modifier and TypeMethodDescriptionprotected final int
addField
(int size, int align) protected final int
addField
(int size, int align, StructLayout.Offset offset) protected final int
protected final int
addField
(Type t, StructLayout.Offset offset) final int
The native alignment of this type, in bytesprotected <T extends StructLayout.Field>
T[]array
(T[] array) Creates an array ofMember
instances.protected final void
Starts an array construction sessionprotected final void
arrayEnd()
Ends an array construction sessionprotected final StructLayout.Offset
at
(int offset) protected final <T> StructLayout.Function
<T> protected final <T> StructLayout.Function
<T> function
(Class<T> closureClass, StructLayout.Offset offset) The native type of this typefinal Runtime
protected final <T extends StructLayout>
Tinner
(T structLayout) final int
offset()
final int
size()
The size in bytes of this type.toString()
Returns a human readableString
representation of the structure.
-
Constructor Details
-
StructLayout
Creates a newStructLayout
.- Parameters:
runtime
- The current runtime.
-
StructLayout
-
-
Method Details
-
getRuntime
-
size
public final int size()Description copied from class:Type
The size in bytes of this type. -
alignment
public final int alignment()Description copied from class:Type
The native alignment of this type, in bytes -
offset
public final int offset() -
getNativeType
Description copied from class:Type
The native type of this type- Specified by:
getNativeType
in classType
- Returns:
- the native type of this type
-
toString
Returns a human readableString
representation of the structure. -
addField
protected final int addField(int size, int align) -
addField
-
addField
-
addField
-
at
-
arrayBegin
protected final void arrayBegin()Starts an array construction session -
arrayEnd
protected final void arrayEnd()Ends an array construction session -
array
Creates an array ofMember
instances.- Type Parameters:
T
- The type of theMember
subclass to create.- Parameters:
array
- the array to store the instances in- Returns:
- the array that was passed in
-
inner
-
function
-
function
protected final <T> StructLayout.Function<T> function(Class<T> closureClass, StructLayout.Offset offset)
-