Class: Babeltrace2::BTField::Enumeration::Signed

Inherits:
Integer::Signed show all
Includes:
Babeltrace2::BTField::Enumeration
Defined in:
lib/babeltrace2/trace-ir/field.rb

Constant Summary

Constants included from Babeltrace2::BTField::Enumeration

GetMappingLabelsStatus

Constants inherited from Babeltrace2::BTField

TYPE_MAP

Instance Attribute Summary

Attributes inherited from Babeltrace2::BTObject

#handle

Instance Method Summary collapse

Methods included from Babeltrace2::BTField::Enumeration

#to_s

Methods inherited from Integer::Signed

#get_value, #set_value, #to_s, #value=

Methods inherited from Integer

#get_field_value_range, #get_preferred_display_base

Methods inherited from Babeltrace2::BTField

from_handle, #get_class, #get_class_type, #to_s

Methods inherited from Babeltrace2::BTObject

#==, #initialize, #to_ptr

Constructor Details

This class inherits a constructor from Babeltrace2::BTObject

Instance Method Details

#get_mapping_labelsObject Also known as: mapping_labels



304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/babeltrace2/trace-ir/field.rb', line 304

def get_mapping_labels
  ptr1 = FFI::MemoryPointer.new(:pointer)
  ptr2 = FFI::MemoryPointer.new(:uint64)
  res = Babeltrace2.bt_field_enumeration_signed_get_mapping_labels(
          @handle, ptr1, ptr2)
  raise Babeltrace2.process_error(res) if res != :BT_FIELD_ENUMERATION_GET_MAPPING_LABELS_STATUS_OK
  count = ptr2.read_uint64
  return [] if count == 0
  ptr1 = ptr1.read_pointer
  ptr1.read_array_of_pointer(count).collect.collect { |v|
    v = v.read_string
    v[0] == ':' ? v[1..-1].to_sym : v
  }
end