Class: Fiddle::CUnionEntity
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
CStructEntity,
Pointer,
FFI::DataConverter
|
|
|
Instance Chain:
|
|
| Inherits: |
Fiddle::CStructEntity
|
| Defined in: | lib/fiddle/struct.rb |
Overview
A pointer to a C union
Constant Summary
Class Method Summary
-
.size(types)
Returns the size needed for the union with the given
types.
CStructEntity - Inherited
| .alignment, | |
| .malloc | Allocates a C struct with the |
| .new | Wraps the C pointer |
| .size | Returns the offset for the packed sizes for the given |
Pointer - Inherited
| .[] | Alias for Pointer.to_ptr. |
| .from_native, .malloc, .new, .read, .to_native, .to_ptr, .write | |
Instance Attribute Summary
Instance Method Summary
-
#set_ctypes(types)
Calculate the necessary offset and for each union member with the given
types
CStructEntity - Inherited
| #+, #-, | |
| #[] | Fetch struct member |
| #[]= | Set struct member |
| #assign_names | Set the names of the |
| #set_ctypes | Calculates the offsets and sizes for the given |
| #to_s | |
ValueUtil - Included
PackInfo - Included
Pointer - Inherited
Constructor Details
This class inherits a constructor from Fiddle::CStructEntity
Class Method Details
.size(types)
Instance Method Details
#set_ctypes(types)
Calculate the necessary offset and for each union member with the given types
# 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