Class: Babeltrace2::BTMessage::StreamBeginning

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

Returns a new instance of StreamBeginning.



110
111
112
113
114
115
116
117
118
119
120
# File 'lib/babeltrace2/graph/message.rb', line 110

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

Instance Method Details

#default_clock_snapshot=(value) ⇒ Object



133
134
135
136
# File 'lib/babeltrace2/graph/message.rb', line 133

def default_clock_snapshot=(value)
  Babeltrace2.bt_message_stream_beginning_set_default_clock_snapshot(@handle, value)
  value
end

#get_default_clock_snapshotObject Also known as: default_clock_snapshot



138
139
140
141
142
143
# File 'lib/babeltrace2/graph/message.rb', line 138

def get_default_clock_snapshot
  ptr = FFI::MemoryPointer.new(:pointer)
  res = Babeltrace2.bt_message_stream_beginning_borrow_default_clock_snapshot_const(@handle, ptr)
  return nil if res == :BT_MESSAGE_STREAM_CLOCK_SNAPSHOT_STATE_UNKNOWN
  BTClockSnapshot.new(BTClockSnapshotHandle.new(ptr.read_pointer))
end

#get_streamObject Also known as: stream



122
123
124
125
# File 'lib/babeltrace2/graph/message.rb', line 122

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



146
147
148
149
# File 'lib/babeltrace2/graph/message.rb', line 146

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

#set_default_clock_snapshot(value) ⇒ Object



128
129
130
131
# File 'lib/babeltrace2/graph/message.rb', line 128

def set_default_clock_snapshot(value)
  Babeltrace2.bt_message_stream_beginning_set_default_clock_snapshot(@handle, value)
  self
end