Module: Babeltrace2::BTFieldClass::Variant::WithSelectorField::IntegerSigned
Defined Under Namespace
Classes: Option
Constant Summary
AppendOptionStatus
Instance Method Summary
collapse
#get_selector_field_path, #to_h
Instance Method Details
#append_option(name, option_field_class, ranges) ⇒ Object
Also known as:
append
1622
1623
1624
1625
1626
1627
1628
1629
|
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1622
def append_option(name, option_field_class, ranges)
name = name.inspect if name.kind_of?(Symbol)
ranges = BTIntegerRangeSetSigned.from_value(ranges)
res = Babeltrace2.bt_field_class_variant_with_selector_field_integer_signed_append_option(
@handle, name, option_field_class, ranges)
raise Babeltrace2.process_error(res) if res != :BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_FIELD_APPEND_OPTION_STATUS_OK
self
end
|
#get_option_by_index(index) ⇒ Object
1632
1633
1634
1635
1636
1637
1638
|
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1632
def get_option_by_index(index)
count = get_option_count
index += count if index < 0
return nil if index >= count || index < 0
BTFieldClassVariantWithSelectorFieldIntegerSignedOption.new(
Babeltrace2.bt_field_class_variant_with_selector_field_integer_signed_borrow_option_by_index_const(@handle, index))
end
|
#get_option_by_name(name) ⇒ Object
1640
1641
1642
1643
1644
1645
|
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1640
def get_option_by_name(name)
name = name.inspect if name.kind_of?(Symbol)
handle = Babeltrace2.bt_field_class_variant_with_selector_field_integer_signed_borrow_option_by_name_const(@handle, name)
return nil if handle.null?
BTFieldClassVariantWithSelectorFieldIntegerSignedOption.new(handle)
end
|