Class: IDL::Type::BitMask
Constant Summary
Constants inherited
from IDL::Type
Long, LongLong, Octet, Short, TinyShort, ULong, ULongLong, UShort, UTinyShort
Instance Attribute Summary
Attributes inherited from NodeType
#node
Instance Method Summary
collapse
Methods inherited from NodeType
#initialize, #is_local?, #is_node?, #matches?, #resolved_node
Methods inherited from IDL::Type
#instantiate, #is_anonymous?, #is_complete?, #is_local?, #is_node?, #is_template?, #matches?, #resolved_node, #resolved_type, #typeerror, #typename
Instance Method Details
#in_range?(val) ⇒ Boolean
677
678
679
|
# File 'lib/ridl/type.rb', line 677
def in_range?(val)
val >= self.min && val <= self.max
end
|
673
674
675
|
# File 'lib/ridl/type.rb', line 673
def max
@node.bitvalues.length - 1
end
|
669
670
671
|
# File 'lib/ridl/type.rb', line 669
def min
0
end
|
#narrow(obj) ⇒ Object
659
660
661
662
663
|
# File 'lib/ridl/type.rb', line 659
def narrow(obj)
typeerror(obj) unless ::Integer === obj
typeerror(obj) unless (0...@node.bitvalues.length) === obj
obj
end
|
#next(val) ⇒ Object
681
682
683
|
# File 'lib/ridl/type.rb', line 681
def next(val)
val < self.max ? val + 1 : self.min
end
|
#range_length ⇒ Object
665
666
667
|
# File 'lib/ridl/type.rb', line 665
def range_length
@node.bitvalues.length
end
|