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
85 86 87 |
# File 'lib/ffi-value.rb', line 85 def get_array_of_value(offset, length) get_array_of_uint64(offset, length).collect { |v| ObjectSpace._id2ref(v) } end |
#get_value(offset) ⇒ Object
79 80 81 |
# File 'lib/ffi-value.rb', line 79 def get_value(offset) ObjectSpace._id2ref(get_uint64(offset)) end |
#put_array_of_value(offset, ary) ⇒ Object
73 74 75 |
# File 'lib/ffi-value.rb', line 73 def put_array_of_value(offset, ary) put_array_of_uint64(offset, ary.collect(&:object_id)) end |
#put_value(offset, value) ⇒ Object
67 68 69 |
# File 'lib/ffi-value.rb', line 67 def put_value(offset, value) put_uint64(offset, value.object_id) end |
#read_array_of_value(length) ⇒ Object
88 89 90 |
# File 'lib/ffi-value.rb', line 88 def read_array_of_value(length) read_array_of_uint64(length).collect { |v| ObjectSpace._id2ref(v) } end |
#read_value ⇒ Object
82 83 84 |
# File 'lib/ffi-value.rb', line 82 def read_value ObjectSpace._id2ref(read_uint64) end |
#write_array_of_value(ary) ⇒ Object
76 77 78 |
# File 'lib/ffi-value.rb', line 76 def write_array_of_value(ary) write_array_of_uint64(ary.collect(&:object_id)) end |
#write_value(value) ⇒ Object
70 71 72 |
# File 'lib/ffi-value.rb', line 70 def write_value(value) write_uint64(value.object_id) end |