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 structuredNativeObject
instances. These objects are built using named slots with otherINativeObject
instances (as opposed toNativeArray
, using indexed slots).
-
-
Field Summary
Fields Modifier and Type Field Description static NativeStructType
META
The 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 int
getByteCount()
The number of bytes occupied by this.INativeObject
getNativeObject(java.lang.String name)
The NativeObject at the named slot name.protected StructMember
getStructField(java.lang.String name)
NativeStructType
getStructType()
java.lang.Object
getValue()
A Java side representation from the memory.void
setValue(java.lang.Object value)
Assign (and marshall to memory) the Java side representation.java.lang.String
toNestedString()
A string for debugging purposes.java.lang.String
toString()
-
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:NativeObject
The number of bytes occupied by this.- Specified by:
getByteCount
in 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:INativeObject
A 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:INativeObject
Assign (and marshall to memory) the Java side representation.- Parameters:
value
- The new Java value.
-
toNestedString
public java.lang.String toNestedString()
Description copied from class:NativeObject
A string for debugging purposes.- Overrides:
toNestedString
in classNativeObject
- Returns:
- A string for debugging purposes.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-