class Inline::C::Parameter

Attributes

index[R]

Public Class Methods

new(c_type, ruby_type_class, index) click to toggle source
# File lib/inline_acceleration.rb, line 357
def initialize(c_type, ruby_type_class, index)
  type_initialize(c_type, ruby_type_class)
  @index = index
end
Also aliased as: type_initialize

Public Instance Methods

arg_name() click to toggle source
# File lib/inline_acceleration.rb, line 364
def arg_name
  "arg#{index}"
end
c_casted_call_arg() click to toggle source
# File lib/inline_acceleration.rb, line 376
def c_casted_call_arg
  "(#{c_type}) #{arg_name}"
end
c_method_parameter() click to toggle source
# File lib/inline_acceleration.rb, line 372
def c_method_parameter
  "#{c_transfer_type} #{arg_name}"
end
ref_name() click to toggle source
# File lib/inline_acceleration.rb, line 368
def ref_name
  "ref#{index}"
end
ruby_converted_return_value() click to toggle source
# File lib/inline_acceleration.rb, line 393
def ruby_converted_return_value
  return nil if !is_pointer_type?
 (is_simple_type? ? "#{ref_name}.to_#{c_type[0..-2].strip.gsub(' ', '_')}" : ref_name + (ruby_type_class.reallocate_pointers? ? '' : " if #{arg_name}.nil?"))
end
ruby_method_parameter() click to toggle source
# File lib/inline_acceleration.rb, line 380
def ruby_method_parameter
  "#{arg_name}=" + (is_pointer_type? ? 'nil' : '0')
end
ruby_ref_assign() click to toggle source
# File lib/inline_acceleration.rb, line 384
def ruby_ref_assign
  return nil if !is_pointer_type?
  "#{ref_name} = #{ruby_type_class.name}.create(#{arg_name})"
end
ruby_transformed_call_arg() click to toggle source
# File lib/inline_acceleration.rb, line 389
def ruby_transformed_call_arg
  is_pointer_type? ? "#{ref_name}.memory_address" : "Inline::C::Value.get_data(#{arg_name})"
end
type_initialize(c_type, ruby_type_class, index)
Alias for: new