cpp-common/bt2: make `FieldPathScope` a wise enum
[babeltrace.git] / 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.024103 seconds and 4 git commands to generate.