### Home Classes Methods

### In Files

- ext/ffi_c/ffi.c

### Parent

rbffi_TypeClass

### Methods

- ::new
- #layout
- #struct_class

### Files

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

### Class/Module Index

Quicksearch

- FFI
- 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::Function
- FFI::Generator
- FFI::Generator::Task
- FFI::IO
- FFI::ManagedStruct
- 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::Enum
- FFI::StructLayout::InnerStruct
- FFI::StructLayout::Mapped
- 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.