Class: IDL::Type::Array
Constant Summary
Constants inherited
from IDL::Type
Long, LongLong, Octet, Short, TinyShort, ULong, ULongLong, UShort, UTinyShort
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from IDL::Type
#is_node?, #resolved_node, #resolved_type, #typeerror
Constructor Details
#initialize(t, sizes) ⇒ Array
Returns a new instance of Array.
468
469
470
471
472
473
474
475
476
477
478
479
|
# File 'lib/ridl/type.rb', line 468
def initialize(t, sizes)
raise "Anonymous type definitions are not allowed!" if t.is_anonymous?
@basetype = t
if sizes.nil?
@sizes = []
@typename = t.typename + "[]"
else
@sizes = sizes
@typename = t.typename + sizes.collect { |s| "[#{IDL::Expression::ScopedName === s ? s.node.name : s.to_s}]" }.join
end
end
|
Instance Attribute Details
Returns the value of attribute basetype.
466
467
468
|
# File 'lib/ridl/type.rb', line 466
def basetype
@basetype
end
|
Returns the value of attribute sizes.
466
467
468
|
# File 'lib/ridl/type.rb', line 466
def sizes
@sizes
end
|
Instance Method Details
#instantiate(instantiation_context) ⇒ Object
509
510
511
|
# File 'lib/ridl/type.rb', line 509
def instantiate(instantiation_context)
self.is_template? ? Type::Array.new(@basetype.instantiate(instantiation_context), @sizes.collect { |sz| sz.instantiate(instantiation_context).value }) : self
end
|
#is_anonymous? ⇒ Boolean
497
498
499
|
# File 'lib/ridl/type.rb', line 497
def is_anonymous?
true
end
|
#is_complete? ⇒ Boolean
489
490
491
|
# File 'lib/ridl/type.rb', line 489
def is_complete?
@basetype.resolved_type.is_complete?
end
|
#is_local?(recurstk = []) ⇒ Boolean
493
494
495
|
# File 'lib/ridl/type.rb', line 493
def is_local?(recurstk = [])
@basetype.resolved_type.is_local?(recurstk)
end
|
#matches?(idltype) ⇒ Boolean
505
506
507
|
# File 'lib/ridl/type.rb', line 505
def matches?(idltype)
super && self.sizes == idltype.sizes && self.basetype.resolved_type.matches?(idltype.basetype.resolved_type)
end
|
#narrow(obj) ⇒ Object
485
486
487
|
# File 'lib/ridl/type.rb', line 485
def narrow(obj)
typeerror(obj)
end
|
481
482
483
|
# File 'lib/ridl/type.rb', line 481
def typename
@typename
end
|