Class: Babeltrace2::BTComponent::Filter
Constant Summary
ClassType, DescriptorSetAddDescriptorStatus
Instance Attribute Summary
#handle
Instance Method Summary
collapse
from_handle, #get_class_type, #get_logging_level, #get_name, #is_filter, #is_sink, #is_source
inherited, #initialize
#==, #initialize, #to_ptr
Instance Method Details
#get_class ⇒ Object
202
203
204
205
|
# 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
|
265
266
267
268
269
270
271
272
273
274
|
# 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
|
251
252
253
254
255
256
257
|
# 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
|
259
260
261
262
263
|
# 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
|
246
247
248
|
# File 'lib/babeltrace2/graph/component.rb', line 246
def get_input_port_count
Babeltrace2.bt_component_filter_get_input_port_count(@handle)
end
|
#get_output_port(port) ⇒ Object
Also known as:
output_port
226
227
228
229
230
231
232
233
234
235
|
# 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
|
#get_output_port_by_index(index) ⇒ Object
212
213
214
215
216
217
218
|
# 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) ⇒ Object
220
221
222
223
224
|
# 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 ⇒ Object
Also known as:
output_port_count
207
208
209
|
# File 'lib/babeltrace2/graph/component.rb', line 207
def get_output_port_count
Babeltrace2.bt_component_filter_get_output_port_count(@handle)
end
|
277
278
279
280
281
282
283
|
# 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_ports ⇒ Object
237
238
239
240
241
242
243
|
# 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
|