class IDL::Type::WString

Attributes

size[R]

Public Class Methods

new(size = nil) click to toggle source
# File lib/ridl/type.rb, line 446
def initialize(size = nil)
  @size = size
end

Public Instance Methods

instantiate(instantiation_context) click to toggle source
# File lib/ridl/type.rb, line 473
def instantiate(instantiation_context)
  self.is_template? ? Type::WString.new(@size.instantiate(instantiation_context).value) : self
end
is_anonymous?() click to toggle source
# File lib/ridl/type.rb, line 461
def is_anonymous?
  @size ? true : false
end
is_template?() click to toggle source
# File lib/ridl/type.rb, line 465
def is_template?
  (@size && @size.is_a?(IDL::Expression::ScopedName) && @size.node.is_a?(IDL::AST::TemplateParam))
end
length() click to toggle source
# File lib/ridl/type.rb, line 442
def length
  @size
end
matches?(idltype) click to toggle source
Calls superclass method IDL::Type#matches?
# File lib/ridl/type.rb, line 469
def matches?(idltype)
  super && self.size == idltype.size
end
narrow(obj) click to toggle source
# File lib/ridl/type.rb, line 450
def narrow(obj)
  typeerror(obj) unless ::Array === obj
  if @size.nil?
    obj
  elsif @size < obj.size
    typeerror(obj)
  else
    obj
  end
end