| 1 | /* |
| 2 | * Copyright (c) 2023 Philippe Proulx <pproulx@efficios.com> |
| 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | */ |
| 6 | |
| 7 | #ifndef BABELTRACE_CPP_COMMON_BT2_PRIVATE_QUERY_EXECUTOR_HPP |
| 8 | #define BABELTRACE_CPP_COMMON_BT2_PRIVATE_QUERY_EXECUTOR_HPP |
| 9 | |
| 10 | #include <babeltrace2/babeltrace.h> |
| 11 | |
| 12 | #include "logging.hpp" |
| 13 | |
| 14 | #include "borrowed-object.hpp" |
| 15 | |
| 16 | namespace bt2 { |
| 17 | |
| 18 | class PrivateQueryExecutor final : public BorrowedObject<bt_private_query_executor> |
| 19 | { |
| 20 | public: |
| 21 | explicit PrivateQueryExecutor(const LibObjPtr libObjPtr) noexcept : |
| 22 | _ThisBorrowedObject {libObjPtr} |
| 23 | { |
| 24 | } |
| 25 | |
| 26 | LoggingLevel loggingLevel() const noexcept |
| 27 | { |
| 28 | return static_cast<LoggingLevel>(bt_query_executor_get_logging_level( |
| 29 | bt_private_query_executor_as_query_executor_const(this->libObjPtr()))); |
| 30 | } |
| 31 | |
| 32 | bool isInterrupted() const noexcept |
| 33 | { |
| 34 | return static_cast<bool>(bt_query_executor_is_interrupted( |
| 35 | bt_private_query_executor_as_query_executor_const(this->libObjPtr()))); |
| 36 | } |
| 37 | }; |
| 38 | |
| 39 | } /* namespace bt2 */ |
| 40 | |
| 41 | #endif /* BABELTRACE_CPP_COMMON_BT2_PRIVATE_QUERY_EXECUTOR_HPP */ |