Module: Babeltrace2::BTFieldClass::Variant::WithSelectorField::IntegerUnsigned

Includes:
Babeltrace2::BTFieldClass::Variant::WithSelectorField
Defined in:
lib/babeltrace2/trace-ir/field-class.rb

Defined Under Namespace

Classes: Option

Constant Summary

Constants included from Babeltrace2::BTFieldClass::Variant::WithSelectorField

AppendOptionStatus

Instance Method Summary collapse

Methods included from Babeltrace2::BTFieldClass::Variant::WithSelectorField

#get_selector_field_path, #to_h

Instance Method Details

#append_option(name, option_field_class, ranges) ⇒ Object Also known as: append

[View source]

1578
1579
1580
1581
1582
1583
1584
1585
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1578

def append_option(name, option_field_class, ranges)
  name = name.inspect if name.kind_of?(Symbol)
  ranges = BTIntegerRangeSetUnsigned.from_value(ranges)
  res = Babeltrace2.bt_field_class_variant_with_selector_field_integer_unsigned_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

[View source]

1588
1589
1590
1591
1592
1593
1594
1595
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1588

def get_option_by_index(index)
  count = get_option_count
  index += count if index < 0
  return nil if index >= count || index < 0
  BTFieldClassVariantWithSelectorFieldIntegerUnsignedOption.new(
    Babeltrace2.bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_index_const(
      @handle, index))
end

#get_option_by_name(name) ⇒ Object

[View source]

1597
1598
1599
1600
1601
1602
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 1597

def get_option_by_name(name)
  name = name.inspect if name.kind_of?(Symbol)
  handle = Babeltrace2.bt_field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_name_const(@handle, name)
  return nil if handle.null?
  BTFieldClassVariantWithSelectorFieldIntegerUnsignedOption.new(handle)
end