bt2: factor out some code in field class creation
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 23 Oct 2024 18:48:54 +0000 (14:48 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 4 Nov 2024 16:17:44 +0000 (11:17 -0500)
commitbbfe7cfdfdc19e23aeb14eafc84be35d53eb8054
treec57f2f81dc743d1b31a600ec3cd8f34965909e55
parent7845b039e8471197cb8a1dda7658d9d3fc257676
bt2: factor out some code in field class creation

Remove `_TraceClass._check_field_class_create_status()` and
`_TraceClass._set_field_class_user_attrs()`.  Add
`_TraceClass._check_and_wrap_field_class()` and use it.  The new method
combines the behavior of the two removed ones, plus wrapping the SWIG
pointer with the correct Python type (found using
`bt2_field_class._obj_type_from_field_class_ptr()`).

Change-Id: Iaa4871acb7bad4d21baae537802c20353ed25f22
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/13399
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/bindings/python/bt2/bt2/field_class.py
src/bindings/python/bt2/bt2/trace_class.py
This page took 0.025374 seconds and 4 git commands to generate.