Python bindings: add has_intersection property to TraceCollection
[babeltrace.git] / bindings / python / babeltrace.i.in
index a5cbcf5b897a6cc383538076524bf628ab6fc000..f9d2c736dff41636ec4b817c1978a5e662499800 100644 (file)
@@ -217,6 +217,10 @@ class TraceCollection:
     def intersect_mode(self):
         return self._intersect_mode
 
+    @property
+    def has_intersection(self):
+        return _bt_python_has_intersection(self._tc)
+
        @property
        def events(self):
                """
@@ -289,8 +293,7 @@ class TraceCollection:
 
        def _events(self, begin_pos_ptr, end_pos_ptr):
         if self.intersect_mode:
-            has_intersection = _bt_python_has_intersection(self._tc)
-            if not has_intersection:
+            if not self.has_intersection:
                 # There are no events to provide.
                 return
 
This page took 0.023632 seconds and 4 git commands to generate.