Class: RLTK::CG::IntType
- Inherits:
-
BasicIntType
- Object
- Type
- NumberType
- BasicIntType
- RLTK::CG::IntType
- Defined in:
- lib/rltk/cg/type.rb
Overview
An integer of an arbitrary width.
Instance Attribute Summary
Attributes included from BindingClass
Instance Method Summary collapse
-
#initialize(width, context = nil) ⇒ IntType
constructor
A new instance of IntType.
-
#value_class ⇒ Object
Overrides NumberType#value_class.
Methods inherited from BasicIntType
Methods inherited from NumberType
Methods inherited from Type
#allignment, #context, #dump, from_ptr, #hash, #kind, #size, #to_s
Methods included from BindingClass
Constructor Details
#initialize(width, context = nil) ⇒ IntType
Returns a new instance of IntType.
158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/rltk/cg/type.rb', line 158 def initialize(width, context = nil) if width > 0 @ptr = if context Bindings.get_int_type_in_context(width, check_type(context, Context, 'context')) else Bidnings.get_int_type(width) end else raise 'The width parameter must be greater then 0.' end end |
Instance Method Details
#value_class ⇒ Object
Overrides NumberType#value_class.
174 175 176 |
# File 'lib/rltk/cg/type.rb', line 174 def value_class raise 'The RLKT::CG::IntType class has no value class.' end |