123456789_123456789_123456789_123456789_123456789_

Class: FFI::StructLayout::Mapped

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Field
Instance Chain:
self, Field
Inherits: FFI::StructLayout::Field
Defined in: lib/ffi/struct_layout.rb

Class Method Summary

Instance Method Summary

Constructor Details

.new(name, offset, type, orig_field) ⇒ Mapped

[ GitHub ]

  
# File 'lib/ffi/struct_layout.rb', line 82

def initialize(name, offset, type, orig_field)
  @orig_field = orig_field
  super(name, offset, type)
end

Instance Method Details

#get(ptr)

[ GitHub ]

  
# File 'lib/ffi/struct_layout.rb', line 87

def get(ptr)
  type.from_native(@orig_field.get(ptr), nil)
end

#put(ptr, value)

[ GitHub ]

  
# File 'lib/ffi/struct_layout.rb', line 91

def put(ptr, value)
  @orig_field.put(ptr, type.to_native(value, nil))
end