Class: RLTK::CG::SimpleAggregateType Abstract
- Inherits:
-
AggregateType
- Object
- Type
- AggregateType
- RLTK::CG::SimpleAggregateType
- Includes:
- Filigree::AbstractClass
- Defined in:
- lib/rltk/cg/type.rb
Overview
This class is abstract.
ArrayType and PointerType inherit from this class so they can share a constructor.
Direct Known Subclasses
Instance Attribute Summary
Attributes included from BindingClass
Instance Method Summary collapse
-
#element_type ⇒ Type
Type of objects stored inside this aggregate.
-
#initialize(overloaded, size_or_address_space = 0) ⇒ SimpleAggregateType
constructor
Used to initialize ArrayTypes and PointerTypes.
Methods inherited from Type
#allignment, #context, #dump, from_ptr, #hash, #kind, #size, #to_s
Methods included from BindingClass
Constructor Details
#initialize(overloaded, size_or_address_space = 0) ⇒ SimpleAggregateType
Used to initialize ArrayTypes and PointerTypes.
283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/rltk/cg/type.rb', line 283 def initialize(overloaded, size_or_address_space = 0) @ptr = case overloaded when FFI::Pointer overloaded else @element_type = check_cg_type(overloaded, Type, 'overloaded') bname = Bindings.get_bname(self.class.short_name) Bindings.send(bname, @element_type, size_or_address_space) end end |
Instance Method Details
#element_type ⇒ Type
Returns Type of objects stored inside this aggregate.
297 298 299 |
# File 'lib/rltk/cg/type.rb', line 297 def element_type @element_type ||= Type.from_ptr(Bindings.get_element_type(@ptr)) end |