Class: RLTK::CG::SimpleAggregateType Abstract
- Inherits:
-
AggregateType
- Object
- Type
- AggregateType
- RLTK::CG::SimpleAggregateType
- Includes:
- 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 included from AbstractClass
Methods inherited from Type
#allignment, #context, from_ptr, #hash, #kind, #size
Methods included from BindingClass
Constructor Details
#initialize(overloaded, size_or_address_space = 0) ⇒ SimpleAggregateType
Used to initialize ArrayTypes and PointerTypes.
239 240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/rltk/cg/type.rb', line 239 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.
253 254 255 |
# File 'lib/rltk/cg/type.rb', line 253 def element_type @element_type ||= Type.from_ptr(Bindings.get_element_type(@ptr)) end |