class QueryExecutor(object._SharedObject):
- _get_ref = native_bt.query_executor_get_ref
- _put_ref = native_bt.query_executor_put_ref
+ _get_ref = staticmethod(native_bt.query_executor_get_ref)
+ _put_ref = staticmethod(native_bt.query_executor_put_ref)
def _handle_status(self, status, gen_error_msg):
if status == native_bt.QUERY_EXECUTOR_STATUS_AGAIN:
return is_canceled > 0
def query(self, component_class, object, params=None):
+ if self.is_canceled:
+ raise bt2.QueryExecutorCanceled
+
if not isinstance(component_class, bt2.component._GenericComponentClass):
err = False
self._handle_status(status, 'cannot query component class')
assert(result_ptr)
return bt2.value._create_from_ptr(result_ptr)
-
- def __eq__(self, other):
- if type(other) is not type(self):
- return False
-
- return self.addr == other.addr