public class StructLayout extends Type
Modifier | Constructor and Description |
---|---|
protected |
StructLayout(Runtime runtime)
Creates a new StructLayout.
|
protected |
StructLayout(Runtime runtime,
int structSize) |
Modifier and Type | Method and Description |
---|---|
protected int |
addField(int size,
int align) |
protected int |
addField(int size,
int align,
StructLayout.Offset offset) |
protected int |
addField(Type t) |
protected int |
addField(Type t,
StructLayout.Offset offset) |
int |
alignment()
The native alignment of this type, in bytes
|
protected <T extends StructLayout.Field> |
array(T[] array)
Creates an array of Member instances.
|
protected void |
arrayBegin()
Starts an array construction session
|
protected void |
arrayEnd()
Ends an array construction session
|
protected StructLayout.Offset |
at(int offset) |
protected <T> StructLayout.Function<T> |
function(Class<T> closureClass) |
protected <T> StructLayout.Function<T> |
function(Class<T> closureClass,
StructLayout.Offset offset) |
NativeType |
getNativeType()
The native type of this type
|
Runtime |
getRuntime() |
protected <T extends StructLayout> |
inner(T structLayout) |
int |
offset() |
int |
size()
The size in bytes of this type.
|
String |
toString()
Returns a human readable
String representation of the structure. |
protected StructLayout(Runtime runtime)
runtime
- The current runtime.protected StructLayout(Runtime runtime, int structSize)
public final Runtime getRuntime()
public final int size()
Type
public final int alignment()
Type
public final int offset()
public NativeType getNativeType()
Type
getNativeType
in class Type
protected final int addField(int size, int align)
protected final int addField(int size, int align, StructLayout.Offset offset)
protected final int addField(Type t)
protected final int addField(Type t, StructLayout.Offset offset)
protected final StructLayout.Offset at(int offset)
protected final void arrayBegin()
protected final void arrayEnd()
protected <T extends StructLayout.Field> T[] array(T[] array)
T
- The type of the Member subclass to create.array
- the array to store the instances inprotected final <T extends StructLayout> T inner(T structLayout)
protected final <T> StructLayout.Function<T> function(Class<T> closureClass)
protected final <T> StructLayout.Function<T> function(Class<T> closureClass, StructLayout.Offset offset)
Copyright © 2017. All rights reserved.