Class: FFI::Struct::ManagedStructConverter
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::FFI::StructByReference
|
|
Instance Chain:
|
|
Inherits: |
FFI::StructByReference
|
Defined in: | lib/ffi/struct.rb |
Class Method Summary
Instance Attribute Summary
::FFI::StructByReference
- Inherited
Instance Method Summary
::FFI::StructByReference
- Inherited
#from_native | Create a struct from content of memory |
#native_type | Always get |
#to_native |
::FFI::DataConverter
- Included
#from_native | Convert from a native type. |
#native_type | Get native type. |
#to_native | Convert to a native type. |
Constructor Details
.new(struct_class) ⇒ ManagedStructConverter
# File 'lib/ffi/struct.rb', line 150
def initialize(struct_class) super(struct_class) raise NoMethodError, "release() not implemented for class #{struct_class}" unless struct_class.respond_to? :release @method = struct_class.method(:release) end
Instance Method Details
#from_native(ptr, ctx) ⇒ Struct
# File 'lib/ffi/struct.rb', line 160
def from_native(ptr, ctx) struct_class.new(AutoPointer.new(ptr, @method)) end