cpp-common/bt2: add `bt2::SelfMessageIteratorConfiguration`
[babeltrace.git] / src / cpp-common / bt2 / self-message-iterator-configuration.hpp
diff --git a/src/cpp-common/bt2/self-message-iterator-configuration.hpp b/src/cpp-common/bt2/self-message-iterator-configuration.hpp
new file mode 100644 (file)
index 0000000..5ae3672
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2023 Philippe Proulx <pproulx@efficios.com>
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef BABELTRACE_CPP_COMMON_BT2_SELF_MESSAGE_ITERATOR_CONFIGURATION_HPP
+#define BABELTRACE_CPP_COMMON_BT2_SELF_MESSAGE_ITERATOR_CONFIGURATION_HPP
+
+#include <babeltrace2/babeltrace.h>
+
+#include "borrowed-object.hpp"
+
+namespace bt2 {
+
+class SelfMessageIteratorConfiguration final :
+    public BorrowedObject<bt_self_message_iterator_configuration>
+{
+public:
+    explicit SelfMessageIteratorConfiguration(const _LibObjPtr libObjPtr) noexcept :
+        _ThisBorrowedObject {libObjPtr}
+    {
+    }
+
+    void canSeekForward(const bool canSeekForward) const noexcept
+    {
+        bt_self_message_iterator_configuration_set_can_seek_forward(
+            this->libObjPtr(), static_cast<bt_bool>(canSeekForward));
+    }
+};
+
+} /* namespace bt2 */
+
+#endif /* BABELTRACE_CPP_COMMON_BT2_SELF_MESSAGE_ITERATOR_CONFIGURATION_HPP */
This page took 0.026304 seconds and 4 git commands to generate.