Package de.intarsys.nativec.type
Class NativeStruct
- java.lang.Object
-
- de.intarsys.nativec.type.NativeObject
-
- de.intarsys.nativec.type.NativeStruct
-
- All Implemented Interfaces:
INativeObject
- Direct Known Subclasses:
NativeGenericStruct,NativeStaticStruct
public abstract class NativeStruct extends NativeObject
An abstract superclass for the implementation of structuredNativeObjectinstances. These objects are built using named slots with otherINativeObjectinstances (as opposed toNativeArray, using indexed slots).
-
-
Field Summary
Fields Modifier and Type Field Description static NativeStructTypeMETAThe meta class instanceprotected INativeObject[]values-
Fields inherited from class de.intarsys.nativec.type.NativeObject
DEBUG, handle, SHIFT_INT, SHIFT_LONG, SHIFT_LONGLONG, SIZE_BYTE, SIZE_INT, SIZE_LONG, SIZE_LONGLONG, SIZE_PTR, SIZE_SHORT
-
-
Constructor Summary
Constructors Constructor Description NativeStruct()NativeStruct(INativeHandle handle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetByteCount()The number of bytes occupied by this.INativeObjectgetNativeObject(java.lang.String name)The NativeObject at the named slot name.protected StructMembergetStructField(java.lang.String name)NativeStructTypegetStructType()java.lang.ObjectgetValue()A Java side representation from the memory.voidsetValue(java.lang.Object value)Assign (and marshall to memory) the Java side representation.java.lang.StringtoNestedString()A string for debugging purposes.java.lang.StringtoString()-
Methods inherited from class de.intarsys.nativec.type.NativeObject
allocate, cast, createReference, getByte, getByteArray, getBytes, getCLong, getInt, getNativeHandle, getNativeHandle, getNativeType, getShort, getString, getWideString, isNull, setByte, setByteArray, setCLong, setInt, setNativeHandle, setShort, setString, setWideString
-
-
-
-
Field Detail
-
META
public static final NativeStructType META
The meta class instance
-
values
protected INativeObject[] values
-
-
Constructor Detail
-
NativeStruct
public NativeStruct()
-
NativeStruct
public NativeStruct(INativeHandle handle)
-
-
Method Detail
-
getByteCount
public int getByteCount()
Description copied from class:NativeObjectThe number of bytes occupied by this.- Specified by:
getByteCountin classNativeObject- Returns:
- The number of bytes occupied by this.
-
getNativeObject
public INativeObject getNativeObject(java.lang.String name)
The NativeObject at the named slot name.The marshalling is delegated to the StructMember in the StructDeclaration.
- Parameters:
name- The name of the slot in the structure.- Returns:
- The NativeObject at the named slot name.
-
getStructField
protected StructMember getStructField(java.lang.String name)
-
getStructType
public NativeStructType getStructType()
-
getValue
public java.lang.Object getValue()
Description copied from interface:INativeObjectA Java side representation from the memory.- Returns:
- A Java side representation for the
INativeObject.
-
setValue
public void setValue(java.lang.Object value)
Description copied from interface:INativeObjectAssign (and marshall to memory) the Java side representation.- Parameters:
value- The new Java value.
-
toNestedString
public java.lang.String toNestedString()
Description copied from class:NativeObjectA string for debugging purposes.- Overrides:
toNestedStringin classNativeObject- Returns:
- A string for debugging purposes.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-