class Babeltrace2::BTComponent::Filter

Public Instance Methods

get_class() click to toggle source
# File lib/babeltrace2/graph/component.rb, line 202
def get_class
  handle = Babeltrace2.bt_component_filter_borrow_class_const(@handle)
  BTComponentClassFilter.new(handle, retain: true)
end
get_input_port(port) click to toggle source
# File lib/babeltrace2/graph/component.rb, line 265
def get_input_port(port)
  case port
  when String
    get_input_port_by_name(port)
  when Integer
    get_input_port_by_index(port)
  else
    raise TypeError, "wrong type for port query"
  end
end
Also aliased as: input_port
get_input_port_by_index(index) click to toggle source
# File lib/babeltrace2/graph/component.rb, line 251
def get_input_port_by_index(index)
  count = get_input_port_count
  index += count if index < 0
  return nil if index >= count || index < 0
  handle = Babeltrace2.bt_component_filter_borrow_input_port_by_index_const(@handle, index)
  BTPortInput.new(handle, retain: true)
end
get_input_port_by_name(name) click to toggle source
# File lib/babeltrace2/graph/component.rb, line 259
def get_input_port_by_name(name)
  handle = Babeltrace2.bt_component_filter_borrow_input_port_by_name_const(@handle, name)
  return nil if handle.null?
  BTPortInput.new(handle, retain: true)
end
get_input_port_count() click to toggle source
# File lib/babeltrace2/graph/component.rb, line 246
def get_input_port_count
  Babeltrace2.bt_component_filter_get_input_port_count(@handle)
end
Also aliased as: input_port_count
get_output_port(port) click to toggle source
# File lib/babeltrace2/graph/component.rb, line 226
def get_output_port(port)
  case port
  when String
    get_output_port_by_name(port)
  when Integer
    get_output_port_by_index(port)
  else
    raise TypeError, "wrong type for port query"
  end
end
Also aliased as: output_port
get_output_port_by_index(index) click to toggle source
# File lib/babeltrace2/graph/component.rb, line 212
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_component_filter_borrow_output_port_by_index_const(@handle, index)
  BTPortOutput.new(handle, retain: true)
end
get_output_port_by_name(name) click to toggle source
# File lib/babeltrace2/graph/component.rb, line 220
def get_output_port_by_name(name)
  handle = Babeltrace2.bt_component_filter_borrow_output_port_by_name_const(@handle, name)
  return nil if handle.null?
  BTPortOutput.new(handle, retain: true)
end
get_output_port_count() click to toggle source
# File lib/babeltrace2/graph/component.rb, line 207
def get_output_port_count
  Babeltrace2.bt_component_filter_get_output_port_count(@handle)
end
Also aliased as: output_port_count
input_port(port)
Alias for: get_input_port
input_port_count()
input_ports() click to toggle source
# File lib/babeltrace2/graph/component.rb, line 277
def input_ports
  input_port_count.times.collect { |index|
    handle = Babeltrace2.bt_component_filter_borrow_input_port_by_index_const(
               @handle, index)
    BTPortInput.new(handle, retain: true)
  }
end
output_port(port)
Alias for: get_output_port
output_port_count()
output_ports() click to toggle source
# File lib/babeltrace2/graph/component.rb, line 237
def output_ports
  output_port_count.times.collect { |index|
    handle = Babeltrace2.bt_component_filter_borrow_output_port_by_index_const(
               @handle, index)
    BTPortOutput.new(handle, retain: true)
  }
end