### Home Classes Methods

### In Files

- ext/ffi_c/ffi.c

### Parent

rbffi_TypeClass

### Methods

- ::new
- #layout
- #struct_class

### 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::ConstGenerator
- FFI::ConstGenerator::Constant
- FFI::DynamicLibrary
- FFI::DynamicLibrary::Symbol
- FFI::Enum
- FFI::Enums
- FFI::FunctionType
- FFI::Generator
- FFI::Generator::Task
- FFI::IO
- FFI::LastError
- FFI::Library
- FFI::ManagedStruct
- 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::CharArray
- 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::StructByValue

### Public Class Methods

new(p1) click to toggle source

    static VALUE
    sbv_initialize(VALUE self, VALUE rbStructClass)
    {
        StructByValue* sbv = NULL;
        StructLayout* layout = NULL;
        VALUE rbLayout = Qnil;

        rbLayout = rb_ivar_get(rbStructClass, rb_intern("@layout"));
        if (!rb_obj_is_instance_of(rbLayout, rbffi_StructLayoutClass)) {
            rb_raise(rb_eTypeError, "wrong type in @layout ivar (expected FFI::StructLayout)");
        }

        Data_Get_Struct(rbLayout, StructLayout, layout);
        Data_Get_Struct(self, StructByValue, sbv);
        sbv->rbStructClass = rbStructClass;
        sbv->rbStructLayout = rbLayout;

        /* We can just use everything from the ffi_type directly */
        *sbv->base.ffiType = *layout->base.ffiType;

        return self;
    }

### Public Instance Methods

layout() click to toggle source

    static VALUE
    sbv_layout(VALUE self)
    {
        StructByValue* sbv;

        Data_Get_Struct(self, StructByValue, sbv);
        return sbv->rbStructLayout;
    }

struct_class() click to toggle source

    static VALUE
    sbv_struct_class(VALUE self)
    {
        StructByValue* sbv;

        Data_Get_Struct(self, StructByValue, sbv);

        return sbv->rbStructClass;
    }

[Validate]

Generated with the Darkfish Rdoc Generator 2.