raise bt2.Stop
elif status == native_bt.SELF_COMPONENT_STATUS_AGAIN:
raise bt2.TryAgain
- elif status == native_bt.SELF_COMPONENT_STATUS_REFUSE_PORT_CONNECTION:
- raise bt2.PortConnectionRefused
elif status < 0:
raise bt2.Error(gen_error_msg)
assert name is not None
return name
+ @property
+ def logging_level(self):
+ ptr = self._as_component_ptr(self._ptr)
+ return native_bt.component_get_logging_level(ptr)
+
@property
def cls(self):
cc_ptr = self._borrow_component_class_ptr(self._ptr)
def addr(cls):
return int(cls._cc_ptr)
- def _query_from_native(cls, query_exec_ptr, obj, params_ptr):
+ def _query_from_native(cls, query_exec_ptr, obj, params_ptr, log_level):
# this can raise, in which case the native call to
# bt_component_class_query() returns NULL
if params_ptr is not None:
query_exec_ptr)
# this can raise, but the native side checks the exception
- results = cls._query(query_exec, obj, params)
+ results = cls._query(query_exec, obj, params, log_level)
# this can raise, but the native side checks the exception
results = bt2.create_value(results)
return results_addr
- def _query(cls, query_executor, obj, params):
+ def _query(cls, query_executor, obj, params, log_level):
raise NotImplementedError
def _component_class_ptr(self):
assert name is not None
return name
+ @property
+ def logging_level(self):
+ ptr = self._as_not_self_specific_component_ptr(self._ptr)
+ ptr = self._as_component_ptr(ptr)
+ return native_bt.component_get_logging_level(ptr)
+
@property
def cls(self):
comp_ptr = self._as_not_self_specific_component_ptr(self._ptr)
def _finalize(self):
pass
- def _accept_port_connection(self, port, other_port):
- return True
-
- def _accept_port_connection_from_native(self, self_port_ptr, self_port_type, other_port_ptr):
- port = bt2.port._create_self_from_ptr_and_get_ref(
- self_port_ptr, self_port_type)
-
- if self_port_type == native_bt.PORT_TYPE_OUTPUT:
- other_port_type = native_bt.PORT_TYPE_INPUT
- else:
- other_port_type = native_bt.PORT_TYPE_OUTPUT
-
- other_port = bt2.port._create_from_ptr_and_get_ref(
- other_port_ptr, other_port_type)
- res = self._accept_port_connection(port, other_port_ptr)
-
- if type(res) is not bool:
- raise TypeError("'{}' is not a 'bool' object")
-
- return res
-
def _port_connected(self, port, other_port):
pass