de.intarsys.nativec.type
Class NativeStruct

java.lang.Object
  extended by de.intarsys.nativec.type.NativeObject
      extended by 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 structured NativeObject instances. These objects are built using named slots with other INativeObject instances (as opposed to NativeArray, using indexed slots).


Field Summary
static NativeStructType META
          The meta class instance
protected  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
NativeStruct()
           
NativeStruct(INativeHandle handle)
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 class NativeObject
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 class NativeObject
Returns:
A string for debugging purposes.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object