public DefaultMethod(RubyModule implementationClass, Function function, Signature signature, NativeInvoker defaultInvoker) { super(implementationClass, Visibility.PUBLIC, CallConfiguration.FrameNoneScopeNone); this.arity = Arity.fixed(signature.getParameterCount()); this.function = function; this.defaultInvoker = defaultInvoker; this.signature = signature; }
public DefaultMethod(RubyModule implementationClass, Function function, Signature signature, NativeInvoker defaultInvoker) { super(implementationClass, Visibility.PUBLIC, CallConfiguration.FrameNoneScopeNone); this.arity = Arity.fixed(signature.getParameterCount()); this.function = function; this.defaultInvoker = defaultInvoker; this.signature = signature; }
public DefaultMethod(RubyModule implementationClass, Function function, Signature signature, NativeInvoker defaultInvoker) { super(implementationClass, Visibility.PUBLIC, defaultInvoker.getName()); this.arity = Arity.fixed(signature.getParameterCount()); this.function = function; this.defaultInvoker = defaultInvoker; this.signature = signature; }
public DefaultMethod(RubyModule implementationClass, Function function, Signature signature, NativeInvoker defaultInvoker) { super(implementationClass, Visibility.PUBLIC, defaultInvoker.getName()); this.arity = Arity.fixed(signature.getParameterCount()); this.function = function; this.defaultInvoker = defaultInvoker; this.signature = signature; }
@SuppressWarnings("deprecation") private static NativeDataConverter getParameterConverter(Signature signature, int i) { return signature.getParameterCount() > i ? DataConverters.getParameterConverter(signature.getParameterType(i), signature.getEnums()) : null; }
@SuppressWarnings("deprecation") private static NativeDataConverter getParameterConverter(Signature signature, int i) { return signature.getParameterCount() > i ? DataConverters.getParameterConverter(signature.getParameterType(i), signature.getEnums()) : null; }
private static NativeDataConverter getParameterConverter(Signature signature, int i) { return signature.getParameterCount() > i ? DataConverters.getParameterConverter(signature.getParameterType(i), signature.getEnums()) : null; }
private static NativeDataConverter getParameterConverter(Signature signature, int i) { return signature.getParameterCount() > i ? DataConverters.getParameterConverter(signature.getParameterType(i), signature.getEnums()) : null; }
public NativeInvoker(RubyModule implementationClass, com.kenai.jffi.Function function, Signature signature) { super(implementationClass, Visibility.PUBLIC, CallConfiguration.FrameNoneScopeNone); this.arity = Arity.fixed(signature.getParameterCount()); this.function = function; this.signature = signature; int cbIndex = -1; NativeCallbackFactory cbFactory = null; for (int i = 0; i < signature.getParameterCount(); ++i) { if (signature.getParameterType(i) instanceof CallbackInfo) { cbFactory = CallbackManager.getInstance().getCallbackFactory(implementationClass.getRuntime(), (CallbackInfo) signature.getParameterType(i)); cbIndex = i; break; } } this.cbIndex = cbIndex; this.cbFactory = cbFactory; }
public NativeInvoker(RubyModule implementationClass, com.kenai.jffi.Function function, Signature signature) { super(implementationClass, Visibility.PUBLIC, CallConfiguration.FrameNoneScopeNone); this.arity = Arity.fixed(signature.getParameterCount()); this.function = function; this.signature = signature; int cbIndex = -1; NativeCallbackFactory cbFactory = null; for (int i = 0; i < signature.getParameterCount(); ++i) { if (signature.getParameterType(i) instanceof CallbackInfo) { cbFactory = CallbackManager.getInstance().getCallbackFactory(implementationClass.getRuntime(), (CallbackInfo) signature.getParameterType(i)); cbIndex = i; break; } } this.cbIndex = cbIndex; this.cbFactory = cbFactory; }
public NativeInvoker(RubyModule implementationClass, com.kenai.jffi.Function function, Signature signature) { super(implementationClass, Visibility.PUBLIC, "ffi"+function.getFunctionAddress()); this.arity = Arity.fixed(signature.getParameterCount()); this.function = function; this.signature = signature; int cbIndex = -1; NativeCallbackFactory cbFactory = null; for (int i = 0; i < signature.getParameterCount(); ++i) { if (signature.getParameterType(i) instanceof CallbackInfo) { cbFactory = CallbackManager.getInstance().getCallbackFactory(implementationClass.getRuntime(), (CallbackInfo) signature.getParameterType(i)); cbIndex = i; break; } } this.cbIndex = cbIndex; this.cbFactory = cbFactory; }
public NativeInvoker(RubyModule implementationClass, com.kenai.jffi.Function function, Signature signature) { super(implementationClass, Visibility.PUBLIC, "ffi"+function.getFunctionAddress()); this.arity = Arity.fixed(signature.getParameterCount()); this.function = function; this.signature = signature; int cbIndex = -1; NativeCallbackFactory cbFactory = null; for (int i = 0; i < signature.getParameterCount(); ++i) { if (signature.getParameterType(i) instanceof CallbackInfo) { cbFactory = CallbackManager.getInstance().getCallbackFactory(implementationClass.getRuntime(), (CallbackInfo) signature.getParameterType(i)); cbIndex = i; break; } } this.cbIndex = cbIndex; this.cbFactory = cbFactory; }
JITSignature(Signature signature) { this.resultType = signature.getResultType().getNativeType(); this.parameterTypes = new NativeType[signature.getParameterCount()]; for (int i = 0; i < parameterTypes.length; i++) { parameterTypes[i] = signature.getParameterType(i).getNativeType(); } this.convention = signature.getCallingConvention(); this.ignoreError = signature.isIgnoreError(); // FIXME: calculate these properly this.hasResultConverter = false; this.hasParameterConverter = new boolean[parameterTypes.length]; Arrays.fill(hasParameterConverter, false); }
JITSignature(Signature signature) { this.resultType = signature.getResultType().getNativeType(); this.parameterTypes = new NativeType[signature.getParameterCount()]; for (int i = 0; i < parameterTypes.length; i++) { parameterTypes[i] = signature.getParameterType(i).getNativeType(); } this.convention = signature.getCallingConvention(); this.ignoreError = signature.isIgnoreError(); // FIXME: calculate these properly this.hasResultConverter = false; this.hasParameterConverter = new boolean[parameterTypes.length]; Arrays.fill(hasParameterConverter, false); }
JITSignature(Signature signature) { this.resultType = signature.getResultType().getNativeType(); this.parameterTypes = new NativeType[signature.getParameterCount()]; for (int i = 0; i < parameterTypes.length; i++) { parameterTypes[i] = signature.getParameterType(i).getNativeType(); } this.convention = signature.getCallingConvention(); this.ignoreError = signature.isIgnoreError(); // FIXME: calculate these properly this.hasResultConverter = false; this.hasParameterConverter = new boolean[parameterTypes.length]; Arrays.fill(hasParameterConverter, false); }
JITSignature(Signature signature) { this.resultType = signature.getResultType().getNativeType(); this.parameterTypes = new NativeType[signature.getParameterCount()]; for (int i = 0; i < parameterTypes.length; i++) { parameterTypes[i] = signature.getParameterType(i).getNativeType(); } this.convention = signature.getCallingConvention(); this.ignoreError = signature.isIgnoreError(); // FIXME: calculate these properly this.hasResultConverter = false; this.hasParameterConverter = new boolean[parameterTypes.length]; Arrays.fill(hasParameterConverter, false); }
private static CachingCallSite getParameterCallSite(Signature signature, int parameterIndex) { if (signature.getParameterCount() <= parameterIndex) { return null; } Type type = signature.getParameterType(parameterIndex); NativeType nativeType = type instanceof MappedType ? ((MappedType) type).getRealType().getNativeType() : type.getNativeType(); switch (nativeType) { case STRING: case TRANSIENT_STRING: return new FunctionalCachingCallSite("to_str"); case POINTER: case BUFFER_IN: case BUFFER_OUT: case BUFFER_INOUT: return new FunctionalCachingCallSite("to_ptr"); default: return null; } }
private static CachingCallSite getParameterCallSite(Signature signature, int parameterIndex) { if (signature.getParameterCount() <= parameterIndex) { return null; } Type type = signature.getParameterType(parameterIndex); NativeType nativeType = type instanceof MappedType ? ((MappedType) type).getRealType().getNativeType() : type.getNativeType(); switch (nativeType) { case STRING: case TRANSIENT_STRING: return new FunctionalCachingCallSite("to_str"); case POINTER: case BUFFER_IN: case BUFFER_OUT: case BUFFER_INOUT: return new FunctionalCachingCallSite("to_ptr"); default: return null; } }
private static CachingCallSite getParameterCallSite(Signature signature, int parameterIndex) { if (signature.getParameterCount() <= parameterIndex) { return null; } Type type = signature.getParameterType(parameterIndex); NativeType nativeType = type instanceof MappedType ? ((MappedType) type).getRealType().getNativeType() : type.getNativeType(); switch (nativeType) { case STRING: case TRANSIENT_STRING: return new FunctionalCachingCallSite("to_str"); case POINTER: case BUFFER_IN: case BUFFER_OUT: case BUFFER_INOUT: return new FunctionalCachingCallSite("to_ptr"); default: return null; } }
private static CachingCallSite getParameterCallSite(Signature signature, int parameterIndex) { if (signature.getParameterCount() <= parameterIndex) { return null; } Type type = signature.getParameterType(parameterIndex); NativeType nativeType = type instanceof MappedType ? ((MappedType) type).getRealType().getNativeType() : type.getNativeType(); switch (nativeType) { case STRING: case TRANSIENT_STRING: return new FunctionalCachingCallSite("to_str"); case POINTER: case BUFFER_IN: case BUFFER_OUT: case BUFFER_INOUT: return new FunctionalCachingCallSite("to_ptr"); default: return null; } }