Class: RLTK::CG::ConstantStruct
- Inherits:
-
ConstantAggregate
- Object
- Value
- User
- Constant
- ConstantAggregate
- RLTK::CG::ConstantStruct
- Defined in:
- lib/rltk/cg/value.rb
Overview
A constant struct value.
Instance Attribute Summary
Attributes included from BindingClass
Instance Method Summary collapse
-
#initialize(size_or_values, packed = false, context = nil, &block) {|index| ... } ⇒ ConstantStruct
constructor
Create a new constant struct value.
Methods inherited from ConstantAggregate
Methods included from AbstractClass
Methods inherited from Constant
#bitcast_to, #get_element_ptr, #get_element_ptr_in_bounds
Methods inherited from User
Methods inherited from Value
#==, #attributes, #bitcast, #constant?, #dump, #hash, #name, #name=, #null?, #print, #trunc, #trunc_or_bitcast, #type, #undefined?, #zextend, #zextend_or_bitcast
Methods included from BindingClass
Constructor Details
#initialize(size_or_values, packed = false, context = nil, &block) {|index| ... } ⇒ ConstantStruct
Create a new constant struct value.
462 463 464 465 466 467 468 469 470 471 |
# File 'lib/rltk/cg/value.rb', line 462 def initialize(size_or_values, packed = false, context = nil, &block) vals_ptr = make_ptr_to_elements(size_or_values, &block) @ptr = if context Bindings.const_struct_in_context(check_type(context, Context, 'context'), vals_ptr, vals_ptr.size / vals_ptr.type_size, packed.to_i) else Bindings.const_struct(vals_ptr, vals_ptr.size / vals_ptr.type_size, packed.to_i) end end |