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
55 56 57 |
# File 'lib/ffi-value.rb', line 55 def get_array_of_value(offset, length) get_array_of_uint64(offset, length).collect { |v| ObjectSpace._id2ref(v) } end |
#get_value(offset) ⇒ Object
49 50 51 |
# File 'lib/ffi-value.rb', line 49 def get_value(offset) ObjectSpace._id2ref(get_uint64(offset)) end |
#put_array_of_value(offset, ary) ⇒ Object
43 44 45 |
# File 'lib/ffi-value.rb', line 43 def put_array_of_value(offset, ary) put_array_of_uint64(offset, ary.collect(&:object_id)) end |
#put_value(offset, value) ⇒ Object
37 38 39 |
# File 'lib/ffi-value.rb', line 37 def put_value(offset, value) put_uint64(offset, value.object_id) end |
#read_array_of_value(length) ⇒ Object
58 59 60 |
# File 'lib/ffi-value.rb', line 58 def read_array_of_value(length) read_array_of_uint64(length).collect { |v| ObjectSpace._id2ref(v) } end |
#read_value ⇒ Object
52 53 54 |
# File 'lib/ffi-value.rb', line 52 def read_value ObjectSpace._id2ref(read_uint64) end |
#write_array_of_value(ary) ⇒ Object
46 47 48 |
# File 'lib/ffi-value.rb', line 46 def write_array_of_value(ary) write_array_of_uint64(ary.collect(&:object_id)) end |
#write_value(value) ⇒ Object
40 41 42 |
# File 'lib/ffi-value.rb', line 40 def write_value(value) write_uint64(value.object_id) end |