Class: FFI::AbstractMemory
- Inherits:
-
Object
- Object
- FFI::AbstractMemory
- Defined in:
- lib/ffi-value.rb
Instance Method Summary collapse
- #get_array_of_value(offset, length) ⇒ Object
- #get_value(offset) ⇒ Object
- #put_array_of_value(offset, ary) ⇒ Object
- #put_value(offset, value) ⇒ Object
- #read_array_of_value(length) ⇒ Object
- #read_value ⇒ Object
- #write_array_of_value(ary) ⇒ Object
- #write_value(value) ⇒ Object
Instance Method Details
#get_array_of_value(offset, length) ⇒ Object
47 48 49 |
# File 'lib/ffi-value.rb', line 47 def get_array_of_value(offset, length) get_array_of_uint64(offset, length).collect { |v| ObjectSpace._id2ref(v) } end |
#get_value(offset) ⇒ Object
41 42 43 |
# File 'lib/ffi-value.rb', line 41 def get_value(offset) ObjectSpace._id2ref(get_uint64(offset)) end |
#put_array_of_value(offset, ary) ⇒ Object
35 36 37 |
# File 'lib/ffi-value.rb', line 35 def put_array_of_value(offset, ary) put_array_of_uint64(offset, ary.collect(&:object_id)) end |
#put_value(offset, value) ⇒ Object
29 30 31 |
# File 'lib/ffi-value.rb', line 29 def put_value(offset, value) put_uint64(offset, value.object_id) end |
#read_array_of_value(length) ⇒ Object
50 51 52 |
# File 'lib/ffi-value.rb', line 50 def read_array_of_value(length) read_array_of_uint64(length).collect { |v| ObjectSpace._id2ref(v) } end |
#read_value ⇒ Object
44 45 46 |
# File 'lib/ffi-value.rb', line 44 def read_value ObjectSpace._id2ref(read_uint64) end |
#write_array_of_value(ary) ⇒ Object
38 39 40 |
# File 'lib/ffi-value.rb', line 38 def write_array_of_value(ary) write_array_of_uint64(ary.collect(&:object_id)) end |
#write_value(value) ⇒ Object
32 33 34 |
# File 'lib/ffi-value.rb', line 32 def write_value(value) write_uint64(value.object_id) end |