de.intarsys.nativec.type
Class NativeType

java.lang.Object
  extended by de.intarsys.nativec.type.NativeType
All Implemented Interfaces:
INativeType
Direct Known Subclasses:
NativeAbstractStringType, NativeArrayType, NativeBufferType, NativeReferenceType, NativeSimpleType, NativeStructType

public abstract class NativeType
extends java.lang.Object
implements INativeType

A common superclass for INativeType implementations


Constructor Summary
protected NativeType()
           
protected NativeType(java.lang.Class<?> instanceClass)
           
 
Method Summary
 INativeType Array(int size)
          Create a Declaration that represents an array of this.
 INativeObject createNative(INativeHandle handle)
          Create a new INativeObject from a INativeHandle.
 INativeObject createNative(java.lang.Object value)
          Create an INativeObject for this type from the Java object.
 int getByteCount()
          The size of the type in c memory.
static INativeType lookup(java.lang.Class<?> clazz)
           
 INativeType Ref()
          Create a Declaration that represents a reference to this.
static void register(java.lang.Class<?> clazz, INativeType type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.intarsys.nativec.type.INativeType
getPreferredBoundary
 

Constructor Detail

NativeType

protected NativeType()

NativeType

protected NativeType(java.lang.Class<?> instanceClass)
Method Detail

lookup

public static INativeType lookup(java.lang.Class<?> clazz)

register

public static void register(java.lang.Class<?> clazz,
                            INativeType type)

Array

public INativeType Array(int size)
Create a Declaration that represents an array of this.

Specified by:
Array in interface INativeType
Parameters:
size - The predefined size for the array.
Returns:
Create a Declaration that represents an array of this.

createNative

public INativeObject createNative(INativeHandle handle)
Description copied from interface: INativeType
Create a new INativeObject from a INativeHandle.

Specified by:
createNative in interface INativeType
Parameters:
handle - The handle to memory.
Returns:
The new INativeObject

createNative

public INativeObject createNative(java.lang.Object value)
Description copied from interface: INativeType
Create an INativeObject for this type from the Java object.

Specified by:
createNative in interface INativeType
Returns:
The new INativeObject

getByteCount

public int getByteCount()
Description copied from interface: INativeType
The size of the type in c memory.

Specified by:
getByteCount in interface INativeType
Returns:
The size of the type in c memory.

Ref

public INativeType Ref()
Create a Declaration that represents a reference to this.

Specified by:
Ref in interface INativeType
Returns:
Create a Declaration that represents a reference to this.