lib: bt_graph_create(): accept MIP version
[babeltrace.git] / src / bindings / python / bt2 / bt2 / component.py
index d7e5f09e013139c88637f0d6b599c14d5bddd557..a68da615f1b542f187cc0637c83f4b7f325d94f1 100644 (file)
@@ -571,9 +571,29 @@ class _UserComponentType(type):
     def addr(cls):
         return int(cls._bt_cc_ptr)
 
+    def _bt_get_supported_mip_versions_from_native(cls, params_ptr, obj, log_level):
+        # this can raise, but the native side checks the exception
+        if params_ptr is not None:
+            params = bt2_value._create_from_ptr_and_get_ref(params_ptr)
+        else:
+            params = None
+
+        # this can raise, but the native side checks the exception
+        range_set = cls._user_get_supported_mip_versions(params, obj, log_level)
+
+        if type(range_set) is not bt2.UnsignedIntegerRangeSet:
+            # this can raise, but the native side checks the exception
+            range_set = bt2.UnsignedIntegerRangeSet(range_set)
+
+        # return new reference
+        range_set._get_ref(range_set._ptr)
+        return int(range_set._ptr)
+
+    def _user_get_supported_mip_versions(cls, params, obj, log_level):
+        return [0]
+
     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
+        # this can raise, but the native side checks the exception
         if params_ptr is not None:
             params = bt2_value._create_from_ptr_and_get_ref(params_ptr)
         else:
@@ -657,6 +677,11 @@ class _UserComponent(metaclass=_UserComponentType):
     def addr(self):
         return int(self._bt_ptr)
 
+    @property
+    def _graph_mip_version(self):
+        ptr = self._bt_as_self_component_ptr(self._bt_ptr)
+        return native_bt.self_component_get_graph_mip_version(ptr)
+
     def __init__(self, params=None, obj=None):
         pass
 
This page took 0.024436 seconds and 4 git commands to generate.