Class: Ikra::Types::LocationAwareArrayType

Inherits:
ArrayType show all
Defined in:
lib/types/types/array_type.rb

Instance Attribute Summary collapse

Attributes inherited from ArrayType

#inner_type

Instance Method Summary collapse

Methods inherited from ArrayType

new, new_original, #to_ffi_type, #to_ruby_type, #to_s

Methods included from RubyType

#class_id, #eql?, #hash, #inspect, #is_primitive?, #is_union_type?, #should_generate_self_arg?, #to_array_type, #to_ruby_type, #to_str, #to_union_type

Constructor Details

#initialize(inner_type, location) ⇒ LocationAwareArrayType

Returns a new instance of LocationAwareArrayType.



63
64
65
66
# File 'lib/types/types/array_type.rb', line 63

def initialize(inner_type, location)
    @inner_type = inner_type
    @location = location
end

Instance Attribute Details

#locationObject (readonly)

Determines if the array is allocated on the host or on the device



57
58
59
# File 'lib/types/types/array_type.rb', line 57

def location
  @location
end

Instance Method Details

#==(other) ⇒ Object



59
60
61
# File 'lib/types/types/array_type.rb', line 59

def ==(other)
    return super && self.location == other.location
end

#to_c_typeObject



68
69
70
# File 'lib/types/types/array_type.rb', line 68

def to_c_type
    return "variable_size_array_t"
end