Class: IDL::Type::BitSet
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
705
706
707
|
# File 'lib/ridl/type.rb', line 705
def in_range?(val)
val >= self.min && val <= self.max
end
|
701
702
703
|
# File 'lib/ridl/type.rb', line 701
def max
@node.bitfields.length - 1
end
|
697
698
699
|
# File 'lib/ridl/type.rb', line 697
def min
0
end
|
#narrow(obj) ⇒ Object
687
688
689
690
691
|
# File 'lib/ridl/type.rb', line 687
def narrow(obj)
typeerror(obj) unless ::Integer === obj
typeerror(obj) unless (0...@node.bitfields.length) === obj
obj
end
|
#next(val) ⇒ Object
709
710
711
|
# File 'lib/ridl/type.rb', line 709
def next(val)
val < self.max ? val + 1 : self.min
end
|
#range_length ⇒ Object
693
694
695
|
# File 'lib/ridl/type.rb', line 693
def range_length
@node.bitfields.length
end
|