Class: IDL::Type::Sequence
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, size) ⇒ Sequence
Returns a new instance of Sequence.
346
347
348
349
350
351
352
353
354
355
356
357
358
|
# File 'lib/ridl/type.rb', line 346
def initialize(t, size)
raise "Anonymous type definitions are not allowed!" if t.is_anonymous?
@basetype = t
@size = size
@typename = format("sequence<%s%s>", t.typename,
if @size.nil? then
""
else
", #{IDL::Expression::ScopedName === size ? size.node.name : size.to_s}"
end)
@recursive = false
end
|
Instance Attribute Details
Returns the value of attribute basetype.
339
340
341
|
# File 'lib/ridl/type.rb', line 339
def basetype
@basetype
end
|
#recursive ⇒ Object
Returns the value of attribute recursive.
340
341
342
|
# File 'lib/ridl/type.rb', line 340
def recursive
@recursive
end
|
Returns the value of attribute size.
339
340
341
|
# File 'lib/ridl/type.rb', line 339
def size
@size
end
|
Instance Method Details
#instantiate(instantiation_context) ⇒ Object
392
393
394
395
396
397
398
|
# File 'lib/ridl/type.rb', line 392
def instantiate(instantiation_context)
if self.is_template?
Type::Sequence.new(@basetype.instantiate(instantiation_context), @size ? @size.instantiate(instantiation_context).value : nil)
else
self
end
end
|
#is_anonymous? ⇒ Boolean
380
381
382
|
# File 'lib/ridl/type.rb', line 380
def is_anonymous?
true
end
|
#is_complete? ⇒ Boolean
368
369
370
|
# File 'lib/ridl/type.rb', line 368
def is_complete?
@basetype.resolved_type.is_complete?
end
|
#is_local?(recurstk = []) ⇒ Boolean
372
373
374
|
# File 'lib/ridl/type.rb', line 372
def is_local?(recurstk = [])
@basetype.resolved_type.is_local?(recurstk)
end
|
#is_recursive? ⇒ Boolean
376
377
378
|
# File 'lib/ridl/type.rb', line 376
def is_recursive?
@recursive
end
|
342
343
344
|
# File 'lib/ridl/type.rb', line 342
def length
@size
end
|
#matches?(idltype) ⇒ Boolean
388
389
390
|
# File 'lib/ridl/type.rb', line 388
def matches?(idltype)
super && self.size == idltype.size && self.basetype.resolved_type.matches?(idltype.basetype.resolved_type)
end
|
#narrow(obj) ⇒ Object
364
365
366
|
# File 'lib/ridl/type.rb', line 364
def narrow(obj)
typeerror(obj)
end
|
360
361
362
|
# File 'lib/ridl/type.rb', line 360
def typename
@typename
end
|