Class: Babeltrace2::BTMessage::PacketBeginning

Inherits:
Babeltrace2::BTMessage show all
Defined in:
lib/babeltrace2/graph/message.rb

Constant Summary

Constants inherited from Babeltrace2::BTMessage

StreamClockSnapshotState, Type

Instance Attribute Summary

Attributes inherited from Babeltrace2::BTObject

#handle

Instance Method Summary collapse

Methods inherited from Babeltrace2::BTMessage

from_handle, #get_type

Methods inherited from Babeltrace2::BTSharedObject

inherited

Methods inherited from Babeltrace2::BTObject

#==, #to_ptr

Constructor Details

#initialize(handle = nil, retain: true, auto_release: true, self_message_iterator: nil, packet: nil, clock_snapshot_value: nil) ⇒ PacketBeginning

Returns a new instance of PacketBeginning.



346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/babeltrace2/graph/message.rb', line 346

def initialize(handle = nil, retain: true, auto_release: true,
               self_message_iterator: nil, packet: nil, clock_snapshot_value: nil)
  if handle
    super(handle, retain: retain, auto_release: auto_release)
  else
    handle = if clock_snapshot_value
        Babeltrace2.bt_message_packet_beginning_create_with_default_clock_snapshot(
          self_message_iterator, packet, clock_snapshot_value)
      else
        Babeltrace2.bt_message_packet_beginning_create(
          self_message_iterator, packet)
      end
    raise Babeltrace2.process_error if handle.null?
    super(handle)
  end
end

Instance Method Details

#get_default_clock_snapshotObject Also known as: default_clock_snapshot



369
370
371
372
# File 'lib/babeltrace2/graph/message.rb', line 369

def get_default_clock_snapshot
  handle = Babeltrace2.bt_message_packet_beginning_borrow_default_clock_snapshot_const(@handle)
  BTClockSnapshot.new(handle)
end

#get_packetObject Also known as: packet



363
364
365
366
# File 'lib/babeltrace2/graph/message.rb', line 363

def get_packet
  handle = Babeltrace2.bt_message_packet_beginning_borrow_packet(@handle)
  BTPacket.new(handle, retain: true, auto_release: true)
end

#get_stream_class_default_clock_classObject Also known as: stream_class_default_clock_class



375
376
377
378
# File 'lib/babeltrace2/graph/message.rb', line 375

def get_stream_class_default_clock_class
  handle = Babeltrace2.bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(@handle)
  BTClockClass.new(handle, retain: true, auto_release: true)
end