public static final NativeType valueOf(IRubyObject type) { if (type instanceof Type) { return ((Type) type).getNativeType(); } else { return NativeType.VOID; } } }
public static final NativeType valueOf(IRubyObject type) { if (type instanceof Type) { return ((Type) type).getNativeType(); } else { return NativeType.VOID; } } }
public static final NativeType valueOf(IRubyObject type) { if (type instanceof Type) { return ((Type) type).getNativeType(); } else { return NativeType.VOID; } } }
public static final NativeType valueOf(IRubyObject type) { if (type instanceof Type) { return ((Type) type).getNativeType(); } else { return NativeType.VOID; } } }
public NativeType nativeType() { return converter.getRealType().getNativeType(); }
public NativeType nativeType() { return converter.getRealType().getNativeType(); }
public NativeType nativeType() { return converter.getRealType().getNativeType(); }
public NativeType nativeType() { return converter.getRealType().getNativeType(); }
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); }
public static MemoryOp getMemoryOp(Type type, ByteOrder order) { if (type instanceof Type.Builtin) { return getMemoryOp(type.getNativeType(), order); } else if (type instanceof StructByValue) { StructByValue sbv = (StructByValue) type; return new StructOp(sbv.getStructClass()); } else if (type instanceof MappedType) { return new Mapped(getMemoryOp(((MappedType) type).getRealType(), order), (MappedType) type); } return null; }
public static MemoryOp getMemoryOp(Type type, ByteOrder order) { if (type instanceof Type.Builtin) { return getMemoryOp(type.getNativeType(), order); } else if (type instanceof StructByValue) { StructByValue sbv = (StructByValue) type; return new StructOp(sbv.getStructClass()); } else if (type instanceof MappedType) { return new Mapped(getMemoryOp(((MappedType) type).getRealType(), order), (MappedType) type); } return null; }
public static MemoryOp getMemoryOp(Type type, ByteOrder order) { if (type instanceof Type.Builtin) { return getMemoryOp(type.getNativeType(), order); } else if (type instanceof StructByValue) { StructByValue sbv = (StructByValue) type; return new StructOp(sbv.getStructClass()); } else if (type instanceof MappedType) { return new Mapped(getMemoryOp(((MappedType) type).getRealType(), order), (MappedType) type); } return null; }
public static MemoryOp getMemoryOp(Type type, ByteOrder order) { if (type instanceof Type.Builtin) { return getMemoryOp(type.getNativeType(), order); } else if (type instanceof StructByValue) { StructByValue sbv = (StructByValue) type; return new StructOp(sbv.getStructClass()); } else if (type instanceof MappedType) { return new Mapped(getMemoryOp(((MappedType) type).getRealType(), order), (MappedType) type); } return null; }
/** * Gets a marshaller to convert from a ruby type to a native type. * * @param type The native type to convert to. * @param enums The enum map * @return A new <tt>ParameterMarshaller</tt> */ static ParameterMarshaller getEnumMarshaller(Type type, CallingConvention convention, IRubyObject enums) { if (!(enums instanceof RubyHash)) { throw type.getRuntime().newArgumentError("wrong argument type " + enums.getMetaClass().getName() + " (expected Hash)"); } NativeDataConverter converter = DataConverters.getParameterConverter(type, (RubyHash) enums); ParameterMarshaller marshaller = getMarshaller(type.getNativeType()); return converter != null ? new ConvertingMarshaller(marshaller, converter) : marshaller; }
/** * Gets a marshaller to convert from a ruby type to a native type. * * @param type The native type to convert to. * @param enums The enum map * @return A new <tt>ParameterMarshaller</tt> */ static ParameterMarshaller getEnumMarshaller(Type type, CallingConvention convention, IRubyObject enums) { if (enums != null && !enums.isNil() && !(enums instanceof RubyHash || enums instanceof Enums)) { throw type.getRuntime().newArgumentError("wrong argument type " + enums.getMetaClass().getName() + " (expected Hash or Enums)"); } NativeDataConverter converter = DataConverters.getParameterConverter(type, (Enums)enums); ParameterMarshaller marshaller = getMarshaller(type.getNativeType()); return converter != null ? new ConvertingMarshaller(marshaller, converter) : marshaller; }
/** * Gets a marshaller to convert from a ruby type to a native type. * * @param type The native type to convert to. * @param enums The enum map * @return A new <tt>ParameterMarshaller</tt> */ static ParameterMarshaller getEnumMarshaller(Type type, CallingConvention convention, IRubyObject enums) { if (enums != null && !enums.isNil() && !(enums instanceof RubyHash || enums instanceof Enums)) { throw type.getRuntime().newArgumentError("wrong argument type " + enums.getMetaClass().getName() + " (expected Hash or Enums)"); } NativeDataConverter converter = DataConverters.getParameterConverter(type, (Enums)enums); ParameterMarshaller marshaller = getMarshaller(type.getNativeType()); return converter != null ? new ConvertingMarshaller(marshaller, converter) : marshaller; }
static FunctionInvoker getFunctionInvoker(Type returnType) { if (returnType instanceof Type.Builtin) { return getFunctionInvoker(returnType.getNativeType()); } else if (returnType instanceof CallbackInfo) { return new ConvertingInvoker(getFunctionInvoker(NativeType.POINTER), DataConverters.getResultConverter(returnType)); } else if (returnType instanceof StructByValue) { return new StructByValueInvoker((StructByValue) returnType); } else if (returnType instanceof MappedType) { MappedType ctype = (MappedType) returnType; return new ConvertingInvoker(getFunctionInvoker(ctype.getRealType()), DataConverters.getResultConverter(ctype)); } throw returnType.getRuntime().newArgumentError("Cannot get FunctionInvoker for " + returnType); }