bt2: rename _FieldPath to _FieldPathConst
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 16 Sep 2019 18:24:51 +0000 (14:24 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 17 Sep 2019 15:48:47 +0000 (11:48 -0400)
The Babeltrace API only returns const field_path objects, so from the
point of view of the user, it's always const.  Rename the Python object
to _FieldPathConst to reflect this.  If the API ever gives access to a
non-const version of field_path, then we can introduce a _FieldPath
type again.

Change-Id: I74a2889db48d570b4b6fbc28e43f98226dc5a053
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2055
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/bindings/python/bt2/bt2/field_class.py
src/bindings/python/bt2/bt2/field_path.py

index 26efddee04f79de4de0604cb2f46df6ca39bf05e..bad407b41401234cb3c4220a2c867bff270f2e7e 100644 (file)
@@ -516,7 +516,7 @@ class _OptionFieldClassConst(_FieldClassConst):
         if ptr is None:
             return
 
-        return bt2_field_path._FieldPath._create_from_ptr_and_get_ref(ptr)
+        return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr)
 
 
 class _OptionFieldClass(_OptionFieldClassConst, _FieldClass):
@@ -761,7 +761,7 @@ class _VariantFieldClassWithSelectorConst(_VariantFieldClassConst):
         if ptr is None:
             return
 
-        return bt2_field_path._FieldPath._create_from_ptr_and_get_ref(ptr)
+        return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr)
 
 
 class _VariantFieldClassWithSelector(
@@ -895,7 +895,7 @@ class _DynamicArrayFieldClassConst(_ArrayFieldClassConst):
         if ptr is None:
             return
 
-        return bt2_field_path._FieldPath._create_from_ptr_and_get_ref(ptr)
+        return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr)
 
 
 class _DynamicArrayFieldClass(_DynamicArrayFieldClassConst, _ArrayFieldClass):
index 51f87709f981573c68dde05ac26d2e8de80f3e42..c29fffe7bb1dac3e798b3a65efa8c4a7c4853daf 100644 (file)
@@ -52,7 +52,7 @@ class _CurrentOptionContentFieldPathItem(_FieldPathItem):
     pass
 
 
-class _FieldPath(object._SharedObject, collections.abc.Iterable):
+class _FieldPathConst(object._SharedObject, collections.abc.Iterable):
     _get_ref = staticmethod(native_bt.field_path_get_ref)
     _put_ref = staticmethod(native_bt.field_path_put_ref)
 
This page took 0.025353 seconds and 4 git commands to generate.