Class: Babeltrace2::BTMessage

Inherits:
BTSharedObject show all
Defined in:
lib/babeltrace2/graph/message.rb,
lib/babeltrace2/graph/message.rb,
lib/babeltrace2/graph/message.rb,
lib/babeltrace2/graph/message.rb,
lib/babeltrace2/graph/message.rb,
lib/babeltrace2/graph/message.rb,
lib/babeltrace2/graph/message.rb,
lib/babeltrace2/graph/message.rb,
lib/babeltrace2/graph/message.rb

Defined Under Namespace

Classes: DiscardedEvents, DiscardedPackets, Event, MessageIteratorInactivity, PacketBeginning, PacketEnd, StreamBeginning, StreamEnd

Constant Summary collapse

Type =
BTMessageType
StreamClockSnapshotState =
BTMessageStreamClockSnapshotState

Instance Attribute Summary

Attributes inherited from BTObject

#handle

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BTSharedObject

inherited, #initialize

Methods inherited from BTObject

#==, #initialize, #to_ptr

Constructor Details

This class inherits a constructor from Babeltrace2::BTSharedObject

Class Method Details

.from_handle(handle, retain: true, auto_release: true) ⇒ Object



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/babeltrace2/graph/message.rb', line 45

def self.from_handle(handle, retain: true, auto_release: true)
  case Babeltrace2.bt_message_get_type(handle)
  when :BT_MESSAGE_TYPE_STREAM_BEGINNING
    StreamBeginning
  when :BT_MESSAGE_TYPE_STREAM_END
    StreamEnd
  when :BT_MESSAGE_TYPE_EVENT
    Event
  when :BT_MESSAGE_TYPE_PACKET_BEGINNING
    PacketBeginning
  when :BT_MESSAGE_TYPE_PACKET_END
    PacketEnd
  when :BT_MESSAGE_TYPE_DISCARDED_EVENTS
    DiscardedEvents
  when :BT_MESSAGE_TYPE_DISCARDED_PACKETS
    DiscardedPackets
  when :BT_MESSAGE_TYPE_MESSAGE_ITERATOR_INACTIVITY
    MessageIteratorInactivity
  else
    raise Error.new("unknown message type")
  end.new(handle, retain: retain, auto_release: auto_release)
end

Instance Method Details

#get_typeObject Also known as: type



68
69
70
# File 'lib/babeltrace2/graph/message.rb', line 68

def get_type
  Babeltrace2.bt_message_get_type(@handle)
end