Class: Babeltrace2::BTMessage::DiscardedEvents

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) ⇒ DiscardedEvents

Returns a new instance of DiscardedEvents.



490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
# File 'lib/babeltrace2/graph/message.rb', line 490

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_events_create_with_default_clock_snapshots(
          self_message_iterator, stream,
          beginning_clock_snapshot_value, end_clock_snapshot_value)
      else
        Babeltrace2.bt_message_discarded_events_create(
          self_message_iterator, stream)
      end
    raise Babeltrace2.process_error if handle.null?
    super(handle)
  end
end

Instance Method Details

#count=(count) ⇒ Object



539
540
541
542
# File 'lib/babeltrace2/graph/message.rb', line 539

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

#get_beginning_default_clock_snapshotObject Also known as: beginning_default_clock_snapshot



516
517
518
519
# File 'lib/babeltrace2/graph/message.rb', line 516

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

#get_countObject Also known as: count



544
545
546
547
548
549
# File 'lib/babeltrace2/graph/message.rb', line 544

def get_count
  ptr = FFI::MemoryPointer.new(:pointer)
  res = Babeltrace2.bt_message_discarded_events_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



522
523
524
525
# File 'lib/babeltrace2/graph/message.rb', line 522

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

#get_streamObject Also known as: stream



510
511
512
513
# File 'lib/babeltrace2/graph/message.rb', line 510

def get_stream
  handle = Babeltrace2.bt_message_discarded_events_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



528
529
530
531
# File 'lib/babeltrace2/graph/message.rb', line 528

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

#set_count(count) ⇒ Object



534
535
536
537
# File 'lib/babeltrace2/graph/message.rb', line 534

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