### 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::AutoPointer
- FFI::AutoPointer::CallableReleaser
- FFI::AutoPointer::DefaultReleaser
- FFI::AutoPointer::Releaser
- 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::LastError
- FFI::Library
- FFI::ManagedStruct
- FFI::MemoryPointer
- FFI::NativeType
- FFI::NotFoundError
- FFI::NullPointerError
- FFI::Platform
- FFI::PlatformError
- FFI::Pointer
- FFI::StrPtrConverter
- FFI::Struct
- FFI::Struct::InlineArray
- FFI::Struct::ManagedStructConverter
- FFI::StructByValue
- FFI::StructGenerator
- FFI::StructGenerator::Field
- FFI::StructLayout
- FFI::StructLayout::Enum
- FFI::StructLayout::InnerStruct
- FFI::StructLayout::Mapped
- FFI::StructLayoutBuilder
- FFI::Type
- FFI::Type::Builtin
- 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.