Method: RLTK::CG::StructType#element_types=

Defined in:
lib/rltk/cg/type.rb

#element_types=(el_types, packed = false) ⇒ void

This method returns an undefined value.

Set the types in the body of this struct type.

Parameters:

  • el_types (Array<Type>)

    Array of types in the struct.

  • packed (Boolean) (defaults to: false)

    Are the types packed already, or should they be re-arranged to save space?



459
460
461
462
463
464
465
466
# File 'lib/rltk/cg/type.rb', line 459

def element_types=(el_types, packed = false)
	@element_types = check_cg_array_type(el_types, Type, 'el_types')

	el_types_ptr = FFI::MemoryPointer.new(:pointer, @element_types.length)
	el_types_ptr.write_array_of_pointer(@element_types)

	Bindings.struct_set_body(@ptr, el_types_ptr, @element_types.length, packed.to_i)
end