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.
271
272
273
274
275
276
277
278
279
280
281
282
|
# File 'lib/ridl/type.rb', line 271
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.
268
269
270
|
# File 'lib/ridl/type.rb', line 268
def basetype
@basetype
end
|
#recursive ⇒ Object
Returns the value of attribute recursive.
269
270
271
|
# File 'lib/ridl/type.rb', line 269
def recursive
@recursive
end
|
Returns the value of attribute size.
268
269
270
|
# File 'lib/ridl/type.rb', line 268
def size
@size
end
|
Instance Method Details
#instantiate(_context) ⇒ Object
304
305
306
|
# File 'lib/ridl/type.rb', line 304
def instantiate(_context)
self.is_template? ? Type::Sequence.new(@basetype.instantiate(_context), @size.instantiate(_context).value) : self
end
|
#is_anonymous? ⇒ Boolean
298
299
300
|
# File 'lib/ridl/type.rb', line 298
def is_anonymous?
true
end
|
#is_complete? ⇒ Boolean
289
290
291
|
# File 'lib/ridl/type.rb', line 289
def is_complete?
@basetype.resolved_type.is_complete?
end
|
#is_local?(recurstk = []) ⇒ Boolean
292
293
294
|
# File 'lib/ridl/type.rb', line 292
def is_local?(recurstk = [])
@basetype.resolved_type.is_local?(recurstk)
end
|
#is_recursive? ⇒ Boolean
295
296
297
|
# File 'lib/ridl/type.rb', line 295
def is_recursive?
@recursive
end
|
270
|
# File 'lib/ridl/type.rb', line 270
def length; @size; end
|
#narrow(obj) ⇒ Object
286
287
288
|
# File 'lib/ridl/type.rb', line 286
def narrow(obj)
typeerror(obj)
end
|
283
284
285
|
# File 'lib/ridl/type.rb', line 283
def typename
@typename
end
|