Package de.intarsys.nativec.type
Class NativeStructType
- java.lang.Object
-
- de.intarsys.nativec.type.NativeType
-
- de.intarsys.nativec.type.NativeStructType
-
- All Implemented Interfaces:
INativeType
public class NativeStructType extends NativeType
The meta class implementation
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNativeStructType()protectedNativeStructType(java.lang.Class<?> instanceClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StructMemberdeclare(java.lang.String name, INativeType declaration)Declare a new member for the struct.intgetByteBoundary()intgetByteCount()The size of the type in c memory.intgetByteSize()The total size of the StructDeclaration.StructMembergetField(java.lang.String name)java.util.List<StructMember>getFields()The collection of StructMember instances in declaration order.intgetFieldsSize()INativeObjectgetNativeObject(NativeStruct struct, java.lang.String name)intgetPacking()intgetPreferredBoundary()The boundary where this type as a struct member would want to be aligned.voidsetPacking(int pPacking)java.lang.StringtoString()-
Methods inherited from class de.intarsys.nativec.type.NativeType
Array, createNative, createNative, lookup, Ref, register
-
-
-
-
Method Detail
-
declare
public StructMember declare(java.lang.String name, INativeType declaration)
Declare a new member for the struct.- Parameters:
name- The name of the new member slot.declaration- The type declaration for the slot
-
getByteBoundary
public int getByteBoundary()
-
getByteCount
public int getByteCount()
Description copied from interface:INativeTypeThe size of the type in c memory.- Specified by:
getByteCountin interfaceINativeType- Overrides:
getByteCountin classNativeType- Returns:
- The size of the type in c memory.
-
getByteSize
public int getByteSize()
The total size of the StructDeclaration.- Returns:
- The total size of the StructDeclaration.
-
getField
public StructMember getField(java.lang.String name)
-
getFields
public java.util.List<StructMember> getFields()
The collection of StructMember instances in declaration order.- Returns:
- The collection of StructMember instances in declaration order.
-
getFieldsSize
public int getFieldsSize()
-
getNativeObject
public INativeObject getNativeObject(NativeStruct struct, java.lang.String name)
-
getPacking
public int getPacking()
-
getPreferredBoundary
public int getPreferredBoundary()
Description copied from interface:INativeTypeThe boundary where this type as a struct member would want to be aligned. A structure can override this value with packing.- Returns:
- The preferred alignment boundary.
-
setPacking
public void setPacking(int pPacking)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-