bt2: add `_Trace.cls` property
[babeltrace.git] / bindings / python / bt2 / bt2 / trace.py
index 47dab8f73fd65b9e188e5fd7def41a9f9faf3362..5830ec3f8bc0b694dc3a1d081aae9fd5a9e1bad6 100644 (file)
@@ -25,6 +25,7 @@ import bt2.field_class
 import collections.abc
 import bt2.value
 import bt2.stream
+import bt2.trace_class
 import bt2
 import functools
 
@@ -63,6 +64,12 @@ class _Trace(object._SharedObject, collections.abc.Mapping):
 
             yield id
 
+    @property
+    def cls(self):
+        trace_class_ptr = native_bt.trace_borrow_class(self._ptr)
+        assert trace_class_ptr is not None
+        return bt2.trace_class._TraceClass._create_from_ptr_and_get_ref(trace_class_ptr)
+
     @property
     def name(self):
         return native_bt.trace_get_name(self._ptr)
This page took 0.023423 seconds and 4 git commands to generate.