src/cpp-common/bt2: wrap variant with selector field loc. FC API
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 26 Mar 2024 20:04:49 +0000 (16:04 -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_variant_with_selector_field_borrow_selector_field_location_const()
* bt_field_class_variant_with_selector_field_location_integer_unsigned_create()
* bt_field_class_variant_with_selector_field_location_integer_signed_create()

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Id644771aa9537be21d73ba6cfe97a287c19f7240
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8019
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12702
Tested-by: jenkins <jenkins@lttng.org>
CI-Build: Simon Marchi <simon.marchi@efficios.com>

src/cpp-common/bt2/field-class.hpp
src/cpp-common/bt2/trace-ir.hpp

index 2487577bbeb822f3d415bb52d3716aa1d875510b..29d4a384dee4fb2180909234dfcbc30e8405df3a 100644 (file)
@@ -2426,6 +2426,13 @@ public:
                 this->libObjPtr())};
     }
 
+    ConstFieldLocation selectorFieldLocation() const noexcept
+    {
+        return ConstFieldLocation {
+            bt_field_class_variant_with_selector_field_borrow_selector_field_location_const(
+                this->libObjPtr())};
+    }
+
     Shared shared() const noexcept
     {
         return Shared::createWithRef(*this);
index 51ad3f8cfc970b4aaaa1d8a41d75f18f29bca6f1..5f0d87e116d0cd724e36f53923e5c6512c0094df 100644 (file)
@@ -2006,6 +2006,18 @@ public:
         return VariantWithoutSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
     }
 
+    VariantWithoutSelectorFieldClass::Shared
+    createVariantWithoutSelectorFieldLocationFieldClass() const
+    {
+        static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTraceClass`.");
+
+        const auto libObjPtr =
+            bt_field_class_variant_without_selector_field_location_create(this->libObjPtr());
+
+        internal::validateCreatedObjPtr(libObjPtr);
+        return VariantWithoutSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
+    }
+
     VariantWithUnsignedIntegerSelectorFieldClass::Shared
     createVariantWithUnsignedIntegerSelectorFieldClass(
         const IntegerFieldClass selectorFieldClass) const
@@ -2014,6 +2026,20 @@ public:
             VariantWithUnsignedIntegerSelectorFieldClass>(selectorFieldClass);
     }
 
+    VariantWithUnsignedIntegerSelectorFieldClass::Shared
+    createVariantWithUnsignedIntegerSelectorFieldLocationFieldClass(
+        const ConstFieldLocation selectorFieldLocation) const
+    {
+        static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTraceClass`.");
+
+        const auto libObjPtr =
+            bt_field_class_variant_with_selector_field_location_integer_unsigned_create(
+                this->libObjPtr(), selectorFieldLocation.libObjPtr());
+
+        internal::validateCreatedObjPtr(libObjPtr);
+        return VariantWithUnsignedIntegerSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
+    }
+
     VariantWithSignedIntegerSelectorFieldClass::Shared
     createVariantWithSignedIntegerSelectorFieldClass(
         const IntegerFieldClass selectorFieldClass) const
@@ -2022,6 +2048,20 @@ public:
             VariantWithSignedIntegerSelectorFieldClass>(selectorFieldClass);
     }
 
+    VariantWithSignedIntegerSelectorFieldClass::Shared
+    createVariantWithSignedIntegerSelectorFieldLocationFieldClass(
+        const ConstFieldLocation selectorFieldLocation) const
+    {
+        static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTraceClass`.");
+
+        const auto libObjPtr =
+            bt_field_class_variant_with_selector_field_location_integer_signed_create(
+                this->libObjPtr(), selectorFieldLocation.libObjPtr());
+
+        internal::validateCreatedObjPtr(libObjPtr);
+        return VariantWithSignedIntegerSelectorFieldClass::Shared::createWithoutRef(libObjPtr);
+    }
+
     CommonTraceClass assignsAutomaticStreamClassId(const bool val) const noexcept
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTraceClass`.");
This page took 0.026234 seconds and 4 git commands to generate.