Add C++ interface for the libbabeltrace2 `bt_field_class` API
This patch adds C++ wrappers for Babeltrace 2 field class objects.
The class hierarchy is:
FieldClass
BitArrayFieldClass
IntegerFieldClass
UnsignedEnumerationFieldClass
SignedEnumerationFieldClass
StructureFieldClass
ArrayFieldClass
StaticArrayFieldClass
DynamicArrayWithLengthFieldClass
OptionFieldClass
OptionWithSelectorFieldClass
OptionWithBoolSelectorFieldClass
OptionWithUnsignedIntegerSelectorFieldClass
OptionWithSignedIntegerSelectorFieldClass
VariantFieldClass
VariantWithoutSelectorFieldClass
VariantWithUnsignedIntegerSelectorFieldClass
VariantWithSignedIntegerSelectorFieldClass
ConstFieldClass
ConstBitArrayFieldClass
ConstIntegerFieldClass
ConstUnsignedEnumerationFieldClass
ConstSignedEnumerationFieldClass
ConstStructureFieldClass
ConstArrayFieldClass
ConstStaticArrayFieldClass
ConstDynamicArrayWithLengthFieldClass
ConstOptionFieldClass
ConstOptionWithSelectorFieldClass
ConstOptionWithBoolSelectorFieldClass
ConstOptionWithUnsignedIntegerSelectorFieldClass
ConstOptionWithSignedIntegerSelectorFieldClass
ConstVariantFieldClass
ConstVariantWithoutSelectorFieldClass
ConstVariantWithUnsignedIntegerSelectorFieldClass
ConstVariantWithSignedIntegerSelectorFieldClass
ConstUnsignedEnumerationFieldClassMapping
ConstSignedEnumerationFieldClassMapping
StructureFieldClassMember
ConstStructureFieldClassMember
VariantFieldClassOption
ConstVariantFieldClassOption
ConstVariantWithUnsignedIntegerSelectorFieldClassOption
ConstVariantWithSignedIntegerSelectorFieldClassOption
`ConstVariantWith*IntegerSelectorFieldClassOption` doesn't inherit
`ConstVariantFieldClassOption` as they don't wrap the same pointer type:
you need to call
bt_field_class_variant_with_selector_field_integer_*_option_as_option_const()
to obtain a `const bt_field_class_variant_option *` value. Therefore,
you can call asBaseOption() to get a `ConstVariantFieldClassOption`. I
also implemented name() and fieldClass() which call
asBaseOption().name() and asBaseOption().fieldClass().
Implicitly convert from a mutable field class to a constant field class
with converting constructors and assignment operators.
Those new template classes follow the approach of other wrappers in
`src/cpp-common/bt2`.
Because `bt2::FieldClass::userAttributes()` needs to access the
libbabeltrace2 pointer of the map value, `bt2::CommonValue` makes
`bt2::FieldClass` a friend.
Because
`bt2::VariantWithUnsignedIntegerSelectorFieldClass::appendOption()` and
`bt2::VariantWithSignedIntegerSelectorFieldClass::appendOption()` need
to access the libbabeltrace2 pointer of the integer range set,
`bt2::CommonIntegerRangeSet` makes those classes friends.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I5244b603b1f43e61cfa52c4a5fb6b19e2cbac576
Reviewed-on: https://review.lttng.org/c/babeltrace/+/4612
This page took 0.027565 seconds and 4 git commands to generate.