private MappedType(Ruby runtime, RubyClass klass, Type nativeType, IRubyObject converter, boolean isRefererenceRequired) { super(runtime, klass, NativeType.MAPPED, nativeType.getNativeSize(), nativeType.getNativeAlignment()); this.realType = nativeType; this.converter = converter; this.isReferenceRequired = isRefererenceRequired; }
/** * Initializes a new <tt>Type</tt> instance. */ protected Type(Ruby runtime, RubyClass klass, NativeType type) { super(runtime, klass); this.nativeType = type; this.size = getNativeSize(type); this.alignment = getNativeAlignment(type); }
private MappedType(Ruby runtime, RubyClass klass, Type nativeType, IRubyObject converter, boolean isRefererenceRequired) { super(runtime, klass, NativeType.MAPPED, nativeType.getNativeSize(), nativeType.getNativeAlignment()); this.realType = nativeType; this.converter = converter; this.isReferenceRequired = isRefererenceRequired; }
/** * Initializes a new <tt>Type.Array</tt> instance. */ public Array(Ruby runtime, RubyClass klass, Type componentType, int length) { super(runtime, klass, NativeType.ARRAY, componentType.getNativeSize() * length, componentType.getNativeAlignment()); this.componentType = componentType; this.length = length; }
/** * Initializes a new <tt>Type</tt> instance. */ protected Type(Ruby runtime, RubyClass klass, NativeType type) { super(runtime, klass); this.nativeType = type; this.size = getNativeSize(type); this.alignment = getNativeAlignment(type); }
/** * Initializes a new <tt>Type.Array</tt> instance. */ public Array(Ruby runtime, RubyClass klass, Type componentType, int length) { super(runtime, klass, NativeType.ARRAY, componentType.getNativeSize() * length, componentType.getNativeAlignment()); this.componentType = componentType; this.length = length; }
/** * Initializes a new <tt>Type.Array</tt> instance. */ public Array(Ruby runtime, RubyClass klass, Type componentType, int length) { super(runtime, klass, NativeType.ARRAY, componentType.getNativeSize() * length, componentType.getNativeAlignment()); this.componentType = componentType; this.length = length; }
private MappedType(Ruby runtime, RubyClass klass, Type nativeType, IRubyObject converter, boolean isRefererenceRequired) { super(runtime, klass, NativeType.MAPPED, nativeType.getNativeSize(), nativeType.getNativeAlignment()); this.realType = nativeType; this.converter = converter; this.isReferenceRequired = isRefererenceRequired; }
/** * Initializes a new <tt>Type</tt> instance. */ protected Type(Ruby runtime, RubyClass klass, NativeType type) { super(runtime, klass); this.nativeType = type; this.size = getNativeSize(type); this.alignment = getNativeAlignment(type); }
/** * Initializes a new <tt>Type</tt> instance. */ protected Type(Ruby runtime, RubyClass klass, NativeType type) { super(runtime, klass); this.nativeType = type; this.size = getNativeSize(type); this.alignment = getNativeAlignment(type); }
/** * Initializes a new <tt>Type.Array</tt> instance. */ public Array(Ruby runtime, RubyClass klass, Type componentType, int length) { super(runtime, klass, NativeType.ARRAY, componentType.getNativeSize() * length, componentType.getNativeAlignment()); this.componentType = componentType; this.length = length; }
private MappedType(Ruby runtime, RubyClass klass, Type nativeType, IRubyObject converter, boolean isRefererenceRequired) { super(runtime, klass, NativeType.MAPPED, nativeType.getNativeSize(), nativeType.getNativeAlignment()); this.realType = nativeType; this.converter = converter; this.isReferenceRequired = isRefererenceRequired; }
/** * Gets the native size of this <tt>Type</tt> in bytes * * @param context The Ruby thread context. * @return The native size of this Type. */ @JRubyMethod(name = "size") public IRubyObject size(ThreadContext context) { return context.runtime.newFixnum(getNativeSize()); }
/** * Gets the native size of this <tt>Type</tt> in bytes * * @param context The Ruby thread context. * @return The native size of this Type. */ @JRubyMethod(name = "size") public IRubyObject size(ThreadContext context) { return context.runtime.newFixnum(getNativeSize()); }
/** * Gets the native size of this <tt>Type</tt> in bytes * * @param context The Ruby thread context. * @return The native size of this Type. */ @JRubyMethod(name = "size") public IRubyObject size(ThreadContext context) { return context.runtime.newFixnum(getNativeSize()); }
/** * Gets the native size of this <tt>Type</tt> in bytes * * @param context The Ruby thread context. * @return The native size of this Type. */ @JRubyMethod(name = "size") public IRubyObject size(ThreadContext context) { return context.runtime.newFixnum(getNativeSize()); }
private long getOffset(int index) { if (index < 0 || (index >= arrayType.length() && arrayType.length() > 0)) { throw getRuntime().newIndexError("index " + index + " out of bounds"); } return index * (long) arrayType.getComponentType().getNativeSize(); }
private final long getOffset(int index) { if (index < 0 || (index >= arrayType.length() && arrayType.length() > 0)) { throw getRuntime().newIndexError("index " + index + " out of bounds"); } return (long) (index * arrayType.getComponentType().getNativeSize()); }
private long getOffset(int index) { if (index < 0 || (index >= arrayType.length() && arrayType.length() > 0)) { throw getRuntime().newIndexError("index " + index + " out of bounds"); } return index * (long) arrayType.getComponentType().getNativeSize(); }
private final long getOffset(int index) { if (index < 0 || (index >= arrayType.length() && arrayType.length() > 0)) { throw getRuntime().newIndexError("index " + index + " out of bounds"); } return (long) (index * arrayType.getComponentType().getNativeSize()); }