class Babeltrace2::BTPlugin

Constants

FindAllFromDirStatus
FindAllFromFileStatus
FindAllFromStaticStatus
FindAllStatus
FindStatus

Public Class Methods

find(name, find_in_std_env_var: true, find_in_user_dir: true, find_in_sys_dir: true, find_in_static: false, fail_on_load_error: true) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 170
def self.find(name,
              find_in_std_env_var: true,
              find_in_user_dir: true,
              find_in_sys_dir: true,
              find_in_static: false,
              fail_on_load_error: true)
  ptr = FFI::MemoryPointer.new(:pointer)
  res = Babeltrace2.bt_plugin_find(
          name,
          find_in_std_env_var ? BT_TRUE : BT_FALSE,
          find_in_user_dir ? BT_TRUE : BT_FALSE,
          find_in_sys_dir ? BT_TRUE : BT_FALSE,
          find_in_static ? BT_TRUE : BT_FALSE,
          fail_on_load_error ? BT_TRUE : BT_FALSE,
          ptr)
  return nil if res == :BT_PLUGIN_FIND_STATUS_NOT_FOUND
  raise Babeltrace2.process_error(res) if res != :BT_PLUGIN_FIND_STATUS_OK
  handle = BTPluginHandle.new(ptr.read_pointer)
  BTPlugin.new(handle, retain: false)
end
find_all(find_in_std_env_var: true, find_in_user_dir: true, find_in_sys_dir: true, find_in_static: false, fail_on_load_error: true) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 191
def self.find_all(find_in_std_env_var: true,
                  find_in_user_dir: true,
                  find_in_sys_dir: true,
                  find_in_static: false,
                  fail_on_load_error: true)
  ptr = FFI::MemoryPointer.new(:pointer)
  res = Babeltrace2.bt_plugin_find_all(
          find_in_std_env_var ? BT_TRUE : BT_FALSE,
          find_in_user_dir ? BT_TRUE : BT_FALSE,
          find_in_sys_dir ? BT_TRUE : BT_FALSE,
          find_in_static ? BT_TRUE : BT_FALSE,
          fail_on_load_error ? BT_TRUE : BT_FALSE,
          ptr)
  return [] if res == :BT_PLUGIN_FIND_ALL_STATUS_NOT_FOUND
  raise Babeltrace2.process_error(res) if res != :BT_PLUGIN_FIND_ALL_STATUS_OK
  handle = BTPluginSetHandle.new(ptr.read_pointer)
  BTPluginSet.new(handle, retain: false).plugins
end
find_all_from_dir(path, recurse: false, fail_on_load_error: true) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 222
def self.find_all_from_dir(path, recurse: false, fail_on_load_error: true)
  ptr = FFI::MemoryPointer.new(:pointer)
  res = Babeltrace2.bt_plugin_find_all_from_dir(
          path,
          recurse ? BT_TRUE : BT_FALSE,
          fail_on_load_error ? BT_TRUE : BT_FALSE,
          ptr)
  return [] if res == :BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_NOT_FOUND
  raise Babeltrace2.process_error(res) if res != :BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_OK
  handle = BTPluginSetHandle.new(ptr.read_pointer)
  BTPluginSet.new(handle, retain: false).plugins
end
find_all_from_file(path, fail_on_load_error: true) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 210
def self.find_all_from_file(path, fail_on_load_error: true)
  ptr = FFI::MemoryPointer.new(:pointer)
  res = Babeltrace2.bt_plugin_find_all_from_file(
          path,
          fail_on_load_error ? BT_TRUE : BT_FALSE,
          ptr)
  return [] if res == :BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_NOT_FOUND
  raise Babeltrace2.process_error(res) if res != :BT_PLUGIN_FIND_ALL_FROM_FILE_STATUS_OK
  handle = BTPluginSetHandle.new(ptr.read_pointer)
  BTPluginSet.new(handle, retain: false).plugins
end
find_all_from_static(recurse: false, fail_on_load_error: true) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 235
def self.find_all_from_static(recurse: false, fail_on_load_error: true)
  ptr = FFI::MemoryPointer.new(:pointer)
  res = Babeltrace2.bt_plugin_find_all_from_static(
          path,
          recurse ? BT_TRUE : BT_FALSE,
          fail_on_load_error ? BT_TRUE : BT_FALSE,
          ptr)
  return [] if res == :BT_PLUGIN_FIND_ALL_FROM_STATIC_STATUS_NOT_FOUND
  raise Babeltrace2.process_error(res) if res != :BT_PLUGIN_FIND_ALL_FROM_STATIC_STATUS_OK
  handle = BTPluginSetHandle.new(ptr.read_pointer)
  BTPluginSet.new(handle, retain: false).plugins
end

Public Instance Methods

author()
Alias for: get_author
description()
Alias for: get_description
filter_component_class_count()
filter_component_classes()
get_author() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 258
def get_author
  Babeltrace2.bt_plugin_get_author(@handle)
end
Also aliased as: author
get_description() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 253
def get_description
  Babeltrace2.bt_plugin_get_description(@handle)
end
Also aliased as: description
get_filter_component_class(filter_component_class) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 356
def get_filter_component_class(filter_component_class)
  case filter_component_class
  when String
    get_filter_component_class_by_name(filter_component_class)
  when Integer
    get_filter_component_class_by_index(filter_component_class)
  else
    raise TypeError, "wrong type for filter component class query"
  end
end
get_filter_component_class_by_index(index) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 340
def get_filter_component_class_by_index(index)
  count = get_filter_component_class_count
  index += count if index < 0
  return nil if index >= count || index < 0
  handle = Babeltrace2.bt_plugin_borrow_filter_component_class_by_index_const(
             @handle, index)
  BTComponentClassFilter.new(handle, retain: true)
end
get_filter_component_class_by_name(name) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 349
def get_filter_component_class_by_name(name)
  handle = Babeltrace2.bt_plugin_borrow_filter_component_class_by_name_const(
             @handle, name)
  return nil if handle.null?
  BTComponentClassFilter.new(handle, retain: true)
end
get_filter_component_class_count() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 294
def get_filter_component_class_count
  Babeltrace2.bt_plugin_get_filter_component_class_count(@handle)
end
Also aliased as: filter_component_class_count
get_filter_component_classes() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 367
def get_filter_component_classes
  filter_component_class_count.times.collect { |index|
    handle = Babeltrace2.bt_plugin_borrow_filter_component_class_by_index_const(
               @handle, index)
    BTComponentClassFilter.new(handle, retain: true)
  }
end
Also aliased as: filter_component_classes
get_license() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 263
def get_license
  Babeltrace2.bt_plugin_get_license(@handle)
end
Also aliased as: license
get_name() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 248
def get_name
  Babeltrace2.bt_plugin_get_name(@handle)
end
Also aliased as: name
get_path() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 268
def get_path
  Babeltrace2.bt_plugin_get_path(@handle)
end
Also aliased as: path
get_sink_component_class(sink_component_class) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 392
def get_sink_component_class(sink_component_class)
  case sink_component_class
  when String
    get_sink_component_class_by_name(sink_component_class)
  when Integer
    get_sink_component_class_by_index(sink_component_class)
  else
    raise TypeError, "wrong type for sink component class query"
  end
end
get_sink_component_class_by_index(index) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 376
def get_sink_component_class_by_index(index)
  count = get_sink_component_class_count
  index += count if index < 0
  return nil if index >= count || index < 0
  handle = Babeltrace2.bt_plugin_borrow_sink_component_class_by_index_const(
             @handle, index)
  BTComponentClassSink.new(handle, retain: true)
end
get_sink_component_class_by_name(name) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 385
def get_sink_component_class_by_name(name)
  handle = Babeltrace2.bt_plugin_borrow_sink_component_class_by_name_const(
             @handle, name)
  return nil if handle.null?
  BTComponentClassSink.new(handle, retain: true)
end
get_sink_component_class_count() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 299
def get_sink_component_class_count
  Babeltrace2.bt_plugin_get_sink_component_class_count(@handle)
end
Also aliased as: sink_component_class_count
get_sink_component_classes() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 403
def get_sink_component_classes
  sink_component_class_count.times.collect { |index|
    handle = Babeltrace2.bt_plugin_borrow_sink_component_class_by_index_const(
               @handle, index)
    BTComponentClassSink.new(handle, retain: true)
  }
end
Also aliased as: sink_component_classes
get_source_component_class(source_component_class) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 320
def get_source_component_class(source_component_class)
  case source_component_class
  when String
    get_source_component_class_by_name(source_component_class)
  when Integer
    get_source_component_class_by_index(source_component_class)
  else
    raise TypeError, "wrong type for source component class query"
  end
end
get_source_component_class_by_index(index) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 304
def get_source_component_class_by_index(index)
  count = get_source_component_class_count
  index += count if index < 0
  return nil if index >= count || index < 0
  handle = Babeltrace2.bt_plugin_borrow_source_component_class_by_index_const(
             @handle, index)
  BTComponentClassSource.new(handle, retain: true)
end
get_source_component_class_by_name(name) click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 313
def get_source_component_class_by_name(name)
  handle = Babeltrace2.bt_plugin_borrow_source_component_class_by_name_const(
             @handle, name)
  return nil if handle.null?
  BTComponentClassSource.new(handle, retain: true)
end
get_source_component_class_count() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 289
def get_source_component_class_count
  Babeltrace2.bt_plugin_get_source_component_class_count(@handle)
end
Also aliased as: source_component_class_count
get_source_component_classes() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 331
def get_source_component_classes
  source_component_class_count.times.collect { |index|
    handle = Babeltrace2.bt_plugin_borrow_source_component_class_by_index_const(
               @handle, index)
    BTComponentClassSource.new(handle, retain: true)
  }
end
Also aliased as: source_component_classes
get_version() click to toggle source
# File lib/babeltrace2/plugin/plugin-loading.rb, line 273
def get_version
  major = FFI::MemoryPointer.new(:uint)
  minor = FFI::MemoryPointer.new(:uint)
  patch = FFI::MemoryPointer.new(:uint)
  extra = FFI::MemoryPointer.new(:pointer)
  res = Babeltrace2.bt_plugin_get_version(@handle, major, minor, patch, extra)
  if res == :BT_PROPERTY_AVAILABILITY_AVAILABLE
    extra = extra.read_pointer
    BTVersion::Number.new(major.read_uint, minor.read_uint, patch.read_uint,
                          extra.null? ? nil : extra.read_string)
  else
    nil
  end
end
Also aliased as: version
license()
Alias for: get_license
name()
Alias for: get_name
path()
Alias for: get_path
sink_component_class_count()
sink_component_classes()
source_component_class_count()
source_component_classes()
version()
Alias for: get_version