org.jruby.ext.ffi
Class AbstractMemory

java.lang.Object
  extended by org.jruby.RubyBasicObject
      extended by org.jruby.RubyObject
          extended by org.jruby.ext.ffi.AbstractMemory
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<IRubyObject>, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType
Direct Known Subclasses:
Buffer, Pointer

public abstract class AbstractMemory
extends RubyObject

A abstract memory object that defines operations common to both pointers and memory buffers

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Data
 
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer
 
Field Summary
static java.lang.String ABSTRACT_MEMORY_RUBY_CLASS
           
protected  MemoryIO io
          The Memory I/O object
protected  long size
          The total size of the memory area
protected  int typeSize
          The size of each element of this memory area - e.g.
 
Fields inherited from class org.jruby.RubyObject
OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR
 
Fields inherited from class org.jruby.RubyBasicObject
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Constructor Summary
protected AbstractMemory(Ruby runtime, RubyClass klass, MemoryIO io, long size)
           
protected AbstractMemory(Ruby runtime, RubyClass klass, MemoryIO io, long size, int typeSize)
           
 
Method Summary
 IRubyObject aref(ThreadContext context, IRubyObject indexArg)
           
protected static int calculateTypeSize(ThreadContext context, IRubyObject sizeArg)
           
protected static RubyArray checkArray(IRubyObject obj)
           
 IRubyObject clear(ThreadContext context)
          Clears (zeros out) the memory contents.
static RubyClass createAbstractMemoryClass(Ruby runtime, RubyModule module)
           
 boolean eql(IRubyObject other)
          method used for Hash key comparison (specialized for String, Symbol and Fixnum) Will by default just call the Ruby method "eql?"
 boolean equals(java.lang.Object obj)
          Compares this MemoryPointer to another MemoryPointer.
 IRubyObject get_array_of_float(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of signed 32 bit floating point values from the memory address.
 IRubyObject get_array_of_float64(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of signed 64 bit floating point values from the memory address.
 IRubyObject get_array_of_int16(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of signed 16 bit integer values from the memory address.
 IRubyObject get_array_of_int32(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of signed 32 bit integer values from the memory address.
 IRubyObject get_array_of_int64(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of signed 64 bit integer values from the memory address.
 IRubyObject get_array_of_int8(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of signed 8 bit integer values from the memory address.
 IRubyObject get_array_of_long(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of signed long integer values from the memory address.
 IRubyObject get_array_of_pointer(ThreadContext context, IRubyObject offset, IRubyObject length)
           
 IRubyObject get_array_of_string(ThreadContext context, IRubyObject rbOffset)
           
 IRubyObject get_array_of_string(ThreadContext context, IRubyObject rbOffset, IRubyObject rbCount)
           
 IRubyObject get_array_of_uint16(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of unsigned 16 bit integer values from the memory address.
 IRubyObject get_array_of_uint32(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of unsigned 32 bit integer values from the memory address.
 IRubyObject get_array_of_uint64(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of unsigned 64 bit integer values from the memory address.
 IRubyObject get_array_of_uint8(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of unsigned 8 bit integer values from the memory address.
 IRubyObject get_array_of_ulong(ThreadContext context, IRubyObject offset, IRubyObject length)
          Reads an array of unsigned long integer values from the memory address.
 IRubyObject get_bytes(ThreadContext context, IRubyObject offArg, IRubyObject lenArg)
           
 IRubyObject get_float32(ThreadContext context)
          Reads a 32 bit floating point value from the memory address.
 IRubyObject get_float32(ThreadContext context, IRubyObject offset)
          Reads a 32 bit floating point value from the memory address.
 IRubyObject get_float64(ThreadContext context)
          Reads a 64 bit floating point value from the memory address.
 IRubyObject get_float64(ThreadContext context, IRubyObject offset)
          Reads a 64 bit floating point value from the memory address.
 IRubyObject get_int16(ThreadContext context)
          Reads a 16 bit signed integer value from the memory address.
 IRubyObject get_int16(ThreadContext context, IRubyObject offset)
          Reads a 16 bit signed integer value from the memory address.
 IRubyObject get_int32(ThreadContext context)
          Reads a 32 bit signed integer value from the memory address.
 IRubyObject get_int32(ThreadContext context, IRubyObject offset)
          Reads a 32 bit signed integer value from the memory address.
 IRubyObject get_int64(ThreadContext context)
          Reads a 64 bit integer value from the memory address.
 IRubyObject get_int64(ThreadContext context, IRubyObject offset)
          Reads a 64 bit integer value from the memory address.
 IRubyObject get_int8(ThreadContext context)
          Reads an 8 bit signed integer value from the memory address.
 IRubyObject get_int8(ThreadContext context, IRubyObject offset)
          Reads an 8 bit signed integer value from the memory address.
 IRubyObject get_long(ThreadContext context)
          Reads a C long integer value from the memory area.
 IRubyObject get_long(ThreadContext context, IRubyObject offset)
          Reads a C long integer value from the memory area.
 IRubyObject get_pointer(ThreadContext context)
           
 IRubyObject get_pointer(ThreadContext context, IRubyObject offset)
           
 IRubyObject get_string(ThreadContext context)
           
 IRubyObject get_string(ThreadContext context, IRubyObject offArg)
           
 IRubyObject get_string(ThreadContext context, IRubyObject offArg, IRubyObject lenArg)
           
 IRubyObject get_uint16(ThreadContext context)
          Reads a 16 bit unsigned integer value from the memory address.
 IRubyObject get_uint16(ThreadContext context, IRubyObject offset)
          Reads a 16 bit unsigned integer value from the memory address.
 IRubyObject get_uint32(ThreadContext context)
          Reads a 32 bit unsigned integer value from the memory address.
 IRubyObject get_uint32(ThreadContext context, IRubyObject offset)
          Reads a 32 bit unsigned integer value from the memory address.
 IRubyObject get_uint64(ThreadContext context)
          Reads a 64 bit unsigned integer value from the memory address.
 IRubyObject get_uint64(ThreadContext context, IRubyObject offset)
          Reads a 64 bit unsigned integer value from the memory address.
 IRubyObject get_uint8(ThreadContext context)
          Reads an 8 bit unsigned integer value from the memory address.
 IRubyObject get_uint8(ThreadContext context, IRubyObject offset)
          Reads an 8 bit unsigned integer value from the memory address.
 IRubyObject get_ulong(ThreadContext context)
          Reads a C unsigned long integer value from the memory area.
 IRubyObject get_ulong(ThreadContext context, IRubyObject offset)
          Reads a C unsigned long integer value from the memory area.
 MemoryIO getMemoryIO()
          Gets the memory I/O accessor to read/write to the memory area.
protected  long getOffset(IRubyObject offset)
          Calculates the absolute offset within the base memory pointer for a given offset.
protected abstract  Pointer getPointer(Ruby runtime, long offset)
           
 long getSize()
          Gets the size of the memory area.
 RubyFixnum hash(ThreadContext context)
          Calculates a hash code for the pointer.
 int hashCode()
          Calculates the hash code for this MemoryPointer
 IRubyObject op_equal(ThreadContext context, IRubyObject obj)
           
 IRubyObject op_plus(ThreadContext context, IRubyObject value)
           
abstract  AbstractMemory order(Ruby runtime, java.nio.ByteOrder order)
           
 IRubyObject order(ThreadContext context)
           
 IRubyObject order(ThreadContext context, IRubyObject byte_order)
           
 IRubyObject put_array_of_float(ThreadContext context, IRubyObject offset, IRubyObject arrParam)
          Writes an array of 32 bit floating point values to the memory area.
 IRubyObject put_array_of_float64(ThreadContext context, IRubyObject offset, IRubyObject arrParam)
          Writes an array of 64 bit floating point values to the memory area.
 IRubyObject put_array_of_int16(ThreadContext context, IRubyObject offset, IRubyObject arrParam)
          Writes an array of signed 16 bit integer values to the memory area.
 IRubyObject put_array_of_int32(ThreadContext context, IRubyObject offset, IRubyObject arrParam)
          Writes an array of signed 32 bit integer values to the memory area.
 IRubyObject put_array_of_int64(ThreadContext context, IRubyObject offset, IRubyObject arrParam)
          Writes an array of signed 64 bit integer values to the memory area.
 IRubyObject put_array_of_int8(ThreadContext context, IRubyObject offset, IRubyObject arrParam)
          Writes an array of signed 8 bit integer values to the memory area.
 IRubyObject put_array_of_long(ThreadContext context, IRubyObject offset, IRubyObject arr)
          Writes an array of signed long integer values to the memory area.
 IRubyObject put_array_of_pointer(ThreadContext context, IRubyObject offset, IRubyObject arrParam)
           
 IRubyObject put_array_of_uint16(ThreadContext context, IRubyObject offset, IRubyObject arrParam)
          Writes an array of unsigned 16 bit integer values to the memory area.
 IRubyObject put_array_of_uint32(ThreadContext context, IRubyObject offset, IRubyObject arrParam)
          Writes an array of unsigned 32 bit integer values to the memory area.
 IRubyObject put_array_of_uint64(ThreadContext context, IRubyObject offset, IRubyObject arrParam)
          Writes an array of unsigned 64 bit integer values to the memory area.
 IRubyObject put_array_of_uint8(ThreadContext context, IRubyObject offset, IRubyObject arrParam)
          Writes an array of unsigned 8 bit integer values to the memory area.
 IRubyObject put_array_of_ulong(ThreadContext context, IRubyObject offset, IRubyObject arr)
          Writes an array of unsigned long integer values to the memory area.
 IRubyObject put_bytes(ThreadContext context, IRubyObject[] args)
           
 IRubyObject put_callback(ThreadContext context, IRubyObject offset, IRubyObject proc, IRubyObject cbInfo)
           
 IRubyObject put_float32(ThreadContext context, IRubyObject value)
          Writes an 32 bit floating point value to the memory area.
 IRubyObject put_float32(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes an 32 bit floating point value to the memory area.
 IRubyObject put_float64(ThreadContext context, IRubyObject value)
          Writes an 64 bit floating point value to the memory area.
 IRubyObject put_float64(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes an 64 bit floating point value to the memory area.
 IRubyObject put_int16(ThreadContext context, IRubyObject value)
          Writes a 16 bit signed integer value to the memory address.
 IRubyObject put_int16(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes a 16 bit signed integer value to the memory address.
 IRubyObject put_int32(ThreadContext context, IRubyObject value)
          Writes a 32 bit signed integer value to the memory address.
 IRubyObject put_int32(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes a 32 bit signed integer value to the memory address.
 IRubyObject put_int64(ThreadContext context, IRubyObject value)
          Writes a 64 bit integer value to the memory area.
 IRubyObject put_int64(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes a 64 bit integer value to the memory area.
 IRubyObject put_int8(ThreadContext context, IRubyObject value)
          Writes a 8 bit signed integer value to the memory area.
 IRubyObject put_int8(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes a 8 bit signed integer value to the memory area.
 IRubyObject put_long(ThreadContext context, IRubyObject value)
          Writes a C long integer value to the memory area.
 IRubyObject put_long(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes a C long integer value to the memory area.
 IRubyObject put_pointer(ThreadContext context, IRubyObject value)
           
 IRubyObject put_pointer(ThreadContext context, IRubyObject offset, IRubyObject value)
           
 IRubyObject put_string(ThreadContext context, IRubyObject offArg, IRubyObject strArg)
           
 IRubyObject put_uint16(ThreadContext context, IRubyObject value)
          Writes a 16 bit unsigned integer value to the memory address.
 IRubyObject put_uint16(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes a 16 bit unsigned integer value to the memory address.
 IRubyObject put_uint32(ThreadContext context, IRubyObject value)
          Writes an 32 bit unsigned integer value to the memory address.
 IRubyObject put_uint32(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes an 32 bit unsigned integer value to the memory address.
 IRubyObject put_uint64(ThreadContext context, IRubyObject value)
          Writes a 64 bit unsigned integer value to the memory area.
 IRubyObject put_uint64(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes a 64 bit unsigned integer value to the memory area.
 IRubyObject put_uint8(ThreadContext context, IRubyObject value)
          Writes a 8 bit unsigned integer value to the memory area.
 IRubyObject put_uint8(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes a 8 bit unsigned integer value to the memory area.
 IRubyObject put_ulong(ThreadContext context, IRubyObject value)
          Writes a C long integer value to the memory area.
 IRubyObject put_ulong(ThreadContext context, IRubyObject offset, IRubyObject value)
          Writes a C long integer value to the memory area.
 IRubyObject read_array_of_float(ThreadContext context, IRubyObject length)
          Reads an array of signed 32 bit floating point values from the memory address.
 IRubyObject read_array_of_float64(ThreadContext context, IRubyObject length)
          Reads an array of signed 64 bit floating point values from the memory address.
 IRubyObject read_array_of_int16(ThreadContext context, IRubyObject length)
          Reads an array of signed 16 bit integer values from the memory address.
 IRubyObject read_array_of_int32(ThreadContext context, IRubyObject length)
          Reads an array of signed 32 bit integer values from the memory address.
 IRubyObject read_array_of_int64(ThreadContext context, IRubyObject length)
          Reads an array of signed 64 bit integer values from the memory address.
 IRubyObject read_array_of_int8(ThreadContext context, IRubyObject length)
          Reads an array of signed 8 bit integer values from the memory address.
 IRubyObject read_array_of_long(ThreadContext context, IRubyObject length)
          Reads an array of signed long integer values from the memory address.
 IRubyObject read_array_of_pointer(ThreadContext context, IRubyObject length)
           
 IRubyObject read_array_of_string(ThreadContext context)
           
 IRubyObject read_array_of_string(ThreadContext context, IRubyObject rbLength)
           
 IRubyObject read_array_of_uint16(ThreadContext context, IRubyObject length)
          Reads an array of unsigned 16 bit integer values from the memory address.
 IRubyObject read_array_of_uint32(ThreadContext context, IRubyObject length)
          Reads an array of unsigned 32 bit integer values from the memory address.
 IRubyObject read_array_of_uint64(ThreadContext context, IRubyObject length)
          Reads an array of unsigned 64 bit integer values from the memory address.
 IRubyObject read_array_of_uint8(ThreadContext context, IRubyObject length)
          Reads an array of unsigned 8 bit integer values from the memory address.
 IRubyObject read_array_of_ulong(ThreadContext context, IRubyObject length)
          Reads an array of unsigned long integer values from the memory address.
 IRubyObject read_char(ThreadContext context)
          Reads an 8 bit signed integer value from the memory address.
 IRubyObject read_double(ThreadContext context)
          Reads a 64 bit floating point value from the memory address.
 IRubyObject read_float(ThreadContext context)
          Reads a 32 bit floating point value from the memory address.
 IRubyObject read_int(ThreadContext context)
          Reads a 32 bit signed integer value from the memory address.
 IRubyObject read_long_long(ThreadContext context)
          Reads a 64 bit integer value from the memory address.
 IRubyObject read_long(ThreadContext context)
          Reads a C long integer value from the memory area.
 IRubyObject read_pointer(ThreadContext context)
           
 IRubyObject read_short(ThreadContext context)
          Reads a 16 bit signed integer value from the memory address.
 IRubyObject read_string(ThreadContext context)
           
 IRubyObject read_string(ThreadContext context, IRubyObject rbLength)
           
 IRubyObject read_uchar(ThreadContext context)
          Reads an 8 bit unsigned integer value from the memory address.
 IRubyObject read_uint(ThreadContext context)
          Reads a 32 bit unsigned integer value from the memory address.
 IRubyObject read_ulong_long(ThreadContext context)
          Reads a 64 bit unsigned integer value from the memory address.
 IRubyObject read_ulong(ThreadContext context)
          Reads a C unsigned long integer value from the memory area.
 IRubyObject read_ushort(ThreadContext context)
          Reads a 16 bit unsigned integer value from the memory address.
protected  MemoryIO setMemoryIO(MemoryIO io)
          Replaces the native memory object backing this ruby memory object
protected abstract  AbstractMemory slice(Ruby runtime, long offset)
           
protected abstract  AbstractMemory slice(Ruby runtime, long offset, long size)
           
 IRubyObject to_s(ThreadContext context, IRubyObject[] args)
           
 IRubyObject total(ThreadContext context)
          Gets the total size (in bytes) of the Memory.
 IRubyObject type_size(ThreadContext context)
          Indicates how many bytes the intrinsic type of the memory uses.
 IRubyObject write_array_of_float(ThreadContext context, IRubyObject ary)
          Writes an array of 32 bit floating point values to the memory area.
 IRubyObject write_array_of_float64(ThreadContext context, IRubyObject ary)
          Writes an array of 64 bit floating point values to the memory area.
 IRubyObject write_array_of_int16(ThreadContext context, IRubyObject ary)
          Writes an array of signed 16 bit integer values to the memory area.
 IRubyObject write_array_of_int32(ThreadContext context, IRubyObject ary)
          Writes an array of signed 32 bit integer values to the memory area.
 IRubyObject write_array_of_int64(ThreadContext context, IRubyObject ary)
          Writes an array of signed 64 bit integer values to the memory area.
 IRubyObject write_array_of_int8(ThreadContext context, IRubyObject ary)
          Writes an array of signed 8 bit integer values to the memory area.
 IRubyObject write_array_of_long(ThreadContext context, IRubyObject ary)
          Writes an array of signed long integer values to the memory area.
 IRubyObject write_array_of_pointer(ThreadContext context, IRubyObject arrParam)
           
 IRubyObject write_array_of_uint16(ThreadContext context, IRubyObject ary)
          Writes an array of unsigned 16 bit integer values to the memory area.
 IRubyObject write_array_of_uint32(ThreadContext context, IRubyObject ary)
          Writes an array of unsigned 32 bit integer values to the memory area.
 IRubyObject write_array_of_uint64(ThreadContext context, IRubyObject ary)
          Writes an array of unsigned 64 bit integer values to the memory area.
 IRubyObject write_array_of_uint8(ThreadContext context, IRubyObject ary)
          Writes an array of unsigned 8 bit integer values to the memory area.
 IRubyObject write_array_of_ulong(ThreadContext context, IRubyObject ary)
          Writes an array of unsigned long integer values to the memory area.
 IRubyObject write_char(ThreadContext context, IRubyObject value)
          Writes a 8 bit signed integer value to the memory area.
 IRubyObject write_double(ThreadContext context, IRubyObject value)
          Writes an 64 bit floating point value to the memory area.
 IRubyObject write_float(ThreadContext context, IRubyObject value)
          Writes an 32 bit floating point value to the memory area.
 IRubyObject write_int(ThreadContext context, IRubyObject value)
          Writes a 32 bit signed integer value to the memory address.
 IRubyObject write_long_long(ThreadContext context, IRubyObject value)
          Writes a 64 bit integer value to the memory area.
 IRubyObject write_long(ThreadContext context, IRubyObject value)
          Writes a C long integer value to the memory area.
 IRubyObject write_pointer(ThreadContext context, IRubyObject value)
           
 IRubyObject write_short(ThreadContext context, IRubyObject value)
          Writes a 16 bit signed integer value to the memory address.
 IRubyObject write_uchar(ThreadContext context, IRubyObject value)
          Writes a 8 bit unsigned integer value to the memory area.
 IRubyObject write_uint(ThreadContext context, IRubyObject value)
          Writes an 32 bit unsigned integer value to the memory address.
 IRubyObject write_ulong_long(ThreadContext context, IRubyObject value)
          Writes a 64 bit unsigned integer value to the memory area.
 IRubyObject write_ushort(ThreadContext context, IRubyObject value)
          Writes a 16 bit unsigned integer value to the memory address.
 
Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, getNativeTypeIndex, initialize, op_eqq, puts, specificEval, toString
 
Methods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, dup, ensureInstanceVariablesSettable, eql_p, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMetaClass, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, initialize_copy, initialize19, initialize19, initialize19, initialize19, initialize19, initObjectId, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, op_cmp, op_equal_19, op_match, op_match19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, send19, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, setUntrusted, setVariable, singleton_method_added19, singleton_method_removed19, singleton_method_undefined19, singleton_methods, singleton_methods19, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_s, toJava, trust, type_deprecated, type, untaint, untrust, untrusted_p, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ABSTRACT_MEMORY_RUBY_CLASS

public static final java.lang.String ABSTRACT_MEMORY_RUBY_CLASS
See Also:
Constant Field Values

size

protected long size
The total size of the memory area


typeSize

protected int typeSize
The size of each element of this memory area - e.g. :char is 1, :int is 4


io

protected MemoryIO io
The Memory I/O object

Constructor Detail

AbstractMemory

protected AbstractMemory(Ruby runtime,
                         RubyClass klass,
                         MemoryIO io,
                         long size)

AbstractMemory

protected AbstractMemory(Ruby runtime,
                         RubyClass klass,
                         MemoryIO io,
                         long size,
                         int typeSize)
Method Detail

createAbstractMemoryClass

public static RubyClass createAbstractMemoryClass(Ruby runtime,
                                                  RubyModule module)

calculateTypeSize

protected static final int calculateTypeSize(ThreadContext context,
                                             IRubyObject sizeArg)

checkArray

protected static final RubyArray checkArray(IRubyObject obj)

getMemoryIO

public final MemoryIO getMemoryIO()
Gets the memory I/O accessor to read/write to the memory area.

Returns:
A memory accessor.

setMemoryIO

protected final MemoryIO setMemoryIO(MemoryIO io)
Replaces the native memory object backing this ruby memory object

Parameters:
io - The new memory I/O object
Returns:
The old memory I/O object

getOffset

protected final long getOffset(IRubyObject offset)
Calculates the absolute offset within the base memory pointer for a given offset.

Parameters:
offset - The offset to add to the base offset.
Returns:
The total offset from the base memory pointer.

getSize

public final long getSize()
Gets the size of the memory area.

Returns:
The size of the memory area.

hash

public RubyFixnum hash(ThreadContext context)
Calculates a hash code for the pointer.

Returns:
A RubyFixnum containing the hash code.

to_s

public IRubyObject to_s(ThreadContext context,
                        IRubyObject[] args)

aref

public final IRubyObject aref(ThreadContext context,
                              IRubyObject indexArg)

equals

public boolean equals(java.lang.Object obj)
Compares this MemoryPointer to another MemoryPointer.

Overrides:
equals in class RubyObject
Parameters:
obj - The other MemoryPointer to compare to.
Returns:
true if the memory address of obj is equal to the address of this MemoryPointer.

op_equal

public IRubyObject op_equal(ThreadContext context,
                            IRubyObject obj)
Specified by:
op_equal in interface IRubyObject
Overrides:
op_equal in class RubyBasicObject

eql

public final boolean eql(IRubyObject other)
Description copied from class: RubyBasicObject
method used for Hash key comparison (specialized for String, Symbol and Fixnum) Will by default just call the Ruby method "eql?"

Specified by:
eql in interface IRubyObject
Overrides:
eql in class RubyBasicObject

hashCode

public int hashCode()
Calculates the hash code for this MemoryPointer

Overrides:
hashCode in class RubyObject
Returns:
The hashcode of the memory address.

clear

public IRubyObject clear(ThreadContext context)
Clears (zeros out) the memory contents.


total

public IRubyObject total(ThreadContext context)
Gets the total size (in bytes) of the Memory.

Returns:
The total size in bytes.

type_size

public final IRubyObject type_size(ThreadContext context)
Indicates how many bytes the intrinsic type of the memory uses.

Parameters:
context -
Returns:

write_char

public IRubyObject write_char(ThreadContext context,
                              IRubyObject value)
Writes a 8 bit signed integer value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_int8

public IRubyObject put_int8(ThreadContext context,
                            IRubyObject value)
Writes a 8 bit signed integer value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_int8

public IRubyObject put_int8(ThreadContext context,
                            IRubyObject offset,
                            IRubyObject value)
Writes a 8 bit signed integer value to the memory area.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_char

public IRubyObject read_char(ThreadContext context)
Reads an 8 bit signed integer value from the memory address.

Returns:
The value read from the address.

get_int8

public IRubyObject get_int8(ThreadContext context)
Reads an 8 bit signed integer value from the memory address.

Returns:
The value read from the address.

get_int8

public IRubyObject get_int8(ThreadContext context,
                            IRubyObject offset)
Reads an 8 bit signed integer value from the memory address.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read from the address.

write_uchar

public IRubyObject write_uchar(ThreadContext context,
                               IRubyObject value)
Writes a 8 bit unsigned integer value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_uint8

public IRubyObject put_uint8(ThreadContext context,
                             IRubyObject value)
Writes a 8 bit unsigned integer value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_uint8

public IRubyObject put_uint8(ThreadContext context,
                             IRubyObject offset,
                             IRubyObject value)
Writes a 8 bit unsigned integer value to the memory area.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_uchar

public IRubyObject read_uchar(ThreadContext context)
Reads an 8 bit unsigned integer value from the memory address.

Returns:
The value read from the address.

get_uint8

public IRubyObject get_uint8(ThreadContext context)
Reads an 8 bit unsigned integer value from the memory address.

Returns:
The value read from the address.

get_uint8

public IRubyObject get_uint8(ThreadContext context,
                             IRubyObject offset)
Reads an 8 bit unsigned integer value from the memory address.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read from the address.

write_short

public IRubyObject write_short(ThreadContext context,
                               IRubyObject value)
Writes a 16 bit signed integer value to the memory address.

Parameters:
value - The value to write.
Returns:
The value written.

put_int16

public IRubyObject put_int16(ThreadContext context,
                             IRubyObject value)
Writes a 16 bit signed integer value to the memory address.

Parameters:
value - The value to write.
Returns:
The value written.

put_int16

public IRubyObject put_int16(ThreadContext context,
                             IRubyObject offset,
                             IRubyObject value)
Writes a 16 bit signed integer value to the memory address.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_short

public IRubyObject read_short(ThreadContext context)
Reads a 16 bit signed integer value from the memory address.

Returns:
The value read from the address.

get_int16

public IRubyObject get_int16(ThreadContext context)
Reads a 16 bit signed integer value from the memory address.

Returns:
The value read from the address.

get_int16

public IRubyObject get_int16(ThreadContext context,
                             IRubyObject offset)
Reads a 16 bit signed integer value from the memory address.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read from the address.

write_ushort

public IRubyObject write_ushort(ThreadContext context,
                                IRubyObject value)
Writes a 16 bit unsigned integer value to the memory address.

Parameters:
value - The value to write.
Returns:
The value written.

put_uint16

public IRubyObject put_uint16(ThreadContext context,
                              IRubyObject value)
Writes a 16 bit unsigned integer value to the memory address.

Parameters:
value - The value to write.
Returns:
The value written.

put_uint16

public IRubyObject put_uint16(ThreadContext context,
                              IRubyObject offset,
                              IRubyObject value)
Writes a 16 bit unsigned integer value to the memory address.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_ushort

public IRubyObject read_ushort(ThreadContext context)
Reads a 16 bit unsigned integer value from the memory address.

Returns:
The value read from the address.

get_uint16

public IRubyObject get_uint16(ThreadContext context)
Reads a 16 bit unsigned integer value from the memory address.

Returns:
The value read from the address.

get_uint16

public IRubyObject get_uint16(ThreadContext context,
                              IRubyObject offset)
Reads a 16 bit unsigned integer value from the memory address.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read from the address.

write_int

public IRubyObject write_int(ThreadContext context,
                             IRubyObject value)
Writes a 32 bit signed integer value to the memory address.

Parameters:
value - The value to write.
Returns:
The value written.

put_int32

public IRubyObject put_int32(ThreadContext context,
                             IRubyObject value)
Writes a 32 bit signed integer value to the memory address.

Parameters:
value - The value to write.
Returns:
The value written.

put_int32

public IRubyObject put_int32(ThreadContext context,
                             IRubyObject offset,
                             IRubyObject value)
Writes a 32 bit signed integer value to the memory address.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_int

public IRubyObject read_int(ThreadContext context)
Reads a 32 bit signed integer value from the memory address.

Returns:
The value read from the address.

get_int32

public IRubyObject get_int32(ThreadContext context)
Reads a 32 bit signed integer value from the memory address.

Returns:
The value read from the address.

get_int32

public IRubyObject get_int32(ThreadContext context,
                             IRubyObject offset)
Reads a 32 bit signed integer value from the memory address.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read from the address.

write_uint

public IRubyObject write_uint(ThreadContext context,
                              IRubyObject value)
Writes an 32 bit unsigned integer value to the memory address.

Parameters:
value - The value to write.
Returns:
The value written.

put_uint32

public IRubyObject put_uint32(ThreadContext context,
                              IRubyObject value)
Writes an 32 bit unsigned integer value to the memory address.

Parameters:
value - The value to write.
Returns:
The value written.

put_uint32

public IRubyObject put_uint32(ThreadContext context,
                              IRubyObject offset,
                              IRubyObject value)
Writes an 32 bit unsigned integer value to the memory address.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_uint

public IRubyObject read_uint(ThreadContext context)
Reads a 32 bit unsigned integer value from the memory address.

Returns:
The value read from the address.

get_uint32

public IRubyObject get_uint32(ThreadContext context)
Reads a 32 bit unsigned integer value from the memory address.

Returns:
The value read from the address.

get_uint32

public IRubyObject get_uint32(ThreadContext context,
                              IRubyObject offset)
Reads a 32 bit unsigned integer value from the memory address.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read from the address.

write_long_long

public IRubyObject write_long_long(ThreadContext context,
                                   IRubyObject value)
Writes a 64 bit integer value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_int64

public IRubyObject put_int64(ThreadContext context,
                             IRubyObject value)
Writes a 64 bit integer value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_int64

public IRubyObject put_int64(ThreadContext context,
                             IRubyObject offset,
                             IRubyObject value)
Writes a 64 bit integer value to the memory area.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_long_long

public IRubyObject read_long_long(ThreadContext context)
Reads a 64 bit integer value from the memory address.

Returns:
The value read from the address.

get_int64

public IRubyObject get_int64(ThreadContext context)
Reads a 64 bit integer value from the memory address.

Returns:
The value read from the address.

get_int64

public IRubyObject get_int64(ThreadContext context,
                             IRubyObject offset)
Reads a 64 bit integer value from the memory address.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read from the address.

write_ulong_long

public IRubyObject write_ulong_long(ThreadContext context,
                                    IRubyObject value)
Writes a 64 bit unsigned integer value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_uint64

public IRubyObject put_uint64(ThreadContext context,
                              IRubyObject value)
Writes a 64 bit unsigned integer value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_uint64

public IRubyObject put_uint64(ThreadContext context,
                              IRubyObject offset,
                              IRubyObject value)
Writes a 64 bit unsigned integer value to the memory area.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_ulong_long

public IRubyObject read_ulong_long(ThreadContext context)
Reads a 64 bit unsigned integer value from the memory address.

Returns:
The value read from the address.

get_uint64

public IRubyObject get_uint64(ThreadContext context)
Reads a 64 bit unsigned integer value from the memory address.

Returns:
The value read from the address.

get_uint64

public IRubyObject get_uint64(ThreadContext context,
                              IRubyObject offset)
Reads a 64 bit unsigned integer value from the memory address.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read from the address.

write_long

public IRubyObject write_long(ThreadContext context,
                              IRubyObject value)
Writes a C long integer value to the memory area. This version is added to support the "write_long" alias for the single-arg "put_long".

Parameters:
value - The value to write.
Returns:
The value written.

put_long

public IRubyObject put_long(ThreadContext context,
                            IRubyObject value)
Writes a C long integer value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_long

public IRubyObject put_long(ThreadContext context,
                            IRubyObject offset,
                            IRubyObject value)
Writes a C long integer value to the memory area.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_long

public IRubyObject read_long(ThreadContext context)
Reads a C long integer value from the memory area.

Returns:
The value read.

get_long

public IRubyObject get_long(ThreadContext context)
Reads a C long integer value from the memory area.

Returns:
The value read.

get_long

public IRubyObject get_long(ThreadContext context,
                            IRubyObject offset)
Reads a C long integer value from the memory area.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read.

put_ulong

public IRubyObject put_ulong(ThreadContext context,
                             IRubyObject value)
Writes a C long integer value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_ulong

public IRubyObject put_ulong(ThreadContext context,
                             IRubyObject offset,
                             IRubyObject value)
Writes a C long integer value to the memory area.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_ulong

public IRubyObject read_ulong(ThreadContext context)
Reads a C unsigned long integer value from the memory area.

Returns:
The value read.

get_ulong

public IRubyObject get_ulong(ThreadContext context)
Reads a C unsigned long integer value from the memory area.

Returns:
The value read.

get_ulong

public IRubyObject get_ulong(ThreadContext context,
                             IRubyObject offset)
Reads a C unsigned long integer value from the memory area.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read.

write_float

public IRubyObject write_float(ThreadContext context,
                               IRubyObject value)
Writes an 32 bit floating point value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_float32

public IRubyObject put_float32(ThreadContext context,
                               IRubyObject value)
Writes an 32 bit floating point value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_float32

public IRubyObject put_float32(ThreadContext context,
                               IRubyObject offset,
                               IRubyObject value)
Writes an 32 bit floating point value to the memory area.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_float

public IRubyObject read_float(ThreadContext context)
Reads a 32 bit floating point value from the memory address.

Returns:
The value read from the address.

get_float32

public IRubyObject get_float32(ThreadContext context)
Reads a 32 bit floating point value from the memory address.

Returns:
The value read from the address.

get_float32

public IRubyObject get_float32(ThreadContext context,
                               IRubyObject offset)
Reads a 32 bit floating point value from the memory address.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read from the address.

write_double

public IRubyObject write_double(ThreadContext context,
                                IRubyObject value)
Writes an 64 bit floating point value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_float64

public IRubyObject put_float64(ThreadContext context,
                               IRubyObject value)
Writes an 64 bit floating point value to the memory area.

Parameters:
value - The value to write.
Returns:
The value written.

put_float64

public IRubyObject put_float64(ThreadContext context,
                               IRubyObject offset,
                               IRubyObject value)
Writes an 64 bit floating point value to the memory area.

Parameters:
offset - The offset from the base pointer address to write the value.
value - The value to write.
Returns:
The value written.

read_double

public IRubyObject read_double(ThreadContext context)
Reads a 64 bit floating point value from the memory address.

Returns:
The value read from the address.

get_float64

public IRubyObject get_float64(ThreadContext context)
Reads a 64 bit floating point value from the memory address.

Returns:
The value read from the address.

get_float64

public IRubyObject get_float64(ThreadContext context,
                               IRubyObject offset)
Reads a 64 bit floating point value from the memory address.

Parameters:
offset - The offset from the base pointer address to read the value.
Returns:
The value read from the address.

get_array_of_int8

public IRubyObject get_array_of_int8(ThreadContext context,
                                     IRubyObject offset,
                                     IRubyObject length)
Reads an array of signed 8 bit integer values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_int8

public IRubyObject put_array_of_int8(ThreadContext context,
                                     IRubyObject offset,
                                     IRubyObject arrParam)
Writes an array of signed 8 bit integer values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

get_array_of_uint8

public IRubyObject get_array_of_uint8(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject length)
Reads an array of unsigned 8 bit integer values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_uint8

public IRubyObject put_array_of_uint8(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject arrParam)
Writes an array of unsigned 8 bit integer values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

get_array_of_int16

public IRubyObject get_array_of_int16(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject length)
Reads an array of signed 16 bit integer values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_int16

public IRubyObject put_array_of_int16(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject arrParam)
Writes an array of signed 16 bit integer values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

get_array_of_uint16

public IRubyObject get_array_of_uint16(ThreadContext context,
                                       IRubyObject offset,
                                       IRubyObject length)
Reads an array of unsigned 16 bit integer values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_uint16

public IRubyObject put_array_of_uint16(ThreadContext context,
                                       IRubyObject offset,
                                       IRubyObject arrParam)
Writes an array of unsigned 16 bit integer values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

get_array_of_int32

public IRubyObject get_array_of_int32(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject length)
Reads an array of signed 32 bit integer values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_int32

public IRubyObject put_array_of_int32(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject arrParam)
Writes an array of signed 32 bit integer values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

get_array_of_uint32

public IRubyObject get_array_of_uint32(ThreadContext context,
                                       IRubyObject offset,
                                       IRubyObject length)
Reads an array of unsigned 32 bit integer values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_uint32

public IRubyObject put_array_of_uint32(ThreadContext context,
                                       IRubyObject offset,
                                       IRubyObject arrParam)
Writes an array of unsigned 32 bit integer values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

get_array_of_long

public IRubyObject get_array_of_long(ThreadContext context,
                                     IRubyObject offset,
                                     IRubyObject length)
Reads an array of signed long integer values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_long

public IRubyObject put_array_of_long(ThreadContext context,
                                     IRubyObject offset,
                                     IRubyObject arr)
Writes an array of signed long integer values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

get_array_of_ulong

public IRubyObject get_array_of_ulong(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject length)
Reads an array of unsigned long integer values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_ulong

public IRubyObject put_array_of_ulong(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject arr)
Writes an array of unsigned long integer values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

get_array_of_int64

public IRubyObject get_array_of_int64(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject length)
Reads an array of signed 64 bit integer values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_int64

public IRubyObject put_array_of_int64(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject arrParam)
Writes an array of signed 64 bit integer values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

get_array_of_uint64

public IRubyObject get_array_of_uint64(ThreadContext context,
                                       IRubyObject offset,
                                       IRubyObject length)
Reads an array of unsigned 64 bit integer values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_uint64

public IRubyObject put_array_of_uint64(ThreadContext context,
                                       IRubyObject offset,
                                       IRubyObject arrParam)
Writes an array of unsigned 64 bit integer values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

get_array_of_float

public IRubyObject get_array_of_float(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject length)
Reads an array of signed 32 bit floating point values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_float

public IRubyObject put_array_of_float(ThreadContext context,
                                      IRubyObject offset,
                                      IRubyObject arrParam)
Writes an array of 32 bit floating point values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

get_array_of_float64

public IRubyObject get_array_of_float64(ThreadContext context,
                                        IRubyObject offset,
                                        IRubyObject length)
Reads an array of signed 64 bit floating point values from the memory address.

Parameters:
offset - The offset from the start of the memory area to read the values.
length - The number of values to be read from memory.
Returns:
An array containing the values.

put_array_of_float64

public IRubyObject put_array_of_float64(ThreadContext context,
                                        IRubyObject offset,
                                        IRubyObject arrParam)
Writes an array of 64 bit floating point values to the memory area.

Parameters:
offset - The offset from the start of the memory area to write the values.
length - The number of values to be written to memory.
Returns:
this object.

read_array_of_int8

public IRubyObject read_array_of_int8(ThreadContext context,
                                      IRubyObject length)
Reads an array of signed 8 bit integer values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_int8

public IRubyObject write_array_of_int8(ThreadContext context,
                                       IRubyObject ary)
Writes an array of signed 8 bit integer values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
Returns:
this object.

read_array_of_uint8

public IRubyObject read_array_of_uint8(ThreadContext context,
                                       IRubyObject length)
Reads an array of unsigned 8 bit integer values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_uint8

public IRubyObject write_array_of_uint8(ThreadContext context,
                                        IRubyObject ary)
Writes an array of unsigned 8 bit integer values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
length - The number of values to be written to memory.
Returns:
this object.

read_array_of_int16

public IRubyObject read_array_of_int16(ThreadContext context,
                                       IRubyObject length)
Reads an array of signed 16 bit integer values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_int16

public IRubyObject write_array_of_int16(ThreadContext context,
                                        IRubyObject ary)
Writes an array of signed 16 bit integer values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
Returns:
this object.

read_array_of_uint16

public IRubyObject read_array_of_uint16(ThreadContext context,
                                        IRubyObject length)
Reads an array of unsigned 16 bit integer values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_uint16

public IRubyObject write_array_of_uint16(ThreadContext context,
                                         IRubyObject ary)
Writes an array of unsigned 16 bit integer values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
Returns:
this object.

read_array_of_int32

public IRubyObject read_array_of_int32(ThreadContext context,
                                       IRubyObject length)
Reads an array of signed 32 bit integer values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_int32

public IRubyObject write_array_of_int32(ThreadContext context,
                                        IRubyObject ary)
Writes an array of signed 32 bit integer values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
Returns:
this object.

read_array_of_uint32

public IRubyObject read_array_of_uint32(ThreadContext context,
                                        IRubyObject length)
Reads an array of unsigned 32 bit integer values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_uint32

public IRubyObject write_array_of_uint32(ThreadContext context,
                                         IRubyObject ary)
Writes an array of unsigned 32 bit integer values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
Returns:
this object.

read_array_of_int64

public IRubyObject read_array_of_int64(ThreadContext context,
                                       IRubyObject length)
Reads an array of signed 64 bit integer values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_int64

public IRubyObject write_array_of_int64(ThreadContext context,
                                        IRubyObject ary)
Writes an array of signed 64 bit integer values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
Returns:
this object.

read_array_of_uint64

public IRubyObject read_array_of_uint64(ThreadContext context,
                                        IRubyObject length)
Reads an array of unsigned 64 bit integer values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_uint64

public IRubyObject write_array_of_uint64(ThreadContext context,
                                         IRubyObject ary)
Writes an array of unsigned 64 bit integer values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
Returns:
this object.

read_array_of_long

public IRubyObject read_array_of_long(ThreadContext context,
                                      IRubyObject length)
Reads an array of signed long integer values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_long

public IRubyObject write_array_of_long(ThreadContext context,
                                       IRubyObject ary)
Writes an array of signed long integer values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
Returns:
this object.

read_array_of_ulong

public IRubyObject read_array_of_ulong(ThreadContext context,
                                       IRubyObject length)
Reads an array of unsigned long integer values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_ulong

public IRubyObject write_array_of_ulong(ThreadContext context,
                                        IRubyObject ary)
Writes an array of unsigned long integer values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
Returns:
this object.

read_array_of_float

public IRubyObject read_array_of_float(ThreadContext context,
                                       IRubyObject length)
Reads an array of signed 32 bit floating point values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_float

public IRubyObject write_array_of_float(ThreadContext context,
                                        IRubyObject ary)
Writes an array of 32 bit floating point values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
Returns:
this object.

read_array_of_float64

public IRubyObject read_array_of_float64(ThreadContext context,
                                         IRubyObject length)
Reads an array of signed 64 bit floating point values from the memory address.

Parameters:
length - The number of values to be read from memory.
Returns:
An array containing the values.

write_array_of_float64

public IRubyObject write_array_of_float64(ThreadContext context,
                                          IRubyObject ary)
Writes an array of 64 bit floating point values to the memory area.

Parameters:
ary - The array of values to write to the memory area.
Returns:
this object.

read_string

public IRubyObject read_string(ThreadContext context)

read_string

public IRubyObject read_string(ThreadContext context,
                               IRubyObject rbLength)

get_string

public IRubyObject get_string(ThreadContext context)

get_string

public IRubyObject get_string(ThreadContext context,
                              IRubyObject offArg)

get_string

public IRubyObject get_string(ThreadContext context,
                              IRubyObject offArg,
                              IRubyObject lenArg)

get_array_of_string

public IRubyObject get_array_of_string(ThreadContext context,
                                       IRubyObject rbOffset)

get_array_of_string

public IRubyObject get_array_of_string(ThreadContext context,
                                       IRubyObject rbOffset,
                                       IRubyObject rbCount)

read_array_of_string

public IRubyObject read_array_of_string(ThreadContext context)

read_array_of_string

public IRubyObject read_array_of_string(ThreadContext context,
                                        IRubyObject rbLength)

put_string

public IRubyObject put_string(ThreadContext context,
                              IRubyObject offArg,
                              IRubyObject strArg)

get_bytes

public IRubyObject get_bytes(ThreadContext context,
                             IRubyObject offArg,
                             IRubyObject lenArg)

put_bytes

public IRubyObject put_bytes(ThreadContext context,
                             IRubyObject[] args)

read_pointer

public IRubyObject read_pointer(ThreadContext context)

get_pointer

public IRubyObject get_pointer(ThreadContext context)

get_pointer

public IRubyObject get_pointer(ThreadContext context,
                               IRubyObject offset)

write_pointer

public IRubyObject write_pointer(ThreadContext context,
                                 IRubyObject value)

put_pointer

public IRubyObject put_pointer(ThreadContext context,
                               IRubyObject value)

put_pointer

public IRubyObject put_pointer(ThreadContext context,
                               IRubyObject offset,
                               IRubyObject value)

get_array_of_pointer

public IRubyObject get_array_of_pointer(ThreadContext context,
                                        IRubyObject offset,
                                        IRubyObject length)

put_array_of_pointer

public IRubyObject put_array_of_pointer(ThreadContext context,
                                        IRubyObject offset,
                                        IRubyObject arrParam)

read_array_of_pointer

public IRubyObject read_array_of_pointer(ThreadContext context,
                                         IRubyObject length)

write_array_of_pointer

public IRubyObject write_array_of_pointer(ThreadContext context,
                                          IRubyObject arrParam)

put_callback

public IRubyObject put_callback(ThreadContext context,
                                IRubyObject offset,
                                IRubyObject proc,
                                IRubyObject cbInfo)

op_plus

public IRubyObject op_plus(ThreadContext context,
                           IRubyObject value)

order

public final IRubyObject order(ThreadContext context)

order

public final IRubyObject order(ThreadContext context,
                               IRubyObject byte_order)

order

public abstract AbstractMemory order(Ruby runtime,
                                     java.nio.ByteOrder order)

slice

protected abstract AbstractMemory slice(Ruby runtime,
                                        long offset)

slice

protected abstract AbstractMemory slice(Ruby runtime,
                                        long offset,
                                        long size)

getPointer

protected abstract Pointer getPointer(Ruby runtime,
                                      long offset)


Copyright © 2002-2009 JRuby Team. All Rights Reserved.