C struct
definition. The interface must extend PointerBase, i.e., it is a word type. There is
never a Java class that implements the interface.
Field accesses are done via interface methods that are annotated with RawField. All calls
of the interface methods are replaced with the appropriate memory operations.
The layout and size of the structure is inferred from the fields defined with RawField.
All fields are aligned according to the field size, i.e., 8-byte types are aligned at 8-byte
boundaries. It is currently not possible to influence the layout of fields. However, it is
possible to reserve extra space at the end of the structure by specifying a
RawStructure#sizeProvider.
To access an array of structs one can define a special addressOf method (see
CStruct for more details).
| Modifier and Type | Method and Description |
|---|---|
| public Class |
| sizeProvider | back to summary |
|---|---|
| public Class Class of a function that computes the size of the structure. The input argument of the
function is the size computed based on the layout of the By default, the size computed based on the layout is used. The provided class must have a no-argument constructor.
| |