2 * Copyright (c) 2024 EfficiOS, Inc.
4 * SPDX-License-Identifier: MIT
7 #ifndef BABELTRACE_CPP_COMMON_BT2_PLUGIN_SET_HPP
8 #define BABELTRACE_CPP_COMMON_BT2_PLUGIN_SET_HPP
12 #include <babeltrace2/babeltrace.h>
14 #include "borrowed-object.hpp"
15 #include "shared-object.hpp"
20 struct PluginSetRefFuncs
22 static void get(const bt_plugin_set * const libObjPtr) noexcept
24 bt_plugin_set_get_ref(libObjPtr);
27 static void put(const bt_plugin_set * const libObjPtr) noexcept
29 bt_plugin_set_put_ref(libObjPtr);
33 } /* namespace internal */
35 class ConstPluginSet final : public BorrowedObject<const bt_plugin_set>
38 using Shared = SharedObject<ConstPluginSet, const bt_plugin_set, internal::PluginSetRefFuncs>;
40 explicit ConstPluginSet(const bt_plugin_set * const plugin_set) :
41 _ThisBorrowedObject {plugin_set}
45 std::uint64_t length() const noexcept
47 return bt_plugin_set_get_plugin_count(this->libObjPtr());
53 #endif /* BABELTRACE_CPP_COMMON_BT2_PLUGIN_SET_HPP */