Class: FFI::StructLayout::Enum
| 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 |
Overview
An enum Field in a ::FFI::StructLayout.
Class Method Summary
Instance Method Summary
-
#get(ptr) ⇒ Object
Get an object of type
#typefrom memory pointed byptr. -
#put(ptr, value) ⇒ nil
Set
valueinto memory pointed byptr.
Field - Inherited
Constructor Details
This class inherits a constructor from FFI::StructLayout::Field
Instance Method Details
#get(ptr) ⇒ Object
Get an object of type #type from memory pointed by ptr.
# File 'lib/ffi/struct_layout.rb', line 56
def get(ptr) type.find(ptr.get_int(offset)) end
#put(ptr, value) ⇒ nil
Set value into memory pointed by ptr.
# File 'lib/ffi/struct_layout.rb', line 64
def put(ptr, value) ptr.put_int(offset, type.find(value)) end