Class: Babeltrace2::BTEvent

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

Instance Attribute Summary

Attributes inherited from BTObject

#handle

Instance Method Summary collapse

Methods inherited from BTObject

#==, #initialize, #to_ptr

Constructor Details

This class inherits a constructor from Babeltrace2::BTObject

Instance Method Details

#get_classObject



51
52
53
54
# File 'lib/babeltrace2/trace-ir/event.rb', line 51

def get_class
  handle = Babeltrace2.bt_event_borrow_class(@handle)
  BTEventClass.new(handle, retain: true)
end

#get_common_context_fieldObject Also known as: common_context_field



83
84
85
86
87
# File 'lib/babeltrace2/trace-ir/event.rb', line 83

def get_common_context_field
  handle = Babeltrace2.bt_event_borrow_common_context_field(@handle)
  return nil if handle.null?
  BTField.from_handle(handle)
end

#get_packetObject Also known as: packet



62
63
64
65
66
# File 'lib/babeltrace2/trace-ir/event.rb', line 62

def get_packet
  return nil unless stream.get_class.supports_packets?
  handle = Babeltrace2.bt_event_borrow_packet(@handle)
  BTPacket.new(handle, retain: true)
end

#get_payload_fieldObject Also known as: payload_field



69
70
71
72
73
# File 'lib/babeltrace2/trace-ir/event.rb', line 69

def get_payload_field
  handle = Babeltrace2.bt_event_borrow_payload_field(@handle)
  return nil if handle.null?
  BTField.from_handle(handle)
end

#get_specific_context_fieldObject Also known as: specific_context_field



76
77
78
79
80
# File 'lib/babeltrace2/trace-ir/event.rb', line 76

def get_specific_context_field
  handle = Babeltrace2.bt_event_borrow_specific_context_field(@handle)
  return nil if handle.null?
  BTField.from_handle(handle)
end

#get_streamObject Also known as: stream



56
57
58
59
# File 'lib/babeltrace2/trace-ir/event.rb', line 56

def get_stream
  handle = Babeltrace2.bt_event_borrow_stream(@handle)
  BTStream.new(handle, retain: true)
end

#nameObject



90
91
92
# File 'lib/babeltrace2/trace-ir/event.rb', line 90

def name
  get_class.name
end