Class: Babeltrace2::BTMessage::DiscardedPackets

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, stream: nil, beginning_clock_snapshot_value: nil, end_clock_snapshot_value: nil) ⇒ DiscardedPackets

Returns a new instance of DiscardedPackets.



595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'lib/babeltrace2/graph/message.rb', line 595

def initialize(handle = nil, retain: true, auto_release: true,
               self_message_iterator: nil, stream: nil,
               beginning_clock_snapshot_value: nil,
               end_clock_snapshot_value: nil)
  if handle
    super(handle, retain: retain, auto_release: auto_release)
  else
    handle = if beginning_clock_snapshot_value && end_clock_snapshot_value
        Babeltrace2.bt_message_discarded_packets_create_with_default_clock_snapshots(
          self_message_iterator, stream,
          beginning_clock_snapshot_value, end_clock_snapshot_value)
      else
        Babeltrace2.bt_message_discarded_packets_create(
          self_message_iterator, stream)
      end
    raise Babeltrace2.process_error if handle.null?
    super(handle)
  end
end

Instance Method Details

#count=(count) ⇒ Object



644
645
646
647
# File 'lib/babeltrace2/graph/message.rb', line 644

def count=(count)
  set_count(count)
  count
end

#get_beginning_default_clock_snapshotObject Also known as: beginning_default_clock_snapshot



621
622
623
624
# File 'lib/babeltrace2/graph/message.rb', line 621

def get_beginning_default_clock_snapshot
  handle = Babeltrace2.bt_message_discarded_packets_borrow_beginning_default_clock_snapshot_const(@handle)
  BTClockSnapshot.new(handle)
end

#get_countObject Also known as: count



649
650
651
652
653
654
# File 'lib/babeltrace2/graph/message.rb', line 649

def get_count
  ptr = FFI::MemoryPointer.new(:pointer)
  res = Babeltrace2.bt_message_discarded_packets_get_count(@handle, ptr)
  return nil if res == :BT_PROPERTY_AVAILABILITY_NOT_AVAILABLE
  ptr.read_uint64
end

#get_end_default_clock_snapshotObject Also known as: end_default_clock_snapshot



627
628
629
630
# File 'lib/babeltrace2/graph/message.rb', line 627

def get_end_default_clock_snapshot
  handle = Babeltrace2.bt_message_discarded_packets_borrow_end_default_clock_snapshot_const(@handle)
  BTClockSnapshot.new(handle)
end

#get_streamObject Also known as: stream



615
616
617
618
# File 'lib/babeltrace2/graph/message.rb', line 615

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

#get_stream_class_default_clock_classObject Also known as: stream_class_default_clock_class



633
634
635
636
# File 'lib/babeltrace2/graph/message.rb', line 633

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

#set_count(count) ⇒ Object



639
640
641
642
# File 'lib/babeltrace2/graph/message.rb', line 639

def set_count(count)
  Babeltrace2.bt_message_discarded_packets_set_count(@handle, count)
  self
end