Class: Babeltrace2::BTField

Inherits:
BTObject show all
Defined in:
lib/babeltrace2/trace-ir/field.rb

Direct Known Subclasses

Array, BitArray, Bool, Integer, Option, Real, String, Structure, Variant

Defined Under Namespace

Modules: Enumeration Classes: Array, BitArray, Bool, Integer, Option, Real, String, Structure, Variant

Constant Summary collapse

TYPE_MAP =
{}

Instance Attribute Summary

Attributes inherited from BTObject

#handle

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BTObject

#==, #initialize, #to_ptr

Constructor Details

This class inherits a constructor from Babeltrace2::BTObject

Class Method Details

.from_handle(handle) ⇒ Object



17
18
19
20
21
22
# File 'lib/babeltrace2/trace-ir/field.rb', line 17

def self.from_handle(handle)
  clss = TYPE_MAP[Babeltrace2.bt_field_get_class_type(handle)]
  raise "unsupported field class type" unless clss
  handle = clss[0].new(handle)
  clss[1].new(handle)
end

Instance Method Details

#get_classObject



29
30
31
# File 'lib/babeltrace2/trace-ir/field.rb', line 29

def get_class
  @class ||= BTFieldClass.from_handle(Babeltrace2.bt_field_borrow_class(@handle))
end

#get_class_typeObject Also known as: class_type



24
25
26
# File 'lib/babeltrace2/trace-ir/field.rb', line 24

def get_class_type
  Babeltrace2.bt_field_get_class_type(@handle)
end

#to_sObject



33
34
35
# File 'lib/babeltrace2/trace-ir/field.rb', line 33

def to_s
  value.to_s
end