org.bridj
Class CRuntime
java.lang.Object
org.bridj.AbstractBridJRuntime
org.bridj.CRuntime
- All Implemented Interfaces:
- BridJRuntime
- Direct Known Subclasses:
- CPPRuntime, ObjectiveCRuntime
public class CRuntime
- extends AbstractBridJRuntime
C runtime (used by default when no Runtime annotation is found).
Deals with registration and lifecycle of structs, functions, callbacks.
A shared C runtime instance can be retrieved with getInstance().
- Author:
- ochafik
PROPERTY_bridj_c_defaultObjectSize
public static final String PROPERTY_bridj_c_defaultObjectSize
- See Also:
- Constant Field Values
CRuntime
@Deprecated
public CRuntime()
- Deprecated. use
getInstance() instead
getCallbackNativeImplementer
public org.bridj.CallbackNativeImplementer getCallbackNativeImplementer()
isAvailable
public boolean isAvailable()
getInstance
public static CRuntime getInstance()
getActualInstanceClass
public <T extends NativeObject> Class<? extends T> getActualInstanceClass(Pointer<T> pInstance,
Type officialType)
getTypeInfo
public <T extends NativeObject> BridJRuntime.TypeInfo<T> getTypeInfo(Type type)
register
public void register(Type type)
unregister
public void unregister(Type type)
- Specified by:
unregister in interface BridJRuntime- Overrides:
unregister in class AbstractBridJRuntime
allocate
public <T extends NativeObject> Pointer<T> allocate(Class<T> type,
int constructorId,
Object... args)
getDefaultStructSize
public int getDefaultStructSize()
sizeOf
public long sizeOf(Type structType,
StructIO io)
getTypeForCast
public <T extends NativeObject> Class<? extends T> getTypeForCast(Type type)
getDynamicFunctionFactory
public DynamicFunctionFactory getDynamicFunctionFactory(NativeLibrary library,
Convention.Style callingConvention,
Type returnType,
Type... parameterTypes)
- Get a shared factory of native function wrappers that have a given signatures.
- Parameters:
library - library to which the allocated native thunks will be bound (can be null, in which case the native allocations will be bound to BridJ.getOrphanEntities())callingConvention - calling convention used by the functions (if null, default is typically Convention.Style.CDecl)returnType - return type of the functionsparameterTypes - parameter types of the functions
Also see DynamicFunction and Pointer.asDynamicFunction(org.bridj.ann.Convention.Style, java.lang.reflect.Type, java.lang.reflect.Type[]).
createCToJavaCallback
public static <T> Pointer<T> createCToJavaCallback(MethodCallInfo mci,
Type t)
Copyright © 2009-2013. All Rights Reserved.