Class: Fiddle::CUnionEntity

Inherits:
CStructEntity show all
Includes:
PackInfo
Defined in:
lib/fiddle/struct.rb

Overview

A pointer to a C union

Constant Summary

Constants included from PackInfo

PackInfo::ALIGN_MAP, PackInfo::PACK_MAP, PackInfo::SIZE_MAP

Instance Method Summary collapse

Methods included from PackInfo

align

Methods inherited from CStructEntity

#+, #-, #[], #[]=, #assign_names, #initialize, #to_s

Methods included from ValueUtil

#signed_value, #unsigned_value, #wrap_arg, #wrap_args

Constructor Details

This class inherits a constructor from Fiddle::CStructEntity

Instance Method Details

#set_ctypes(types) ⇒ Object

Calculate the necessary offset and for each union member with the given types



554
555
556
557
558
# File 'lib/fiddle/struct.rb', line 554

def set_ctypes(types)
  @ctypes = types
  @offset = Array.new(types.length, 0)
  @size   = self.class.size types
end