Class: Inline::C::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/inline_acceleration.rb

Direct Known Subclasses

Parameter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(c_type, ruby_type_class) ⇒ Type

Returns a new instance of Type.



327
328
329
330
# File 'lib/inline_acceleration.rb', line 327

def initialize(c_type, ruby_type_class)
  @c_type = c_type
  @ruby_type_class = ruby_type_class
end

Instance Attribute Details

#c_typeObject (readonly)

Returns the value of attribute c_type.



332
333
334
# File 'lib/inline_acceleration.rb', line 332

def c_type
  @c_type
end

#ruby_type_classObject (readonly)

Returns the value of attribute ruby_type_class.



332
333
334
# File 'lib/inline_acceleration.rb', line 332

def ruby_type_class
  @ruby_type_class
end

Instance Method Details

#c_transfer_typeObject



346
347
348
# File 'lib/inline_acceleration.rb', line 346

def c_transfer_type
  is_simple_type? ? c_type : TRANSFER_TYPE
end

#ruby_type_conversionObject



350
351
352
# File 'lib/inline_acceleration.rb', line 350

def ruby_type_conversion
  is_simple_type? ? '' : "#{ruby_type_class.name}.new"
end

#void?Boolean

Returns:

  • (Boolean)


342
343
344
# File 'lib/inline_acceleration.rb', line 342

def void?
  c_type == 'void'
end