Class: Babeltrace2::BTFieldClass::Option::WithSelectorField::IntegerUnsigned
Constant Summary
IntegerSigned, IntegerUnsigned, RealDoublePrecision, RealSinglePrecision, TYPE_MAP
Instance Attribute Summary
#handle
Class Method Summary
collapse
Instance Method Summary
collapse
#get_selector_field_path
#get_field_class
#from_h, from_handle, #get_type, #get_user_attributes, #set_user_attributes, #type_is, #user_attributes=
inherited
#==, #to_ptr
Constructor Details
#initialize(handle = nil, retain: true, auto_release: true, trace_class: nil, optional_field_class: nil, selector_field_class: nil, ranges: nil) ⇒ IntegerUnsigned
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
|
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1274
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 = BTIntegerRangeSetUnsigned.from_value(ranges)
handle = Babeltrace2.bt_field_class_option_with_selector_field_integer_unsigned_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
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
|
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1301
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
1288
1289
1290
1291
1292
|
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1288
def get_selector_ranges
BTIntegerRangeSetUnsigned.new(
Babeltrace2.bt_field_class_option_with_selector_field_integer_unsigned_borrow_selector_ranges_const(
@handle), retain: true)
end
|
#to_h ⇒ Object
1295
1296
1297
1298
1299
|
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1295
def to_h
res = super
res[:selector_ranges] = selector_ranges.each.collect { |r| [r.lower, r.upper] }
res
end
|