setType will be written
to native memory. Upon reading from native memory, Structure, String,
or WString fields will not be initialized unless they are
the current field as identified by a call to setType. The current
field is always unset by default to avoid accidentally attempting to read
a field that is not valid. In the case of a String, for instance, an
invalid pointer may result in a memory fault when attempting to initialize
the String.
| Modifier and Type | Field and Description |
|---|---|
| private Structure. | |
| private Structure. |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv int | calculateSize(boolean force)
Overrides com. |
| protected int | getNativeAlignment(Class<T> type, Object value, boolean isFirstElement)
Overrides com. |
| pack-priv Pointer | getTypeInfo()
Overrides com. |
| pack-priv Object | readField(Structure.
Overrides com. |
| public void | |
| pack-priv void | writeField(Structure.
Overrides com. |
| activeField | back to summary |
|---|---|
| private Structure. | |
| biggestField | back to summary |
|---|---|
| private Structure. | |
| Union | back to summary |
|---|---|
| protected Union() Create a Union whose size and alignment will be calculated automatically. | |
| Union | back to summary |
|---|---|
| protected Union(int size) Create a Union of the given size, using default alignment. | |
| Union | back to summary |
|---|---|
| protected Union(int size, int alignType) Create a Union of the given size and alignment type. | |
| calculateSize | back to summary |
|---|---|
| pack-priv int calculateSize(boolean force) Overrides com. Adjust the size to be the size of the largest element, and ensure all fields begin at offset zero. | |
| getNativeAlignment | back to summary |
|---|---|
| protected int getNativeAlignment(Class<T> type, Object value, boolean isFirstElement) Overrides com. All fields are considered the "first" element. | |
| getTypeInfo | back to summary |
|---|---|
| pack-priv Pointer getTypeInfo() Overrides com. Return type information for the largest field. | |
| readField | back to summary |
|---|---|
| pack-priv Object readField(Structure. Overrides com. Avoid reading pointer-based fields and structures unless explicitly selected. Structures may contain pointer-based fields which can crash the VM if not properly initialized. | |
| setType | back to summary |
|---|---|
| public void setType(Class<T> type) Indicates which field will be used to write to native memory.
| |
| writeField | back to summary |
|---|---|
| pack-priv void writeField(Structure. Overrides com. Only the currently selected field will be written. | |