123456789_123456789_123456789_123456789_123456789_

Class: FFI::Union

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Struct
Instance Chain:
self, Struct
Inherits: FFI::Struct
Defined in: lib/ffi/union.rb

Class Attribute Summary

Struct - Inherited

.size

Get struct size.

.size=

set struct size.

Class Method Summary

Struct - Inherited

.alignment, .auto_ptr, .by_ref, .by_value, .in, .layout, .members,
.offset_of

Get the offset of a field.

.offsets

Get an array of tuples (field name, offset of the field).

.out, .ptr, .val,
.array_layout

Add array spec to .builder.

.hash_layout

Add hash spec to .builder.

Instance Method Summary

Struct - Inherited

#align

Alias for Struct#alignment.

#alignment,
#clear

Clear the struct content.

#members,
#offset_of

Get the offset of a field.

#offsets

Get an array of tuples (field name, offset of the field).

#size

Get struct size.

#to_ptr

Get Pointer to struct content.

#values

Get array of values from Struct fields.

Class Method Details

.builder

[ GitHub ]

  
# File 'lib/ffi/union.rb', line 37

def self.builder
  b = StructLayoutBuilder.new
  b.union = true
  b
end