Class: IDL::Type::Enum
Constant Summary
Constants inherited
from IDL::Type
Long, LongLong, Octet, Short, ULong, ULongLong, UShort
Instance Attribute Summary
Attributes inherited from NodeType
#node
Instance Method Summary
collapse
Methods inherited from NodeType
#initialize, #is_local?, #is_node?, #resolved_node
Methods inherited from IDL::Type
#instantiate, #is_anonymous?, #is_complete?, #is_local?, #is_node?, #is_template?, #resolved_node, #resolved_type, #typeerror, #typename
Instance Method Details
#in_range?(val) ⇒ Boolean
463
464
465
|
# File 'lib/ridl/type.rb', line 463
def in_range?(val)
val >= self.min && val <= self.max
end
|
460
461
462
|
# File 'lib/ridl/type.rb', line 460
def max
@node.enumerators.length-1
end
|
457
458
459
|
# File 'lib/ridl/type.rb', line 457
def min
0
end
|
#narrow(obj) ⇒ Object
449
450
451
452
453
|
# File 'lib/ridl/type.rb', line 449
def narrow(obj)
typeerror(obj) unless ::Integer === obj
typeerror(obj) unless (0...@node.enumerators.length) === obj
obj
end
|
#next(val) ⇒ Object
466
467
468
|
# File 'lib/ridl/type.rb', line 466
def next(val)
val < self.max ? val + 1 : self.min
end
|
#range_length ⇒ Object
454
455
456
|
# File 'lib/ridl/type.rb', line 454
def range_length
@node.enumerators.length
end
|