org.bridj.cpp
Class CPPRuntime
java.lang.Object
org.bridj.AbstractBridJRuntime
org.bridj.CRuntime
org.bridj.cpp.CPPRuntime
- All Implemented Interfaces:
- BridJRuntime
- Direct Known Subclasses:
- COMRuntime, MFCRuntime
public class CPPRuntime
- extends CRuntime
C++ runtime (derives from the C runtime).
Deals with registration and lifecycle of C++ classes and methods (virtual or not).
- Author:
- ochafik
Method Summary |
protected CPPRuntime.ClassTypeVariableExtractor |
createClassTypeVariableExtractor(TypeVariable<Class<?>> var)
|
protected CPPRuntime.MethodTypeVariableExtractor |
createMethodTypeVariableExtractor(TypeVariable<?> var)
|
|
getActualInstanceClass(Pointer<T> pInstance,
Type officialType)
|
protected static int |
getAnnotatedTemplateTypeVariableIndexInArguments(TypeVariable<?> var)
|
|
getCPPTypeInfo(Type type)
|
static CPPRuntime |
getInstance()
|
CPPRuntime.MemoryOperators |
getMemoryOperators()
|
int |
getPositionInVirtualTable(Pointer<Pointer<?>> pVirtualTable,
Method method,
NativeLibrary library)
|
Object[] |
getTemplateParameters(CPPObject object,
Class<?> typeClass)
|
|
getTypeInfo(Type type)
|
int |
getVirtualMethodsCount(Class<?> type)
|
protected boolean |
installRegularVTablePtr(Type type,
NativeLibrary library,
Pointer<?> peer)
|
protected boolean |
installSyntheticVTablePtr(Type type,
NativeLibrary library,
Pointer<?> peer)
|
protected void |
listVirtualMethods(Class<?> type,
List<CPPRuntime.VirtMeth> out)
|
protected
|
newCPPInstance(T instance,
Type type,
int constructorId,
Object... args)
|
protected void |
registerNativeMethod(Class<?> type,
NativeLibrary typeLibrary,
Method method,
NativeLibrary methodLibrary,
NativeEntities.Builder builder,
CRuntime.MethodCallInfoBuilder methodCallInfoBuilder)
|
void |
setTemplateParameters(CPPObject object,
Class<?> typeClass,
Object[] params)
|
protected org.bridj.cpp.CPPRuntime.VTable |
synthetizeVirtualTable(Type type,
Pointer<Pointer> parentVTablePtr,
List<CPPRuntime.VirtMeth> methods,
NativeLibrary library)
|
Methods inherited from class org.bridj.CRuntime |
allocate, createCToJavaCallback, getCallbackNativeImplementer, getDefaultStructSize, getDynamicFunctionFactory, getNativeLibrary, getSeverityOfMissingSymbol, getTypeForCast, getUniqueAbstractCallbackMethod, isAvailable, register, registerCallbackInstance, registerFamily, setNativeObjectPeer, sizeOf |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_CONSTRUCTOR
public static final int DEFAULT_CONSTRUCTOR
- See Also:
- Constant Field Values
SKIP_CONSTRUCTOR
public static final int SKIP_CONSTRUCTOR
- See Also:
- Constant Field Values
CPPRuntime
public CPPRuntime()
getInstance
public static CPPRuntime getInstance()
getTemplateParameters
public Object[] getTemplateParameters(CPPObject object,
Class<?> typeClass)
setTemplateParameters
public void setTemplateParameters(CPPObject object,
Class<?> typeClass,
Object[] params)
getAnnotatedTemplateTypeVariableIndexInArguments
protected static int getAnnotatedTemplateTypeVariableIndexInArguments(TypeVariable<?> var)
createClassTypeVariableExtractor
protected CPPRuntime.ClassTypeVariableExtractor createClassTypeVariableExtractor(TypeVariable<Class<?>> var)
createMethodTypeVariableExtractor
protected CPPRuntime.MethodTypeVariableExtractor createMethodTypeVariableExtractor(TypeVariable<?> var)
getActualInstanceClass
public <T extends NativeObject> Class<? extends T> getActualInstanceClass(Pointer<T> pInstance,
Type officialType)
- Specified by:
getActualInstanceClass
in interface BridJRuntime
- Overrides:
getActualInstanceClass
in class CRuntime
getVirtualMethodsCount
public int getVirtualMethodsCount(Class<?> type)
listVirtualMethods
protected void listVirtualMethods(Class<?> type,
List<CPPRuntime.VirtMeth> out)
registerNativeMethod
protected void registerNativeMethod(Class<?> type,
NativeLibrary typeLibrary,
Method method,
NativeLibrary methodLibrary,
NativeEntities.Builder builder,
CRuntime.MethodCallInfoBuilder methodCallInfoBuilder)
throws FileNotFoundException
- Overrides:
registerNativeMethod
in class CRuntime
- Throws:
FileNotFoundException
getMemoryOperators
public CPPRuntime.MemoryOperators getMemoryOperators()
getPositionInVirtualTable
public int getPositionInVirtualTable(Pointer<Pointer<?>> pVirtualTable,
Method method,
NativeLibrary library)
installRegularVTablePtr
protected boolean installRegularVTablePtr(Type type,
NativeLibrary library,
Pointer<?> peer)
installSyntheticVTablePtr
protected boolean installSyntheticVTablePtr(Type type,
NativeLibrary library,
Pointer<?> peer)
synthetizeVirtualTable
protected org.bridj.cpp.CPPRuntime.VTable synthetizeVirtualTable(Type type,
Pointer<Pointer> parentVTablePtr,
List<CPPRuntime.VirtMeth> methods,
NativeLibrary library)
newCPPInstance
protected <T extends CPPObject> Pointer<T> newCPPInstance(T instance,
Type type,
int constructorId,
Object... args)
getTypeInfo
public <T extends NativeObject> BridJRuntime.TypeInfo<T> getTypeInfo(Type type)
- Specified by:
getTypeInfo
in interface BridJRuntime
- Overrides:
getTypeInfo
in class CRuntime
getCPPTypeInfo
public <T extends CPPObject> CPPRuntime.CPPTypeInfo<T> getCPPTypeInfo(Type type)
Copyright © 2009-2012. All Rights Reserved.