org.bridj
Class CRuntime.CTypeInfo<T extends NativeObject>

java.lang.Object
  extended by org.bridj.CRuntime.CTypeInfo<T>
All Implemented Interfaces:
BridJRuntime.TypeInfo<T>
Direct Known Subclasses:
CPPRuntime.CPPTypeInfo
Enclosing class:
CRuntime

public class CRuntime.CTypeInfo<T extends NativeObject>
extends Object
implements BridJRuntime.TypeInfo<T>


Field Summary
protected  Class<T> castClass
           
protected  PointerIO<T> pointerIO
           
protected  StructIO structIO
           
protected  Type type
           
protected  Class<T> typeClass
           
 
Constructor Summary
CRuntime.CTypeInfo(Type type)
           
 
Method Summary
 T cast(Pointer peer)
           
 T clone(T instance)
           
 int compare(T instance, T other)
           
 void copyNativeObjectToAddress(T instance, Pointer<T> ptr)
           
 T createReturnInstance()
           
 String describe()
           
 String describe(T instance)
           
 void destroy(T instance)
           
 boolean equal(T instance, T other)
           
protected  Class<T> getCastClass()
           
 BridJRuntime getRuntime()
           
 Type getType()
           
 void initialize(T instance)
           
 void initialize(T instance, int constructorId, Object... args)
           
 void initialize(T instance, Pointer peer)
           
protected  T newCastInstance()
           
 void readFromNative(T instance)
           
 long sizeOf()
           
 void writeToNative(T instance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected final Type type

typeClass

protected final Class<T extends NativeObject> typeClass

structIO

protected final StructIO structIO

pointerIO

protected final PointerIO<T extends NativeObject> pointerIO

castClass

protected volatile Class<T extends NativeObject> castClass
Constructor Detail

CRuntime.CTypeInfo

public CRuntime.CTypeInfo(Type type)
Method Detail

sizeOf

public long sizeOf()
Specified by:
sizeOf in interface BridJRuntime.TypeInfo<T extends NativeObject>

equal

public boolean equal(T instance,
                     T other)
Specified by:
equal in interface BridJRuntime.TypeInfo<T extends NativeObject>

compare

public int compare(T instance,
                   T other)
Specified by:
compare in interface BridJRuntime.TypeInfo<T extends NativeObject>

getRuntime

public BridJRuntime getRuntime()
Specified by:
getRuntime in interface BridJRuntime.TypeInfo<T extends NativeObject>

getType

public Type getType()
Specified by:
getType in interface BridJRuntime.TypeInfo<T extends NativeObject>

getCastClass

protected Class<T> getCastClass()

newCastInstance

protected T newCastInstance()
                                          throws NoSuchMethodException,
                                                 InstantiationException,
                                                 IllegalAccessException,
                                                 IllegalArgumentException,
                                                 InvocationTargetException
Throws:
NoSuchMethodException
InstantiationException
IllegalAccessException
IllegalArgumentException
InvocationTargetException

cast

public T cast(Pointer peer)
Specified by:
cast in interface BridJRuntime.TypeInfo<T extends NativeObject>

createReturnInstance

public T createReturnInstance()
Specified by:
createReturnInstance in interface BridJRuntime.TypeInfo<T extends NativeObject>

writeToNative

public void writeToNative(T instance)
Specified by:
writeToNative in interface BridJRuntime.TypeInfo<T extends NativeObject>

readFromNative

public void readFromNative(T instance)
Specified by:
readFromNative in interface BridJRuntime.TypeInfo<T extends NativeObject>

copyNativeObjectToAddress

public void copyNativeObjectToAddress(T instance,
                                      Pointer<T> ptr)
Specified by:
copyNativeObjectToAddress in interface BridJRuntime.TypeInfo<T extends NativeObject>

describe

public String describe(T instance)
Specified by:
describe in interface BridJRuntime.TypeInfo<T extends NativeObject>

describe

public String describe()
Specified by:
describe in interface BridJRuntime.TypeInfo<T extends NativeObject>

initialize

public void initialize(T instance)
Specified by:
initialize in interface BridJRuntime.TypeInfo<T extends NativeObject>

initialize

public void initialize(T instance,
                       Pointer peer)
Specified by:
initialize in interface BridJRuntime.TypeInfo<T extends NativeObject>

initialize

public void initialize(T instance,
                       int constructorId,
                       Object... args)
Specified by:
initialize in interface BridJRuntime.TypeInfo<T extends NativeObject>

clone

public T clone(T instance)
                             throws CloneNotSupportedException
Specified by:
clone in interface BridJRuntime.TypeInfo<T extends NativeObject>
Throws:
CloneNotSupportedException

destroy

public void destroy(T instance)
Specified by:
destroy in interface BridJRuntime.TypeInfo<T extends NativeObject>


Copyright © 2009-2012. All Rights Reserved.