Module: Babeltrace2::BTSelfComponent

Included in:
Filter, Sink, Source
Defined in:
lib/babeltrace2/graph/self-component.rb,
lib/babeltrace2/graph/self-component-port.rb,
lib/babeltrace2/graph/self-component-class.rb

Defined Under Namespace

Modules: Class, Port Classes: Filter, Sink, Source

Constant Summary collapse

AddPortStatus =
BTSelfComponentAddPortStatus

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_handle(handle, retain: true, auto_release: true) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/babeltrace2/graph/self-component.rb', line 30

def self.from_handle(handle, retain: true, auto_release: true)
  case Babeltrace2.bt_component_get_class_type(handle)
  when :BT_COMPONENT_CLASS_TYPE_SOURCE
    handle = BTSelfComponentSourceHandle.new(handle)
    BTSelfComponentSource
  when :BT_COMPONENT_CLASS_TYPE_FILTER
    handle = BTSelfComponentFilterHandle.new(handle)
    BTSelfComponentFilter
  when :BT_COMPONENT_CLASS_TYPE_SINK
    handle = BTSelfComponentSinkHandle.new(handle)
    BTSelfComponentSink
  else
    raise Error.new("Unknown component class type")
  end.new(handle, retain: retain, auto_release: auto_release)
end

Instance Method Details

#create_clock_classObject



70
71
72
# File 'lib/babeltrace2/graph/self-component.rb', line 70

def create_clock_class
  BTClockClass.new(self_component: @handle)
end

#create_trace_classObject



66
67
68
# File 'lib/babeltrace2/graph/self-component.rb', line 66

def create_trace_class
  BTTraceClass.new(self_component: @handle)
end

#data=(user_data) ⇒ Object



51
52
53
54
# File 'lib/babeltrace2/graph/self-component.rb', line 51

def data=(user_data)
  set_data(user_data)
  user_data
end

#get_dataObject Also known as: data



56
57
58
# File 'lib/babeltrace2/graph/self-component.rb', line 56

def get_data
  Babeltrace2.bt_self_component_get_data(@handle)
end

#get_graph_mip_versionObject Also known as: graph_mip_version



61
62
63
# File 'lib/babeltrace2/graph/self-component.rb', line 61

def get_graph_mip_version
  Babeltrace2.bt_self_component_get_graph_mip_version(@handle)
end

#set_data(user_data) ⇒ Object



46
47
48
49
# File 'lib/babeltrace2/graph/self-component.rb', line 46

def set_data(user_data)
  Babeltrace2.bt_self_component_set_data(@handle, user_data)
  self
end