Class: Babeltrace2::BTMessage::StreamEnd

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

Returns a new instance of StreamEnd.



182
183
184
185
186
187
188
189
190
191
192
# File 'lib/babeltrace2/graph/message.rb', line 182

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_end_create(
               self_message_iterator, stream)
    raise Babeltrace2.process_error if handle.null?
    super(handle)
  end
end

Instance Method Details

#default_clock_snapshot=(value) ⇒ Object



205
206
207
208
# File 'lib/babeltrace2/graph/message.rb', line 205

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

#get_default_clock_snapshotObject Also known as: default_clock_snapshot



210
211
212
213
214
215
# File 'lib/babeltrace2/graph/message.rb', line 210

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



194
195
196
197
# File 'lib/babeltrace2/graph/message.rb', line 194

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



218
219
220
221
# File 'lib/babeltrace2/graph/message.rb', line 218

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

#set_default_clock_snapshot(value) ⇒ Object



200
201
202
203
# File 'lib/babeltrace2/graph/message.rb', line 200

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