Class: IDL::Type::WString
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_complete?, #is_local?, #is_node?, #resolved_node, #resolved_type, #typeerror, #typename
Constructor Details
#initialize(size = nil) ⇒ WString
Returns a new instance of WString.
521
522
523
|
# File 'lib/ridl/type.rb', line 521
def initialize(size = nil)
@size = size
end
|
Instance Attribute Details
Returns the value of attribute size.
515
516
517
|
# File 'lib/ridl/type.rb', line 515
def size
@size
end
|
Instance Method Details
#instantiate(instantiation_context) ⇒ Object
548
549
550
|
# File 'lib/ridl/type.rb', line 548
def instantiate(instantiation_context)
self.is_template? ? Type::WString.new(@size.instantiate(instantiation_context).value) : self
end
|
#is_anonymous? ⇒ Boolean
536
537
538
|
# File 'lib/ridl/type.rb', line 536
def is_anonymous?
@size ? true : false
end
|
517
518
519
|
# File 'lib/ridl/type.rb', line 517
def length
@size
end
|
#matches?(idltype) ⇒ Boolean
544
545
546
|
# File 'lib/ridl/type.rb', line 544
def matches?(idltype)
super && self.size == idltype.size
end
|
#narrow(obj) ⇒ Object
525
526
527
528
529
530
531
532
533
534
|
# File 'lib/ridl/type.rb', line 525
def narrow(obj)
typeerror(obj) unless ::Array === obj
if @size.nil?
obj
elsif @size < obj.size
typeerror(obj)
else
obj
end
end
|