cpp-common/bt2: make `FieldPathScope` a wise enum
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 4 Apr 2024 03:03:44 +0000 (23:03 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 17 Apr 2024 17:57:53 +0000 (13:57 -0400)
Change-Id: Ia07b63ff3afe01401ba633d0787ed726143abb05
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12247
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/cpp-common/bt2/field-path.hpp

index 75a5b873f2fa3fa90df46355ddc92f6c90803a8f..ed44ad4bda9a25a099c6645dd5f2a4020d178e06 100644 (file)
@@ -12,6 +12,7 @@
 #include <babeltrace2/babeltrace.h>
 
 #include "common/assert.h"
+#include "cpp-common/vendor/wise-enum/wise_enum.h"
 
 #include "borrowed-object-iterator.hpp"
 #include "borrowed-object.hpp"
@@ -102,13 +103,15 @@ struct FieldPathRefFuncs final
 
 } /* namespace internal */
 
-enum class FieldPathScope
-{
-    PacketContext = BT_FIELD_PATH_SCOPE_PACKET_CONTEXT,
-    EventCommonContext = BT_FIELD_PATH_SCOPE_EVENT_COMMON_CONTEXT,
-    EventSpecificContext = BT_FIELD_PATH_SCOPE_EVENT_SPECIFIC_CONTEXT,
-    EventPayload = BT_FIELD_PATH_SCOPE_EVENT_PAYLOAD,
-};
+/* clang-format off */
+
+WISE_ENUM_CLASS(FieldPathScope,
+    (PacketContext, BT_FIELD_PATH_SCOPE_PACKET_CONTEXT),
+    (EventCommonContext, BT_FIELD_PATH_SCOPE_EVENT_COMMON_CONTEXT),
+    (EventSpecificContext, BT_FIELD_PATH_SCOPE_EVENT_SPECIFIC_CONTEXT),
+    (EventPayload, BT_FIELD_PATH_SCOPE_EVENT_PAYLOAD))
+
+/* clang-format on */
 
 class ConstFieldPath final : public BorrowedObject<const bt_field_path>
 {
This page took 0.024782 seconds and 4 git commands to generate.