bt2: template borrow_user_attributes method in _TraceClassConst, _StreamClassConst...
[babeltrace.git] / src / bindings / python / bt2 / bt2 / trace_class.py
index 94343552b01031238c32dab38e7c23e52fd371f8..e3162915e2ec944281bc9b06c77ebe4f277b92d1 100644 (file)
@@ -47,6 +47,9 @@ class _TraceClassConst(object._SharedObject, collections.abc.Mapping):
     _borrow_stream_class_ptr_by_id = staticmethod(
         native_bt.trace_class_borrow_stream_class_by_id_const
     )
+    _borrow_user_attributes_ptr = staticmethod(
+        native_bt.trace_class_borrow_user_attributes_const
+    )
     _stream_class_pycls = bt2_stream_class._StreamClassConst
     _create_value_from_ptr_and_get_ref = staticmethod(
         bt2_value._create_from_const_ptr_and_get_ref
@@ -54,7 +57,7 @@ class _TraceClassConst(object._SharedObject, collections.abc.Mapping):
 
     @property
     def user_attributes(self):
-        ptr = native_bt.trace_class_borrow_user_attributes(self._ptr)
+        ptr = self._borrow_user_attributes_ptr(self._ptr)
         assert ptr is not None
         return self._create_value_from_ptr_and_get_ref(ptr)
 
@@ -117,6 +120,9 @@ class _TraceClass(_TraceClassConst):
     _borrow_stream_class_ptr_by_id = staticmethod(
         native_bt.trace_class_borrow_stream_class_by_id
     )
+    _borrow_user_attributes_ptr = staticmethod(
+        native_bt.trace_class_borrow_user_attributes
+    )
     _stream_class_pycls = bt2_stream_class._StreamClass
     _create_value_from_ptr_and_get_ref = staticmethod(
         bt2_value._create_from_ptr_and_get_ref
This page took 0.023425 seconds and 4 git commands to generate.