Class: RLTK::CG::ConstantAggregate Abstract
- Includes:
- AbstractClass
- Defined in:
- lib/rltk/cg/value.rb
Overview
This class is abstract.
All constant aggregate values inherit from this class.
Direct Known Subclasses
Instance Attribute Summary
Attributes included from BindingClass
Instance Method Summary collapse
-
#extract(*indices) ⇒ ConstantExpr
Extract values from a constant aggregate value.
-
#insert(value, indices) ⇒ ConstantExpr
Insert values into a constant aggregate value.
Methods included from AbstractClass
Methods inherited from Constant
#bitcast_to, #get_element_ptr, #get_element_ptr_in_bounds, #initialize
Methods inherited from User
Methods inherited from Value
#==, #attributes, #bitcast, #constant?, #dump, #hash, #initialize, #name, #name=, #null?, #print, #trunc, #trunc_or_bitcast, #type, #undefined?, #zextend, #zextend_or_bitcast
Methods included from BindingClass
Constructor Details
This class inherits a constructor from RLTK::CG::Constant
Instance Method Details
#extract(*indices) ⇒ ConstantExpr
Extract values from a constant aggregate value.
384 385 386 387 388 389 |
# File 'lib/rltk/cg/value.rb', line 384 def extract(*indices) indices_ptr = FFI::MemoryPointer.new(:uint, indices.length) indices_ptr.write_array_of_uint(indices) ConstantExpr.new(Bindings.const_extract_value(@ptr, indices_ptr, indices.length)) end |
#insert(value, indices) ⇒ ConstantExpr
Insert values into a constant aggregate value.
397 398 399 400 401 402 |
# File 'lib/rltk/cg/value.rb', line 397 def insert(value, indices) indices_ptr = FFI::MemoryPointer.new(:uint, indices.length) indices_ptr.write_array_of_uint(indices) ConstantExpr.new(Bindings.const_insert_value(@ptr, value, indices_ptr, inicies.length)) end |