Class: Rubex::DataType::CArray

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/rubex/data_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#==, #c_function_ptr?, #char_ptr?, #from_ruby_object, #to_ruby_object

Constructor Details

#initialize(dimension, type) ⇒ CArray

Returns a new instance of CArray.



464
465
466
# File 'lib/rubex/data_type.rb', line 464

def initialize dimension, type
  @dimension, @type = dimension, type
end

Instance Attribute Details

#dimensionObject (readonly)

Dimension of the array



460
461
462
# File 'lib/rubex/data_type.rb', line 460

def dimension
  @dimension
end

#typeObject (readonly)

Type of elements stored in array



462
463
464
# File 'lib/rubex/data_type.rb', line 462

def type
  @type
end

Instance Method Details

#<=>(other) ⇒ Object



470
471
472
473
474
475
476
# File 'lib/rubex/data_type.rb', line 470

def <=> other
  if self.class == other.class
    @type <=> other.type
  else
    @type <=> other
  end
end

#base_typeObject



478
479
480
# File 'lib/rubex/data_type.rb', line 478

def base_type
  @type
end

#carray?Boolean

Returns:



468
# File 'lib/rubex/data_type.rb', line 468

def carray?; true; end