Class: IDL::Type::Array
Constant Summary
Constants inherited
from IDL::Type
Long, LongLong, Octet, Short, ULong, ULongLong, UShort
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.
312
313
314
315
316
317
318
319
320
321
322
|
# File 'lib/ridl/type.rb', line 312
def initialize(t, sizes)
raise RuntimeError, "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.
310
311
312
|
# File 'lib/ridl/type.rb', line 310
def basetype
@basetype
end
|
Returns the value of attribute sizes.
311
312
313
|
# File 'lib/ridl/type.rb', line 311
def sizes
@sizes
end
|
Instance Method Details
#instantiate(_context) ⇒ Object
341
342
343
|
# File 'lib/ridl/type.rb', line 341
def instantiate(_context)
self.is_template? ? Type::Array.new(@basetype.instantiate(_context), @sizes.collect { |sz| sz.instantiate(_context).value }) : self
end
|
#is_anonymous? ⇒ Boolean
335
336
337
|
# File 'lib/ridl/type.rb', line 335
def is_anonymous?
true
end
|
#is_complete? ⇒ Boolean
329
330
331
|
# File 'lib/ridl/type.rb', line 329
def is_complete?
@basetype.resolved_type.is_complete?
end
|
#is_local?(recurstk = []) ⇒ Boolean
332
333
334
|
# File 'lib/ridl/type.rb', line 332
def is_local?(recurstk = [])
@basetype.resolved_type.is_local?(recurstk)
end
|
#narrow(obj) ⇒ Object
326
327
328
|
# File 'lib/ridl/type.rb', line 326
def narrow(obj)
typeerror(obj)
end
|
323
324
325
|
# File 'lib/ridl/type.rb', line 323
def typename
@typename
end
|