class Babeltrace2::BTComponentClass::Sink

Constants

ConsumeMethodStatus
GraphIsConfiguredMethodStatus

Public Class Methods

new(handle = nil, retain: true, auto_release: true, name: nil, consume_method: nil) click to toggle source
Calls superclass method
# File lib/babeltrace2/graph/component-class-dev.rb, line 719
def initialize(handle = nil, retain: true, auto_release: true,
               name: nil, consume_method: nil)
  if handle
    super(handle, retain: retain, auto_release: auto_release)
  else
    raise ArgumentError, "invalid value for name" unless name
    raise ArgumentError, "invalid value for consume_method" unless consume_method
    consume_method = Babeltrace2._wrap_component_class_sink_consume_method(consume_method)
    handle = Babeltrace2.bt_component_class_sink_create(
      name, consume_method)
    raise Babeltrace2.process_error if handle.null?
    Babeltrace2._callbacks[handle.to_i][:consume_method] = consume_method
    super(handle, retain: false)
  end
end

Public Instance Methods

graph_is_configured_method=(method) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 780
def graph_is_configured_method=(method)
  set_graph_is_configured_method(method)
  method
end
input_port_connected_method=(method) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 796
def input_port_connected_method=(method)
  set_input_port_connected_method(method)
  method
end
set_graph_is_configured_method(method, &block) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 769
def set_graph_is_configured_method(method, &block)
  if method.nil?
    raise ArgumentError, "method or block must be provided" unless block_given?
    method = block
  end
  method = Babeltrace2._wrap_component_class_sink_graph_is_configured_method(@handle, method)
  res = Babeltrace2.bt_component_class_sink_set_graph_is_configured_method(@handle, method)
  raise Babeltrace2.process_error(res) if res != :BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
  self
end
set_input_port_connected_method(method, &block) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 785
def set_input_port_connected_method(method, &block)
  if method.nil?
    raise ArgumentError, "method or block must be provided" unless block_given?
    method = block
  end
  method = Babeltrace2._wrap_component_class_sink_input_port_connected_method(@handle, method)
  res = Babeltrace2.bt_component_class_sink_set_input_port_connected_method(@handle, method)
  raise Babeltrace2.process_error(res) if res != :BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
  self
end

Private Instance Methods

_set_finalize_method(method) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 740
def _set_finalize_method(method)
  Babeltrace2.bt_component_class_sink_set_finalize_method(@handle, method)
end
_set_get_supported_mip_versions_method(method) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 748
def _set_get_supported_mip_versions_method(method)
  Babeltrace2.bt_component_class_sink_set_get_supported_mip_versions_method(@handle, method)
end
_set_initialize_method(method) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 756
def _set_initialize_method(method)
  Babeltrace2.bt_component_class_sink_set_initialize_method(@handle, method)
end
_set_query_method(method) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 764
def _set_query_method(method)
  Babeltrace2.bt_component_class_sink_set_query_method(@handle, method)
end
_wrap_finalize_method(method) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 736
def _wrap_finalize_method(method)
  Babeltrace2._wrap_component_class_finalize_method(BTSelfComponentSink, @handle, method)
end
_wrap_get_supported_mip_versions_method(method) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 744
def _wrap_get_supported_mip_versions_method(method)
  Babeltrace2._wrap_component_class_get_supported_mip_versions_method(BTSelfComponentClassSink, @handle, method)
end
_wrap_initialize_method(method) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 752
def _wrap_initialize_method(method)
  Babeltrace2._wrap_component_class_initialize_method(BTSelfComponentSink, BTSelfComponentSinkConfiguration, @handle, method)
end
_wrap_query_method(method) click to toggle source
# File lib/babeltrace2/graph/component-class-dev.rb, line 760
def _wrap_query_method(method)
  Babeltrace2._wrap_component_class_query_method(BTSelfComponentClassSink, @handle, method)
end