bt2: add user attributes property support
This patch adds user attributes property support to the appropriate
`bt2` objects to wrap the equivalent library functions.
The following objects now have a read-only `user_attributes` property
which returns a map value object:
* `_ClockClass`
* `_EventClass`
* `_FieldClass`
* `_Stream`
* `_StreamClass`
* `_StructureFieldClassMember`
* `_Trace`
* `_TraceClass`
* `_VariantFieldClassOption`
You can set the user attributes of those objects at creation time, when
calling the creation method, or when appending a structure field class
member or a variant field class option for `_StructureFieldClassMember`
and `_VariantFieldClassOption`.
To make the `_user_attributes` property of `_StructureFieldClassMember`
and `_VariantFieldClassOption` above possible, I made them wrap a real
BT pointer and keep a reference on the owning field class, making all
the properties make a call to the library instead of the object just
containing them.
In `test_field_class.py`, because there's now a common property to test
for each field class, the new `_TestFieldClass` mixin does that,
requiring a _create_default_field_class() method which accepts custom
positional and keyword arguments to create a specific default field
class to test.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I1d58f1b386e4a367f038f1dda9c2e58738794a66
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1923
Tested-by: jenkins <jenkins@lttng.org>
15 files changed:
This page took 0.028912 seconds and 4 git commands to generate.