Class: Babeltrace2::BTPort
Defined Under Namespace
Classes: Input, Output
Constant Summary
collapse
- Type =
BTPortType
Instance Attribute Summary
Attributes inherited from BTObject
#handle
Class Method Summary
collapse
Instance Method Summary
collapse
inherited, #initialize
Methods inherited from BTObject
#==, #initialize, #to_ptr
Class Method Details
.from_handle(handle, retain: true, auto_release: true) ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/babeltrace2/graph/port.rb', line 44
def self.from_handle(handle, retain: true, auto_release: true)
case Babeltrace2.bt_port_get_type(handle)
when :BT_PORT_TYPE_INPUT
handle = BTPortInputHandle.new(handle)
BTPortInput
when :BT_PORT_TYPE_OUTPUT
handle = BTPortOuputHandle.new(handle)
BTPortOutput
else
raise Error.new("Unknown port type")
end.new(handle, retain: retain, auto_release: auto_release)
end
|
Instance Method Details
#get_component ⇒ Object
Also known as:
component
79
80
81
82
|
# File 'lib/babeltrace2/graph/port.rb', line 79
def get_component
handle = Babeltrace2.bt_port_borrow_component_const(@handle)
BTComponent.from_handle(handle)
end
|
#get_connection ⇒ Object
Also known as:
connection
72
73
74
75
76
|
# File 'lib/babeltrace2/graph/port.rb', line 72
def get_connection
handle = Babeltrace2.bt_port_borrow_connection_const(@handle)
return nil if handle.null?
BTConnection.new(handle, retain: true, auto_release: true)
end
|
#get_name ⇒ Object
Also known as:
name
85
86
87
|
# File 'lib/babeltrace2/graph/port.rb', line 85
def get_name
Babeltrace2.bt_port_get_name(@handle)
end
|
#get_type ⇒ Object
Also known as:
type
57
58
59
|
# File 'lib/babeltrace2/graph/port.rb', line 57
def get_type
Babeltrace2.bt_port_get_type(@handle)
end
|
#is_connected ⇒ Object
Also known as:
connected?
90
91
92
|
# File 'lib/babeltrace2/graph/port.rb', line 90
def is_connected
Babeltrace2.bt_port_is_connected(@handle) != BT_FALSE
end
|
62
63
64
|
# File 'lib/babeltrace2/graph/port.rb', line 62
def is_input
get_type == :BT_PORT_TYPE_INPUT
end
|
#is_output ⇒ Object
Also known as:
output?
67
68
69
|
# File 'lib/babeltrace2/graph/port.rb', line 67
def is_output
get_type == :BT_PORT_TYPE_OUTPUT
end
|