Class: Babeltrace2::BTFieldClass::Option::WithSelectorField::IntegerSigned
- Inherits:
-
Babeltrace2::BTFieldClass::Option::WithSelectorField
- Object
- Babeltrace2::BTObject
- Babeltrace2::BTSharedObject
- Babeltrace2::BTFieldClass
- Babeltrace2::BTFieldClass::Option
- Babeltrace2::BTFieldClass::Option::WithSelectorField
- Babeltrace2::BTFieldClass::Option::WithSelectorField::IntegerSigned
- Defined in:
- lib/babeltrace2/trace-ir/field-class.rb
Constant Summary
Constants inherited from Babeltrace2::BTFieldClass
IntegerSigned, IntegerUnsigned, RealDoublePrecision, RealSinglePrecision, TYPE_MAP
Instance Attribute Summary
Attributes inherited from Babeltrace2::BTObject
Class Method Summary collapse
Instance Method Summary collapse
- #get_selector_ranges ⇒ Object (also: #selector_ranges)
-
#initialize(handle = nil, retain: true, auto_release: true, trace_class: nil, optional_field_class: nil, selector_field_class: nil, ranges: nil) ⇒ IntegerSigned
constructor
A new instance of IntegerSigned.
- #to_h ⇒ Object
Methods inherited from Babeltrace2::BTFieldClass::Option::WithSelectorField
Methods inherited from Babeltrace2::BTFieldClass::Option
Methods inherited from Babeltrace2::BTFieldClass
#from_h, from_handle, #get_type, #get_user_attributes, #set_user_attributes, #type_is, #user_attributes=
Methods inherited from Babeltrace2::BTSharedObject
Methods inherited from Babeltrace2::BTObject
Constructor Details
#initialize(handle = nil, retain: true, auto_release: true, trace_class: nil, optional_field_class: nil, selector_field_class: nil, ranges: nil) ⇒ IntegerSigned
Returns a new instance of IntegerSigned.
1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 |
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1334 def initialize(handle = nil, retain: true, auto_release: true, trace_class: nil, optional_field_class: nil, selector_field_class: nil, ranges: nil) if handle super(handle, retain: retain, auto_release: auto_release) else ranges = BTIntegerRangeSetSigned.from_value(ranges) handle = Babeltrace2.bt_field_class_option_with_selector_field_integer_signed_create( trace_class, optional_field_class, selector_field_class, ranges) raise Babeltrace2.process_error if handle.null? super(handle, retain: false) end end |
Class Method Details
.from_h(trace_class, h, stream_class_h = nil) ⇒ Object
1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 |
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1361 def self.from_h(trace_class, h, stream_class_h = nil) if (stream_class_h && h[:selector_field_path]) selector_field_class = BTStreamClass.locate_field_class( BTFieldPath.path_from_s_to_h(h[:selector_field_path]), stream_class_h) else selector_field_class = nil end o = self.new(trace_class: trace_class, optional_field_class: BTFieldClass.from_h(trace_class, h[:field_class], stream_class_h), selector_field_class: selector_field_class, ranges: h[:selector_ranges]).from_h(h) h[:bt_field_class] = o o end |
Instance Method Details
#get_selector_ranges ⇒ Object Also known as: selector_ranges
1348 1349 1350 1351 1352 |
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1348 def get_selector_ranges BTIntegerRangeSetSigned.new( Babeltrace2.bt_field_class_option_with_selector_field_integer_signed_borrow_selector_ranges_const( @handle), retain: true) end |
#to_h ⇒ Object
1355 1356 1357 1358 1359 |
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1355 def to_h res = super res[:selector_ranges] = selector_ranges.each.collect { |r| [r.lower, r.upper] } res end |