lib, bt2: make query method receive custom data
[babeltrace.git] / src / bindings / python / bt2 / bt2 / component.py
index 31f6372532f7d58b317b1301e2dbc6da7369a341..72376ef97a5445f33b577594e2d36860f40b6dc3 100644 (file)
@@ -508,7 +508,7 @@ class _UserComponentType(type):
 
         cls._bt_cc_ptr = cc_ptr
 
-    def _bt_init_from_native(cls, comp_ptr, params_ptr):
+    def _bt_init_from_native(cls, comp_ptr, params_ptr, obj):
         # create instance, not user-initialized yet
         self = cls.__new__(cls)
 
@@ -521,7 +521,7 @@ class _UserComponentType(type):
         else:
             params = None
 
-        self.__init__(params)
+        self.__init__(params, obj)
         return self
 
     def __call__(cls, *args, **kwargs):
@@ -573,7 +573,7 @@ class _UserComponentType(type):
     def addr(cls):
         return int(cls._bt_cc_ptr)
 
-    def _bt_query_from_native(cls, priv_query_exec_ptr, obj, params_ptr):
+    def _bt_query_from_native(cls, priv_query_exec_ptr, object, params_ptr, method_obj):
         # this can raise, in which case the native call to
         # bt_component_class_query() returns NULL
         if params_ptr is not None:
@@ -585,7 +585,7 @@ class _UserComponentType(type):
 
         try:
             # this can raise, but the native side checks the exception
-            results = cls._user_query(priv_query_exec, obj, params)
+            results = cls._user_query(priv_query_exec, object, params, method_obj)
         finally:
             # the private query executor is a private view on the query
             # executor; it's not a shared object (the library does not
@@ -607,7 +607,7 @@ class _UserComponentType(type):
         bt2_value._Value._get_ref(results_ptr)
         return int(results_ptr)
 
-    def _user_query(cls, priv_query_executor, obj, params):
+    def _user_query(cls, priv_query_executor, object, params, method_obj):
         raise bt2.UnknownObject
 
     def _bt_component_class_ptr(self):
@@ -659,7 +659,7 @@ class _UserComponent(metaclass=_UserComponentType):
     def addr(self):
         return int(self._bt_ptr)
 
-    def __init__(self, params=None):
+    def __init__(self, params=None, obj=None):
         pass
 
     def _user_finalize(self):
This page took 0.024482 seconds and 4 git commands to generate.