Class: IDL::Type::Sequence
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, size) ⇒ Sequence
Returns a new instance of Sequence.
279
280
281
282
283
284
285
286
287
288
289
290
|
# File 'lib/ridl/type.rb', line 279
def initialize(t, size)
raise RuntimeError, "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.
276
277
278
|
# File 'lib/ridl/type.rb', line 276
def basetype
@basetype
end
|
#recursive ⇒ Object
Returns the value of attribute recursive.
277
278
279
|
# File 'lib/ridl/type.rb', line 277
def recursive
@recursive
end
|
Returns the value of attribute size.
276
277
278
|
# File 'lib/ridl/type.rb', line 276
def size
@size
end
|
Instance Method Details
#instantiate(_context) ⇒ Object
315
316
317
|
# File 'lib/ridl/type.rb', line 315
def instantiate(_context)
self.is_template? ? Type::Sequence.new(@basetype.instantiate(_context), @size ? @size.instantiate(_context).value : nil) : self
end
|
#is_anonymous? ⇒ Boolean
306
307
308
|
# File 'lib/ridl/type.rb', line 306
def is_anonymous?
true
end
|
#is_complete? ⇒ Boolean
297
298
299
|
# File 'lib/ridl/type.rb', line 297
def is_complete?
@basetype.resolved_type.is_complete?
end
|
#is_local?(recurstk = []) ⇒ Boolean
300
301
302
|
# File 'lib/ridl/type.rb', line 300
def is_local?(recurstk = [])
@basetype.resolved_type.is_local?(recurstk)
end
|
#is_recursive? ⇒ Boolean
303
304
305
|
# File 'lib/ridl/type.rb', line 303
def is_recursive?
@recursive
end
|
278
|
# File 'lib/ridl/type.rb', line 278
def length; @size; end
|
#matches?(idltype) ⇒ Boolean
312
313
314
|
# File 'lib/ridl/type.rb', line 312
def matches?(idltype)
super && self.size == idltype.size && self.basetype.resolved_type.matches?(idltype.basetype.resolved_type)
end
|
#narrow(obj) ⇒ Object
294
295
296
|
# File 'lib/ridl/type.rb', line 294
def narrow(obj)
typeerror(obj)
end
|
291
292
293
|
# File 'lib/ridl/type.rb', line 291
def typename
@typename
end
|