From 47cd0d7c929b8f4a1f20fbd96337b721b626ad07 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Mon, 6 Nov 2023 14:23:17 -0500 Subject: [PATCH] cpp-common/bt2: add `bt2::SelfMessageIteratorConfiguration` A very straightforward wrapper of `bt_self_message_iterator_configuration`. Signed-off-by: Philippe Proulx Change-Id: I0a31ee1feb1eefc7f6de3d87a4f43963d75b3274 Reviewed-on: https://review.lttng.org/c/babeltrace/+/11272 Reviewed-by: Simon Marchi CI-Build: Simon Marchi Tested-by: jenkins --- src/Makefile.am | 1 + .../self-message-iterator-configuration.hpp | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 src/cpp-common/bt2/self-message-iterator-configuration.hpp diff --git a/src/Makefile.am b/src/Makefile.am index ec1a473d..6f8b3ee8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,6 +32,7 @@ noinst_HEADERS = \ cpp-common/bt2/shared-object.hpp \ cpp-common/bt2/raw-value-proxy.hpp \ cpp-common/bt2/self-component-port.hpp \ + cpp-common/bt2/self-message-iterator-configuration.hpp \ cpp-common/bt2/self-message-iterator.hpp \ cpp-common/bt2/trace-ir.hpp \ cpp-common/bt2/type-traits.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 index 00000000..5ae36720 --- /dev/null +++ b/src/cpp-common/bt2/self-message-iterator-configuration.hpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 Philippe Proulx + * + * 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 + +#include "borrowed-object.hpp" + +namespace bt2 { + +class SelfMessageIteratorConfiguration final : + public BorrowedObject +{ +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(canSeekForward)); + } +}; + +} /* namespace bt2 */ + +#endif /* BABELTRACE_CPP_COMMON_BT2_SELF_MESSAGE_ITERATOR_CONFIGURATION_HPP */ -- 2.34.1