### Home Classes Methods

### In Files

- lib/ffi/struct.rb

### Parent

Field

### Methods

- ::new
- #get
- #put

### Files

- Makefile
- ChangeLog
- LICENSE
- README
- compile
- configure
- depcomp
- stamp-vti
- install-sh
- libtool-version
- mdate-sh
- missing

### Class/Module Index

Quicksearch

- FFI
- FFI::AbstractMemory
- FFI::ArrayType
- FFI::AutoPointer
- FFI::AutoPointer::CallableReleaser
- FFI::AutoPointer::DefaultReleaser
- FFI::AutoPointer::Releaser
- FFI::Buffer
- FFI::ConstGenerator
- FFI::ConstGenerator::Constant
- FFI::DataConverter
- FFI::DynamicLibrary
- FFI::DynamicLibrary::Symbol
- FFI::Enum
- FFI::Enums
- FFI::Function
- FFI::FunctionType
- FFI::Generator
- FFI::Generator::Task
- FFI::IO
- FFI::Library
- FFI::ManagedStruct
- FFI::MemoryPointer
- FFI::NotFoundError
- FFI::NullPointerError
- FFI::Platform
- FFI::PlatformError
- FFI::Pointer
- FFI::StrPtrConverter
- FFI::Struct
- FFI::Struct::InlineArray
- FFI::Struct::ManagedStructConverter
- FFI::StructByReference
- FFI::StructByValue
- FFI::StructGenerator
- FFI::StructGenerator::Field
- FFI::StructLayout
- FFI::StructLayout::Array
- FFI::StructLayout::Enum
- FFI::StructLayout::Field
- FFI::StructLayout::Function
- FFI::StructLayout::InnerStruct
- FFI::StructLayout::Mapped
- FFI::StructLayout::Number
- FFI::StructLayout::Pointer
- FFI::StructLayout::String
- FFI::StructLayoutBuilder
- FFI::TypesGenerator
- FFI::Union
- FFI::VariadicInvoker

No matching classes.

# FFI::StructLayout::Mapped

### Public Class Methods

new(name, offset, type, orig_field) click to toggle source

    # File lib/ffi/struct.rb, line 74
    def initialize(name, offset, type, orig_field)
      super(name, offset, type)
      @orig_field = orig_field
    end

### Public Instance Methods

get(ptr) click to toggle source

    # File lib/ffi/struct.rb, line 79
    def get(ptr)
      type.from_native(@orig_field.get(ptr), nil)
    end

put(ptr, value) click to toggle source

    # File lib/ffi/struct.rb, line 83
    def put(ptr, value)
      @orig_field.put(ptr, type.to_native(value, nil))
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.