class Babeltrace2::BTSelfComponent::Source
Public Instance Methods
add_output_port(name, user_data: nil)
click to toggle source
# File lib/babeltrace2/graph/self-component.rb, line 96 def add_output_port(name, user_data: nil) ptr = FFI::MemoryPointer.new(:pointer) res = Babeltrace2.bt_self_component_source_add_output_port(@handle, name, user_data, ptr) raise Babeltrace2.process_error(res) if res != :BT_SELF_COMPONENT_ADD_PORT_STATUS_OK BTSelfComponentPortOutput.new(BTSelfComponentPortOutputHandle.new(ptr.read_pointer), retain: false, auto_release: false) end
get_output_port_by_index(index)
click to toggle source
# File lib/babeltrace2/graph/self-component.rb, line 104 def get_output_port_by_index(index) count = get_output_port_count index += count if index < 0 return nil if index >= count || index < 0 handle = Babeltrace2.bt_self_component_source_borrow_output_port_by_index(@handle, index) BTSelfComponentPortOutput.new(handle, retain: false, auto_release: false) end
get_output_port_by_name(name)
click to toggle source
# File lib/babeltrace2/graph/self-component.rb, line 112 def get_output_port_by_name(name) handle = Babeltrace2.bt_self_component_source_borrow_output_port_by_name(@handle, name) return nil if handle.null? BTSelfComponentPortOutput.new(handle, retain: false, auto_release: false) end