src/cpp-common/bt2: wrap option with selector field loc. FC API
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 11 May 2022 16:21:15 +0000 (12:21 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 4 Sep 2024 19:05:14 +0000 (15:05 -0400)
This patch adds what's needed to the C++ libbabeltrace2 wrappers to
wrap:

* bt_field_class_option_with_selector_field_borrow_selector_field_location_const()
* bt_field_class_option_without_selector_field_location_create()
* bt_field_class_option_with_selector_field_location_bool_create()
* bt_field_class_option_with_selector_field_location_integer_unsigned_create()
* bt_field_class_option_with_selector_field_location_integer_signed_create()

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Iaf20856ee2533a061560abf79c91a69b2dab20b5
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8018
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12701
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
src/cpp-common/bt2/field-class.hpp
src/cpp-common/bt2/trace-ir.hpp

index a60b1332acaf1852b151b1187f4f9c8c3038a0ca..2487577bbeb822f3d415bb52d3716aa1d875510b 100644 (file)
@@ -1608,6 +1608,13 @@ public:
                 this->libObjPtr())};
     }
 
+    ConstFieldLocation selectorFieldLocation() const noexcept
+    {
+        return ConstFieldLocation {
+            bt_field_class_option_with_selector_field_borrow_selector_field_location_const(
+                this->libObjPtr())};
+    }
+
     Shared shared() const noexcept
     {
         return Shared::createWithRef(*this);
index 67b381c4b3368ee77dd4d13fe5695fff56679d13..51ad3f8cfc970b4aaaa1d8a41d75f18f29bca6f1 100644 (file)
@@ -1897,6 +1897,18 @@ public:
         return OptionFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
+    OptionFieldClass::Shared
+    createOptionWithoutSelectorFieldLocationFieldClass(const FieldClass optionalFieldClass) const
+    {
+        static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTraceClass`.");
+
+        const auto libObjPtr = bt_field_class_option_without_selector_field_location_create(
+            this->libObjPtr(), optionalFieldClass.libObjPtr());
+
+        internal::validateCreatedObjPtr(libObjPtr);
+        return OptionFieldClass::Shared::createWithoutRef(libObjPtr);
+    }
+
     OptionWithBoolSelectorFieldClass::Shared
     createOptionWithBoolSelectorFieldClass(const FieldClass optionalFieldClass,
                                            const FieldClass selectorFieldClass) const
@@ -1910,6 +1922,18 @@ public:
         return OptionWithBoolSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
+    OptionWithBoolSelectorFieldClass::Shared createOptionWithBoolSelectorFieldLocationFieldClass(
+        const FieldClass optionalFieldClass, const ConstFieldLocation selectorFieldLocation) const
+    {
+        static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTraceClass`.");
+
+        const auto libObjPtr = bt_field_class_option_with_selector_field_location_bool_create(
+            this->libObjPtr(), optionalFieldClass.libObjPtr(), selectorFieldLocation.libObjPtr());
+
+        internal::validateCreatedObjPtr(libObjPtr);
+        return OptionWithBoolSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
+    }
+
     OptionWithUnsignedIntegerSelectorFieldClass::Shared
     createOptionWithUnsignedIntegerSelectorFieldClass(
         const FieldClass optionalFieldClass, const IntegerFieldClass selectorFieldClass,
@@ -1925,6 +1949,22 @@ public:
         return OptionWithUnsignedIntegerSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
+    OptionWithUnsignedIntegerSelectorFieldClass::Shared
+    createOptionWithUnsignedIntegerSelectorFieldLocationFieldClass(
+        const FieldClass optionalFieldClass, const ConstFieldLocation selectorFieldLocation,
+        const ConstUnsignedIntegerRangeSet ranges) const
+    {
+        static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTraceClass`.");
+
+        const auto libObjPtr =
+            bt_field_class_option_with_selector_field_location_integer_unsigned_create(
+                this->libObjPtr(), optionalFieldClass.libObjPtr(),
+                selectorFieldLocation.libObjPtr(), ranges.libObjPtr());
+
+        internal::validateCreatedObjPtr(libObjPtr);
+        return OptionWithUnsignedIntegerSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
+    }
+
     OptionWithSignedIntegerSelectorFieldClass::Shared
     createOptionWithSignedIntegerSelectorFieldClass(const FieldClass optionalFieldClass,
                                                     const IntegerFieldClass selectorFieldClass,
@@ -1940,6 +1980,22 @@ public:
         return OptionWithSignedIntegerSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
+    OptionWithSignedIntegerSelectorFieldClass::Shared
+    createOptionWithSignedIntegerSelectorFieldLocationFieldClass(
+        const FieldClass optionalFieldClass, const ConstFieldLocation selectorFieldLocation,
+        const ConstSignedIntegerRangeSet ranges) const
+    {
+        static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTraceClass`.");
+
+        const auto libObjPtr =
+            bt_field_class_option_with_selector_field_location_integer_signed_create(
+                this->libObjPtr(), optionalFieldClass.libObjPtr(),
+                selectorFieldLocation.libObjPtr(), ranges.libObjPtr());
+
+        internal::validateCreatedObjPtr(libObjPtr);
+        return OptionWithSignedIntegerSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
+    }
+
     VariantWithoutSelectorFieldClass::Shared createVariantFieldClass() const
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTraceClass`.");
This page took 0.026159 seconds and 4 git commands to generate.